iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🙂

Fixing CVAT Login Screen Issues After docker-compose and Migrating to a New Version

に公開
2026/01/05

1. Issues with standard CVAT Docker containers

Django's web server startup health check has a default setting: free storage space must be at least 10% of the total storage capacity. However, my main PC, which has 2TB of storage, can only maintain 2% free space at all times, making it impossible to start CVAT via docker compose. While the web version of CVAT (free for up to 10 projects) has comparable usability, the web server has been very unstable about once a week for a long time. Frequent server errors occur when downloading annotation results or saving progress, causing all operations to fail after hours of waiting. This significantly impacts work efficiency, so I am determined to migrate from the web version to the local version of CVAT.

Since few people are unable to secure more than 10% free space on local storage, I couldn't find any articles that explicitly organized a solution to this problem.

2. How to reproduce the issue

As shown below, you can reproduce the problem by starting CVAT using docker compose or docker-compose following the official tutorial.

  1. Clone CVAT and start all necessary resources using docker compose or docker-compose.
    git clone https://github.com/opencv/cvat.git
    cd cvat
    # Checkout a version equivalent to v2.11.1
    git checkout bf4089ead320d8f6a80e0a1793c8406ec46daee8
    # Or checkout version v2.54.0
    git checkout v2.54.0
    
    docker compose up -d
    
  2. Open your browser and access http://localhost:8080.
  3. You will be kept waiting for 30 seconds in the Connecting... state.
    waiting
  4. After 30 seconds, an error suddenly appears. At the timing when the login screen should be displayed, the following error pops up in a dialog, and CVAT cannot be accessed. Note that the displayed error message is meaningless and provides no hint as to why the login screen is inaccessible.
  • Error message
    Cannot connect to the server
    Make sure the CVAT backend and all necessary services
    (Database, Redis and Open Policy Agent) are running and available.
    If you upgraded from version 2.2.0 or earlier,
    manual actions may be needed, see the Upgrade Guide.
    
  • Error dialog
    error

3. How to run CVAT locally by bypassing the storage shortage issue

Follow the steps below to start CVAT. Use the custom CVAT I created by forking the official CVAT repository and removing the storage restriction, which has already been committed to GitHub.

3-1. Custom CVAT repository

https://github.com/PINTO0309/cvat_custom

3-2. Only two modifications were made

In the startup health check of Django, the part that checks for free storage space was changed from 10 (meaning 10%) to None. Note that the resources committed to my custom CVAT repository already reflect these changes, so you do not need to apply the following modifications yourself.

https://github.com/PINTO0309/cvat_custom/blob/f8935a48e0a20396558d7381169235bd79cf3d7b/cvat/settings/production.py#L15-L17

https://github.com/PINTO0309/cvat_custom/blob/f8935a48e0a20396558d7381169235bd79cf3d7b/cvat/settings/testing_rest.py#L24-L26

3-3. Relevant issue

3-4. Execution steps for Custom CVAT

Simply execute the following in order.

### Method 1:
# Clone resources equivalent to v2.11.1
git clone https://github.com/PINTO0309/cvat_custom.git
cd cvat_custom

### Method 2:
# Or clone the latest source code and checkout version v2.54.0
# If you are using docker compose, data stored in older versions is kept in volumes
# so it is preserved unless you run docker compose down -v
git clone https://github.com/cvat-ai/cvat.git
cd cvat
git checkout v2.54.0
# Append the following to the end of these two files:
cvat/settings/production.py
cvat/settings/testing_rest.py
# Append this:
HEALTH_CHECK = {
    'DISK_USAGE_MAX': None,
}
# Check the storage location (docker volumes) for data stored in old versions
# In the following case, you can recover by remounting *_cvat_data and *_cvat_db
# I see both cvat_custom_cvat_* and cvat_cvat_*, but I've been working
# in the cvat_custom_cvat_* environment, so I will remount those.
docker volume ls | grep cvat

local     cvat_custom_cvat_cache_db
local     cvat_custom_cvat_data
local     cvat_custom_cvat_db
local     cvat_custom_cvat_events_db
local     cvat_custom_cvat_inmem_db
local     cvat_custom_cvat_keys
local     cvat_custom_cvat_logs
local     cvat_cvat_cache_db
local     cvat_cvat_data
local     cvat_cvat_db
local     cvat_cvat_events_db
local     cvat_cvat_keys
local     cvat_cvat_logs
# Modify the bottom of docker-compose.yml as follows to adjust for remounting
# past DBs and data. This allows you to start the new version of CVAT while
# migrating all the data from the old version of CVAT.
# The key point is to specify external volumes by adding external: true and name:,
# and have docker compose refer to them with the cvat_db alias.
# volumes:
#   cvat_db:
#   cvat_data:
#   cvat_keys:
#   cvat_logs:
#   cvat_inmem_db:
#   cvat_events_db:
#   cvat_cache_db:
volumes:
  cvat_db:
    external: true
    name: cvat_custom_cvat_db
  cvat_data:
    external: true
    name: cvat_custom_cvat_data
  cvat_keys:
  cvat_logs:
  cvat_inmem_db:
  cvat_events_db:
  cvat_cache_db:

# Build the CVAT Docker image manually
docker compose \
-f docker-compose.yml \
-f docker-compose.dev.yml \
build

# Start CVAT
docker compose up -d

# Create a superuser
docker exec -it cvat_server bash \
-ic 'python3 ~/manage.py createsuperuser'

# Here, set the username, email address, password, and confirm password

Launch your browser and access http://localhost:8080. If the login screen shown below appears, it's a success.

Top portal after logging in. You can add Projects or Tasks here to complete all work locally.

That's it, Good luck!

4. References

https://github.com/opencv/cvat

https://opencv.github.io/cvat/docs/administration/basics/installation/

https://github.com/opencv/cvat/issues/5449

https://pypi.org/project/django-health-check/

https://github.com/revsys/django-health-check

Initialize cache_db to solve the problem of not being able to start CVAT after upgrading

https://zenn.dev/pinto0309/scraps/0343ed27607eb1

Discussion