cvat: Cannot connect to the CVAT server

My actions before raising this issue

Searched for previous issues (#5591)

Expected Behaviour

I was expecting CVAT to run in browser at http://localhost:8080, as described in the guidelines.

Current Behaviour

After running docker compose up -d and then accessing http://localhost:8080, the following pop-up error appears

Cannot connect to the server Make sure the CVAT backend and all necessary services (Database, Redis and Open Policy Agent) are running and available. 0 or >earlier, manual actions may be needed, see the Upgrade Guide.

Possible Solution

I started my PC and run CVAT, and now I get the above error. I don’t remember doing anything special the last time I did this.

Your Environment

  • Ubuntu 18.04 LTS
  • Docker version 23.0.3, build 3e7cbfd

I am not familiar with Docker and I have looked around but could not find a solution. What should I check first?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (1 by maintainers)

Most upvoted comments

I have the same error. Tried installing it on a new PC, it was working in the beginning, then after deploying Segment anything on Nuclio I got the same error on the new PC as well. When I delete the function in the nuclio dashboard, it is still not working.

cvat_server takes time to initialize. It’s normal to see the following error message sometimes during initialization:

{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:51Z"}

Wait for a few minutes, and then check if you can access your application.

*Remember to persist your CVAT_HOST environment variable.

@azhavoro

Is it the following steps? My CVAT root directory seems to have no .env.

Open a new terminal window. Run VScode from the virtual environment (run the following command from CVAT root directory): source .env/bin/activate && code Inside VScode, Open CVAT root dir Select server: debug configuration and run it (F5) to run REST server and its workers

Results of docker ps

CONTAINER ID   IMAGE                                      COMMAND                   CREATED          STATUS          PORTS                                                                                          NAMES
1e063d97e199   cvat/ui:dev                                "/docker-entrypoint.…"   11 minutes ago   Up 11 minutes   80/tcp                                                                                         cvat_ui
6931beed6959   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_worker_annotation
5a02e6ed0edc   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_worker_import
0484b4928b93   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_worker_export
216f7056cc9a   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_server
9444ef2509f5   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_utils
ad1bb01b1524   cvat/server:dev                            "/usr/bin/supervisor…"   11 minutes ago   Up 11 minutes   8080/tcp                                                                                       cvat_worker_webhooks
06fabbcbaac1   timberio/vector:0.26.0-alpine              "/usr/local/bin/vect…"   11 minutes ago   Up 11 minutes                                                                                                  cvat_vector
a8b39d7e884f   clickhouse/clickhouse-server:22.3-alpine   "/entrypoint.sh"          11 minutes ago   Up 11 minutes   8123/tcp, 9000/tcp, 9009/tcp                                                                   cvat_clickhouse
32c1ba705e9e   traefik:v2.9                               "/entrypoint.sh --pr…"   11 minutes ago   Up 11 minutes   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 80/tcp, 0.0.0.0:8090->8090/tcp, :::8090->8090/tcp   traefik
e2a8a54fc330   postgres:15-alpine                         "docker-entrypoint.s…"   11 minutes ago   Up 11 minutes   5432/tcp                                                                                       cvat_db
03df36df1f3f   grafana/grafana-oss:9.3.6                  "sh -euc 'mkdir -p /…"   11 minutes ago   Up 11 minutes   3000/tcp                                                                                       cvat_grafana
d4b97986f685   redis:4.0-alpine                           "docker-entrypoint.s…"   11 minutes ago   Up 11 minutes   6379/tcp                                                                                       cvat_redis
97ef4c98312c   openpolicyagent/opa:0.45.0-rootless        "/opa run --server -…"   11 minutes ago   Up 11 minutes                                                                                                  cvat_opa

Results of docker logs cvat_opa

{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:51Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:51Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:51Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:51Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:52Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:52Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:53Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:55Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:08:58Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:09:02Z"}
{"level":"error","msg":"Bundle load failed: request failed: Get \"http://cvat-server:8080/api/auth/rules\": dial tcp 172.18.0.9:8080: connect: connection refused","name":"cvat","plugin":"bundle","time":"2023-05-29T00:09:08Z"}

same problem here, with v246 and v260. It works at the beginning for few hours and starts to fail, with a slightly different error.

cvat_db                    FATAL:  password authentication failed for user "root"
cvat_db                  DETAIL:  User "root" has no password assigned.
cvat_db                   |     Connection matched pg_hba.conf line 102: "host all all all md5"
cvat_server               | Traceback (most recent call last):
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
cvat_server               |     self.connect()
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
cvat_server               |     return func(*args, **kwargs)
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/django/db/backends/base/base.py", line 270, in connect
cvat_server               |     self.connection = self.get_new_connection(conn_params)
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/django/utils/asyncio.py", line 26, in inner
cvat_server               |     return func(*args, **kwargs)
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
cvat_server               |     connection = self.Database.connect(**conn_params)
cvat_server               |   File "/opt/venv/lib/python3.10/site-packages/psycopg2/__init__.py", line 122, in connect
cvat_server               |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
cvat_server               | psycopg2.OperationalError: connection to server at "cvat_db" (192.168.16.3), port 5432 failed: fe_sendauth: no password supplied

I got the same problems and had already checked and confirmed that there is no problem with the memory. For me I found out that the problems may related to cvat_db -> there are no table created ( no List of relations found in cvat_db) but still not yet found out where the problems come from

cvat_db log:


fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... UTC
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2023-06-26 10:04:26.717 UTC [31] WARNING:  no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2023-06-26 10:05:10.292 UTC [37] LOG:  starting PostgreSQL 15.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-06-26 10:05:10.584 UTC [37] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
.2023-06-26 10:05:10.960 UTC [40] LOG:  database system was shut down at 2023-06-26 10:04:31 UTC
2023-06-26 10:05:11.312 UTC [37] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE


/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

waiting for server to shut down....2023-06-26 10:05:12.280 UTC [37] LOG:  received fast shutdown request
2023-06-26 10:05:12.485 UTC [37] LOG:  aborting any active transactions
2023-06-26 10:05:12.489 UTC [37] LOG:  background worker "logical replication launcher" (PID 43) exited with exit code 1
2023-06-26 10:05:12.489 UTC [38] LOG:  shutting down
2023-06-26 10:05:12.850 UTC [38] LOG:  checkpoint starting: shutdown immediate
...........2023-06-26 10:05:23.427 UTC [38] LOG:  checkpoint complete: wrote 918 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.792 s, sync=8.863 s, total=10.938 s; sync files=250, longest=0.350 s, average=0.036 s; distance=4222 kB, estimate=4222 kB
2023-06-26 10:05:23.435 UTC [37] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2023-06-26 10:05:23.842 UTC [1] LOG:  starting PostgreSQL 15.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
2023-06-26 10:05:23.842 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-06-26 10:05:23.842 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2023-06-26 10:05:24.307 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-06-26 10:05:24.567 UTC [54] LOG:  incomplete startup packet
2023-06-26 10:05:24.567 UTC [53] LOG:  database system was shut down at 2023-06-26 10:05:23 UTC
2023-06-26 10:05:24.881 UTC [1] LOG:  database system is ready to accept connections
2023-06-26 10:06:28.728 UTC [61] ERROR:  relation "authtoken_token" does not exist at character 363
2023-06-26 10:06:28.728 UTC [61] STATEMENT:  SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "authtoken_token" INNER JOIN "auth_user" ON ("authtoken_token"."user_id" = "auth_user"."id") WHERE "authtoken_token"."key" = '607c2de23bd84928f8a397d3ca8a96a2836351a7' LIMIT 21

look like problems start from CREATE DATABASE


/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

waiting for server to shut down....2023-06-26 10:05:12.280 UTC [37] LOG:  received fast shutdown request
2023-06-26 10:05:12.485 UTC [37] LOG:  aborting any active transactions
2023-06-26 10:05:12.489 UTC [37] LOG:  background worker "logical replication launcher" (PID 43) exited with exit code 1
2023-06-26 10:05:12.489 UTC [38] LOG:  shutting down
2023-06-26 10:05:12.850 UTC [38] LOG:  checkpoint starting: shutdown immediate
...........2023-06-26 10:05:23.427 UTC [38] LOG:  checkpoint complete: wrote 918 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.792 s, sync=8.863 s, total=10.938 s; sync files=250, longest=0.350 s, average=0.036 s; distance=4222 kB, estimate=4222 kB
2023-06-26 10:05:23.435 UTC [37] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.```

I got the same problems, at first it will works fine but then. The error appears to be said the server is error like posr above.