http://localhost/install reports an error 504 Gateway Time-out #12043

Closed
opened 2026-02-21 19:05:26 -05:00 by yindo · 8 comments
Owner

Originally created by @TT-web-byte on GitHub (Mar 24, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

V1.1.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Normal Docker deployment does not modify any configuration files

cd dify
cd docker
cp .env.example .env
docker compose up -d

✔️ Expected Behavior

No response

Actual Behavior

sudo docker compose logs

db-1  | 
nginx-1  | 2025/03/24 09:17:55 [notice] 10#10: using the "epoll" event method
web-1  | 
redis-1  | 1:C 24 Mar 2025 09:17:54.606 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
web-1       |                         -------------
weaviate-1  | {"action":"startup","default_vectorizer_module":"none","level":"info","msg":"the default vectorizer modules is set to \"none\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2025-03-24T09:17:54Z"}
weaviate-1  | {"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2025-03-24T09:17:54Z"}
nginx-1  | 2025/03/24 09:17:55 [notice] 10#10: nginx/1.27.4
worker-1    | Running migrations
worker-1    | 2025-03-24 09:18:01.389 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
db-1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
db-1        | 
weaviate-1  | {"action":"grpc_startup","level":"info","msg":"grpc server listening at [::]:50051","time":"2025-03-24T09:17:54Z"}
db-1        | 2025-03-24 09:17:54.651 UTC [1] LOG:  starting PostgreSQL 15.12 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
api-1       | Running migrations
db-1        | 2025-03-24 09:17:54.651 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
api-1       | 2025-03-24 09:18:01.337 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
sandbox-1   | 2025/03/24 09:17:54 setup.go:29: [INFO]initializing nodejs runner environment...
sandbox-1   | 2025/03/24 09:17:54 setup.go:85: [INFO]nodejs runner environment initialized
weaviate-1  | {"action":"restapi_management","level":"info","msg":"Serving weaviate at http://[::]:8080","time":"2025-03-24T09:17:54Z"}
weaviate-1  | {"action":"read_disk_use","level":"warning","msg":"disk usage currently at 93.71%, threshold set to 80.00%","path":"/var/lib/weaviate","time":"2025-03-24T09:18:24Z"}
redis-1     | 1:C 24 Mar 2025 09:17:54.606 # Redis version=6.2.17, bits=64, commit=00000000, modified=0, pid=1, just started
api-1       | 2025-03-24 09:18:01.338 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
db-1        | 2025-03-24 09:17:54.652 UTC [1] LOG:  listening on IPv6 address "::", port 5432
web-1       | 
web-1         | __/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
ssrf_proxy-1  | [ENTRYPOINT] re-create snakeoil self-signed certificate removed in the build process
nginx-1     | 2025/03/24 09:17:55 [notice] 10#10: built by gcc 12.2.0 (Debian 12.2.0-14) 
web-1         |  _\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
redis-1     | 1:C 24 Mar 2025 09:17:54.606 # Configuration loaded
db-1          | 2025-03-24 09:17:54.663 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
worker-1    | 2025-03-24 09:18:01.390 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
db-1          | 2025-03-24 09:17:54.678 UTC [29] LOG:  database system was shut down at 2025-03-24 09:11:24 UTC
db-1          | 2025-03-24 09:17:54.692 UTC [1] LOG:  database system is ready to accept connections
weaviate-1  | {"action":"set_shard_read_only","level":"warning","msg":"Set READONLY, disk usage currently at 93.71%, threshold set to 90.00%","path":"/var/lib/weaviate","time":"2025-03-24T09:18:24Z"}
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: OS: Linux 5.4.0-26-generic
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: start worker processes
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: start worker process 19
worker-1      | /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d'
worker-1      |   """
worker-1      | Preparing database migration...
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: start worker process 20
api-1       | /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d'
api-1         |   """
redis-1       | 1:M 24 Mar 2025 09:17:54.607 * monotonic clock: POSIX clock_gettime
plugin_daemon-1  | 2025/03/24 09:17:54 pool.go:32: [INFO]init routine pool, size: 10000
plugin_daemon-1  | 
nginx-1       | 2025/03/24 09:17:55 [notice] 10#10: start worker process 21
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 22
api-1         | Preparing database migration...
web-1         |   _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
redis-1          | 1:M 24 Mar 2025 09:17:54.608 * Running mode=standalone, port=6379.
web-1            |    _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
sandbox-1   | 2025/03/24 09:17:54 setup.go:33: [INFO]initializing python runner environment...
sandbox-1        | 2025/03/24 09:17:54 config.go:129: [INFO]network has been enabled
sandbox-1        | 2025/03/24 09:17:54 config.go:145: [INFO]using https proxy: http://ssrf_proxy:3128
plugin_daemon-1  | 2025/03/24 09:20:04 /app/internal/db/init.go:17
plugin_daemon-1  | [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
ssrf_proxy-1  | [ENTRYPOINT] replacing environment variables in the template
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 23
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Created PID file (/run/squid.pid)
redis-1          | 1:M 24 Mar 2025 09:17:54.608 # Server initialized
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 24
redis-1          | 1:M 24 Mar 2025 09:17:54.608 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis-1          | 1:M 24 Mar 2025 09:17:54.609 * Loading RDB produced by version 6.2.17
redis-1          | 1:M 24 Mar 2025 09:17:54.609 * RDB age 390 seconds
redis-1          | 1:M 24 Mar 2025 09:17:54.609 * RDB memory usage when created 0.77 Mb
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 25
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 26
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 27
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 28
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 29
ssrf_proxy-1     | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Creating missing swap directories
ssrf_proxy-1     | 2025/03/24 09:17:55| No cache_dir stores are configured.
ssrf_proxy-1     | 2025/03/24 09:17:55| Removing PID file (/run/squid.pid)
ssrf_proxy-1     | [ENTRYPOINT] starting squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Created PID file (/run/squid.pid)
ssrf_proxy-1     | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Creating missing swap directories
redis-1          | 1:M 24 Mar 2025 09:17:54.609 # Done loading RDB, keys loaded: 0, keys expired: 0.
redis-1          | 1:M 24 Mar 2025 09:17:54.609 * DB loaded from disk: 0.000 seconds
redis-1          | 1:M 24 Mar 2025 09:17:54.609 * Ready to accept connections
web-1            |     _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
web-1            |      _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
web-1            |       _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
web-1            |        _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
sandbox-1        | 2025/03/24 09:17:54 config.go:154: [INFO]using http proxy: http://ssrf_proxy:3128
sandbox-1        | 2025/03/24 09:17:54 server.go:20: [INFO]config init success
sandbox-1        | 2025/03/24 09:17:54 server.go:26: [INFO]runner dependencies init success
sandbox-1        | 2025/03/24 09:17:54 cocrrent.go:31: [INFO]setting max requests to 50
ssrf_proxy-1     | 2025/03/24 09:17:55| No cache_dir stores are configured.
ssrf_proxy-1     | 2025/03/24 09:17:55| Removing PID file (/run/squid.pid)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1)
ssrf_proxy-1     | 2025/03/24 09:17:55| Created PID file (/run/squid.pid)
sandbox-1        | 2025/03/24 09:17:54 cocrrent.go:13: [INFO]setting max workers to 4
sandbox-1        | 2025/03/24 09:17:54 server.go:47: [INFO]installing python dependencies...
sandbox-1        | 2025/03/24 09:17:54 server.go:53: [INFO]python dependencies installed
sandbox-1        | 2025/03/24 09:17:54 server.go:55: [INFO]initializing python dependencies sandbox...
sandbox-1        | [GIN] 2025/03/24 - 09:18:24 | 200 |      32.171µs |             ::1 | GET      "/health"
sandbox-1        | 2025/03/24 09:18:27 env.go:30: [WARN]python lib path /usr/lib/python3.10 is not available
sandbox-1        | 2025/03/24 09:18:27 env.go:30: [WARN]python lib path /usr/lib/python3 is not available
ssrf_proxy-1     | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Starting Squid Cache version 6.10 for x86_64-pc-linux-gnu...
ssrf_proxy-1     | 2025/03/24 09:17:55| Service Name: squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Process ID 45
web-1            |         _\///______________\///______________\///__\///////////////__
sandbox-1        | 2025/03/24 09:18:50 env.go:30: [WARN]python lib path /run/systemd/resolve/stub-resolv.conf is not available
web-1            | 
sandbox-1        | 2025/03/24 09:18:50 env.go:30: [WARN]python lib path /run/resolvconf/resolv.conf is not available
sandbox-1        | [GIN] 2025/03/24 - 09:18:54 | 200 |      70.691µs |             ::1 | GET      "/health"
sandbox-1        | 2025/03/24 09:19:04 server.go:60: [INFO]python dependencies sandbox initialized
sandbox-1        | [GIN] 2025/03/24 - 09:19:24 | 200 |      53.469µs |             ::1 | GET      "/health"
sandbox-1        | [GIN] 2025/03/24 - 09:19:54 | 200 |     392.762µs |             ::1 | GET      "/health"
web-1            | 
web-1            |                           Runtime Edition
sandbox-1        | [GIN] 2025/03/24 - 09:20:24 | 200 |      68.038µs |             ::1 | GET      "/health"
ssrf_proxy-1     | 2025/03/24 09:17:55| Process Roles: master worker
ssrf_proxy-1     | 2025/03/24 09:17:55| With 1024 file descriptors available
web-1            | 
web-1            |         PM2 is a Production Process Manager for Node.js applications
web-1            |                      with a built-in Load Balancer.
web-1            | 
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 30
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 31
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 32
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 33
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 34
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 35
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 36
ssrf_proxy-1     | 2025/03/24 09:17:55| Initializing IP Cache...
ssrf_proxy-1     | 2025/03/24 09:17:55| DNS IPv6 socket created at [::], FD 8
ssrf_proxy-1     | 2025/03/24 09:17:55| DNS IPv4 socket created at 0.0.0.0, FD 9
ssrf_proxy-1     | 2025/03/24 09:17:55| Adding nameserver 127.0.0.11 from /etc/resolv.conf
ssrf_proxy-1     | 2025/03/24 09:17:55| Adding ndots 1 from /etc/resolv.conf
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 37
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 38
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 39
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 40
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 41
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 42
web-1            |                 Start and Daemonize any application:
web-1            |                 $ pm2 start app.js
web-1            | 
web-1            |                 Load Balance 4 instances of api.js:
web-1            |                 $ pm2 start api.js -i 4
web-1            | 
ssrf_proxy-1     | 2025/03/24 09:17:55| Logfile: opening log daemon:/var/log/squid/access.log
ssrf_proxy-1     | 2025/03/24 09:17:55| Logfile Daemon: opening log /var/log/squid/access.log
ssrf_proxy-1     | 2025/03/24 09:17:55| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
ssrf_proxy-1     | 2025/03/24 09:17:55| Store logging disabled
ssrf_proxy-1     | 2025/03/24 09:17:55| Swap maxSize 0 + 262144 KB, estimated 20164 objects
ssrf_proxy-1     | 2025/03/24 09:17:55| Target number of buckets: 1008
web-1            |                 Monitor in production:
web-1            |                 $ pm2 monitor
web-1            | 
web-1            |                 Make pm2 auto-boot at server restart:
web-1            |                 $ pm2 startup
web-1            | 
web-1            |                 To go further checkout:
ssrf_proxy-1     | 2025/03/24 09:17:55| Using 8192 Store buckets
ssrf_proxy-1     | 2025/03/24 09:17:55| Max Mem  size: 262144 KB
ssrf_proxy-1     | 2025/03/24 09:17:55| Max Swap size: 0 KB
ssrf_proxy-1     | 2025/03/24 09:17:55| Using Least Load store dir selection
ssrf_proxy-1     | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid
ssrf_proxy-1     | 2025/03/24 09:17:55| Finished loading MIME types and icons.
web-1            |                 http://pm2.io/
web-1            | 
web-1            | 
web-1            |                         -------------
web-1            | 
web-1            | pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages)
ssrf_proxy-1     | 2025/03/24 09:17:55| HTCP Disabled.
ssrf_proxy-1     | 2025/03/24 09:17:55| Pinger socket opened on FD 15
ssrf_proxy-1     | 2025/03/24 09:17:55| Squid plugin modules loaded: 0
ssrf_proxy-1     | 2025/03/24 09:17:55| Adaptation support is off.
ssrf_proxy-1     | 2025/03/24 09:17:55| Accepting HTTP Socket connections at conn3 local=[::]:3128 remote=[::] FD 12 flags=9
web-1            | 2025-03-24T09:17:55: PM2 log: Launching in no daemon mode
web-1            | 2025-03-24T09:17:55: PM2 log: [PM2] Starting /app/web/server.js in cluster_mode (2 instances)
web-1            | 2025-03-24T09:17:55: PM2 log: App [dify-web:0] starting in -cluster mode-
web-1            | 2025-03-24T09:17:55: PM2 log: App [dify-web:0] online
web-1            | 2025-03-24T09:17:55: PM2 log: App [dify-web:1] starting in -cluster mode-
web-1            | 2025-03-24T09:17:55: PM2 log: App [dify-web:1] online
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 43
ssrf_proxy-1     |     listening port: 3128
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 44
ssrf_proxy-1     | 2025/03/24 09:17:55| Accepting reverse-proxy HTTP Socket connections at conn5 local=[::]:8194 remote=[::] FD 13 flags=9
ssrf_proxy-1     |     listening port: 8194
ssrf_proxy-1     | 2025/03/24 09:17:55| Configuring Parent sandbox
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 45
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 46
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 47
ssrf_proxy-1     | 2025/03/24 09:17:55 pinger| Initialising ICMP pinger ...
ssrf_proxy-1     | 2025/03/24 09:17:55 pinger| ICMP socket opened.
ssrf_proxy-1     | 2025/03/24 09:17:55 pinger| ICMPv6 socket opened
ssrf_proxy-1     | 2025/03/24 09:17:56| storeLateRelease: released 0 objects
ssrf_proxy-1     | 2025/03/24 09:18:25| ERROR: Connection to sandbox failed
ssrf_proxy-1     | 2025/03/24 09:18:25| Detected DEAD Parent: sandbox
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 48
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 49
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 50
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 51
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 52
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 53
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 54
web-1            | 2025-03-24T09:17:55: PM2 log: [PM2] Done.
web-1            | 2025-03-24T09:17:55: PM2 log: ┌────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
web-1            | │ id │ name        │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 55
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 56
web-1            | ├────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
web-1            | │ 0  │ dify-web    │ default     │ 1.1.2   │ cluster │ 23       │ 0s     │ 0    │ online    │ 0%       │ 55.1mb   │ undefin… │ disabled │
web-1            | │ 1  │ dify-web    │ default     │ 1.1.2   │ cluster │ 30       │ 0s     │ 0    │ online    │ 0%       │ 50.7mb   │ undefin… │ disabled │
web-1            | └────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
web-1            | 2025-03-24T09:17:55: PM2 log: [--no-daemon] Continue to stream logs
web-1            | 2025-03-24T09:17:55: PM2 log: [--no-daemon] Exit on target PM2 exit pid=7
web-1            | 09:17:55 0|dify-web  |    ▲ Next.js 15.2.3
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 57
nginx-1          | 2025/03/24 09:17:55 [notice] 10#10: start worker process 58
nginx-1          | 172.18.0.1 - - [24/Mar/2025:09:18:16 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
nginx-1          | 172.18.0.1 - - [24/Mar/2025:09:18:32 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
nginx-1          | 2025/03/24 09:19:32 [error] 21#21: *5 upstream timed out (110: Connection timed out) while connecting to upstream, client: 172.18.0.1, server: _, request: "GET /install HTTP/1.1", upstream: "http://172.18.0.5:3000/install", host: "localhost"
web-1            | 09:17:55 0|dify-web  |    - Local:        http://640f2a71a1b9:3000
web-1            | 09:17:55 0|dify-web  |    - Network:      http://640f2a71a1b9:3000
web-1            | 09:17:55 0|dify-web  |  ✓ Starting...
web-1            | 09:17:55 1|dify-web  |    ▲ Next.js 15.2.3
web-1            | 09:17:55 1|dify-web  |    - Local:        http://640f2a71a1b9:3000
web-1            | 09:17:55 1|dify-web  |    - Network:      http://640f2a71a1b9:3000
web-1            | 09:17:55 1|dify-web  |  ✓ Starting...
web-1            | 09:17:55 0|dify-web  |  ✓ Ready in 115ms
web-1            | 09:17:55 1|dify-web  |  ✓ Ready in 111ms
nginx-1          | 172.18.0.1 - - [24/Mar/2025:09:19:32 +0000] "GET /install HTTP/1.1" 504 167 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
Originally created by @TT-web-byte on GitHub (Mar 24, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version V1.1.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Normal Docker deployment does not modify any configuration files cd dify cd docker cp .env.example .env docker compose up -d ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior sudo docker compose logs ``` db-1 | nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: using the "epoll" event method web-1 | redis-1 | 1:C 24 Mar 2025 09:17:54.606 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo web-1 | ------------- weaviate-1 | {"action":"startup","default_vectorizer_module":"none","level":"info","msg":"the default vectorizer modules is set to \"none\", as a result all new schema classes without an explicit vectorizer setting, will use this vectorizer","time":"2025-03-24T09:17:54Z"} weaviate-1 | {"action":"startup","auto_schema_enabled":true,"level":"info","msg":"auto schema enabled setting is set to \"true\"","time":"2025-03-24T09:17:54Z"} nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: nginx/1.27.4 worker-1 | Running migrations worker-1 | 2025-03-24 09:18:01.389 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization db-1 | weaviate-1 | {"action":"grpc_startup","level":"info","msg":"grpc server listening at [::]:50051","time":"2025-03-24T09:17:54Z"} db-1 | 2025-03-24 09:17:54.651 UTC [1] LOG: starting PostgreSQL 15.12 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit api-1 | Running migrations db-1 | 2025-03-24 09:17:54.651 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 api-1 | 2025-03-24 09:18:01.337 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. sandbox-1 | 2025/03/24 09:17:54 setup.go:29: [INFO]initializing nodejs runner environment... sandbox-1 | 2025/03/24 09:17:54 setup.go:85: [INFO]nodejs runner environment initialized weaviate-1 | {"action":"restapi_management","level":"info","msg":"Serving weaviate at http://[::]:8080","time":"2025-03-24T09:17:54Z"} weaviate-1 | {"action":"read_disk_use","level":"warning","msg":"disk usage currently at 93.71%, threshold set to 80.00%","path":"/var/lib/weaviate","time":"2025-03-24T09:18:24Z"} redis-1 | 1:C 24 Mar 2025 09:17:54.606 # Redis version=6.2.17, bits=64, commit=00000000, modified=0, pid=1, just started api-1 | 2025-03-24 09:18:01.338 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. db-1 | 2025-03-24 09:17:54.652 UTC [1] LOG: listening on IPv6 address "::", port 5432 web-1 | web-1 | __/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____ ssrf_proxy-1 | [ENTRYPOINT] re-create snakeoil self-signed certificate removed in the build process nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: built by gcc 12.2.0 (Debian 12.2.0-14) web-1 | _\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___ redis-1 | 1:C 24 Mar 2025 09:17:54.606 # Configuration loaded db-1 | 2025-03-24 09:17:54.663 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" worker-1 | 2025-03-24 09:18:01.390 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. db-1 | 2025-03-24 09:17:54.678 UTC [29] LOG: database system was shut down at 2025-03-24 09:11:24 UTC db-1 | 2025-03-24 09:17:54.692 UTC [1] LOG: database system is ready to accept connections weaviate-1 | {"action":"set_shard_read_only","level":"warning","msg":"Set READONLY, disk usage currently at 93.71%, threshold set to 90.00%","path":"/var/lib/weaviate","time":"2025-03-24T09:18:24Z"} nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: OS: Linux 5.4.0-26-generic nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: getrlimit(RLIMIT_NOFILE): 1048576:1048576 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker processes nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 19 worker-1 | /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d' worker-1 | """ worker-1 | Preparing database migration... nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 20 api-1 | /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d' api-1 | """ redis-1 | 1:M 24 Mar 2025 09:17:54.607 * monotonic clock: POSIX clock_gettime plugin_daemon-1 | 2025/03/24 09:17:54 pool.go:32: [INFO]init routine pool, size: 10000 plugin_daemon-1 | nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 21 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 22 api-1 | Preparing database migration... web-1 | _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__ redis-1 | 1:M 24 Mar 2025 09:17:54.608 * Running mode=standalone, port=6379. web-1 | _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___ sandbox-1 | 2025/03/24 09:17:54 setup.go:33: [INFO]initializing python runner environment... sandbox-1 | 2025/03/24 09:17:54 config.go:129: [INFO]network has been enabled sandbox-1 | 2025/03/24 09:17:54 config.go:145: [INFO]using https proxy: http://ssrf_proxy:3128 plugin_daemon-1 | 2025/03/24 09:20:04 /app/internal/db/init.go:17 plugin_daemon-1 | [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) ssrf_proxy-1 | [ENTRYPOINT] replacing environment variables in the template nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 23 ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Created PID file (/run/squid.pid) redis-1 | 1:M 24 Mar 2025 09:17:54.608 # Server initialized nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 24 redis-1 | 1:M 24 Mar 2025 09:17:54.608 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis-1 | 1:M 24 Mar 2025 09:17:54.609 * Loading RDB produced by version 6.2.17 redis-1 | 1:M 24 Mar 2025 09:17:54.609 * RDB age 390 seconds redis-1 | 1:M 24 Mar 2025 09:17:54.609 * RDB memory usage when created 0.77 Mb nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 25 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 26 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 27 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 28 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 29 ssrf_proxy-1 | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid ssrf_proxy-1 | 2025/03/24 09:17:55| Creating missing swap directories ssrf_proxy-1 | 2025/03/24 09:17:55| No cache_dir stores are configured. ssrf_proxy-1 | 2025/03/24 09:17:55| Removing PID file (/run/squid.pid) ssrf_proxy-1 | [ENTRYPOINT] starting squid ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Created PID file (/run/squid.pid) ssrf_proxy-1 | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid ssrf_proxy-1 | 2025/03/24 09:17:55| Creating missing swap directories redis-1 | 1:M 24 Mar 2025 09:17:54.609 # Done loading RDB, keys loaded: 0, keys expired: 0. redis-1 | 1:M 24 Mar 2025 09:17:54.609 * DB loaded from disk: 0.000 seconds redis-1 | 1:M 24 Mar 2025 09:17:54.609 * Ready to accept connections web-1 | _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____ web-1 | _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________ web-1 | _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________ web-1 | _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_ sandbox-1 | 2025/03/24 09:17:54 config.go:154: [INFO]using http proxy: http://ssrf_proxy:3128 sandbox-1 | 2025/03/24 09:17:54 server.go:20: [INFO]config init success sandbox-1 | 2025/03/24 09:17:54 server.go:26: [INFO]runner dependencies init success sandbox-1 | 2025/03/24 09:17:54 cocrrent.go:31: [INFO]setting max requests to 50 ssrf_proxy-1 | 2025/03/24 09:17:55| No cache_dir stores are configured. ssrf_proxy-1 | 2025/03/24 09:17:55| Removing PID file (/run/squid.pid) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/squid.conf (depth 0) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/debian.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Processing Configuration File: /etc/squid/conf.d/rock.conf (depth 1) ssrf_proxy-1 | 2025/03/24 09:17:55| Created PID file (/run/squid.pid) sandbox-1 | 2025/03/24 09:17:54 cocrrent.go:13: [INFO]setting max workers to 4 sandbox-1 | 2025/03/24 09:17:54 server.go:47: [INFO]installing python dependencies... sandbox-1 | 2025/03/24 09:17:54 server.go:53: [INFO]python dependencies installed sandbox-1 | 2025/03/24 09:17:54 server.go:55: [INFO]initializing python dependencies sandbox... sandbox-1 | [GIN] 2025/03/24 - 09:18:24 | 200 | 32.171µs | ::1 | GET "/health" sandbox-1 | 2025/03/24 09:18:27 env.go:30: [WARN]python lib path /usr/lib/python3.10 is not available sandbox-1 | 2025/03/24 09:18:27 env.go:30: [WARN]python lib path /usr/lib/python3 is not available ssrf_proxy-1 | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid ssrf_proxy-1 | 2025/03/24 09:17:55| Starting Squid Cache version 6.10 for x86_64-pc-linux-gnu... ssrf_proxy-1 | 2025/03/24 09:17:55| Service Name: squid ssrf_proxy-1 | 2025/03/24 09:17:55| Process ID 45 web-1 | _\///______________\///______________\///__\///////////////__ sandbox-1 | 2025/03/24 09:18:50 env.go:30: [WARN]python lib path /run/systemd/resolve/stub-resolv.conf is not available web-1 | sandbox-1 | 2025/03/24 09:18:50 env.go:30: [WARN]python lib path /run/resolvconf/resolv.conf is not available sandbox-1 | [GIN] 2025/03/24 - 09:18:54 | 200 | 70.691µs | ::1 | GET "/health" sandbox-1 | 2025/03/24 09:19:04 server.go:60: [INFO]python dependencies sandbox initialized sandbox-1 | [GIN] 2025/03/24 - 09:19:24 | 200 | 53.469µs | ::1 | GET "/health" sandbox-1 | [GIN] 2025/03/24 - 09:19:54 | 200 | 392.762µs | ::1 | GET "/health" web-1 | web-1 | Runtime Edition sandbox-1 | [GIN] 2025/03/24 - 09:20:24 | 200 | 68.038µs | ::1 | GET "/health" ssrf_proxy-1 | 2025/03/24 09:17:55| Process Roles: master worker ssrf_proxy-1 | 2025/03/24 09:17:55| With 1024 file descriptors available web-1 | web-1 | PM2 is a Production Process Manager for Node.js applications web-1 | with a built-in Load Balancer. web-1 | nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 30 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 31 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 32 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 33 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 34 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 35 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 36 ssrf_proxy-1 | 2025/03/24 09:17:55| Initializing IP Cache... ssrf_proxy-1 | 2025/03/24 09:17:55| DNS IPv6 socket created at [::], FD 8 ssrf_proxy-1 | 2025/03/24 09:17:55| DNS IPv4 socket created at 0.0.0.0, FD 9 ssrf_proxy-1 | 2025/03/24 09:17:55| Adding nameserver 127.0.0.11 from /etc/resolv.conf ssrf_proxy-1 | 2025/03/24 09:17:55| Adding ndots 1 from /etc/resolv.conf nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 37 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 38 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 39 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 40 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 41 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 42 web-1 | Start and Daemonize any application: web-1 | $ pm2 start app.js web-1 | web-1 | Load Balance 4 instances of api.js: web-1 | $ pm2 start api.js -i 4 web-1 | ssrf_proxy-1 | 2025/03/24 09:17:55| Logfile: opening log daemon:/var/log/squid/access.log ssrf_proxy-1 | 2025/03/24 09:17:55| Logfile Daemon: opening log /var/log/squid/access.log ssrf_proxy-1 | 2025/03/24 09:17:55| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec ssrf_proxy-1 | 2025/03/24 09:17:55| Store logging disabled ssrf_proxy-1 | 2025/03/24 09:17:55| Swap maxSize 0 + 262144 KB, estimated 20164 objects ssrf_proxy-1 | 2025/03/24 09:17:55| Target number of buckets: 1008 web-1 | Monitor in production: web-1 | $ pm2 monitor web-1 | web-1 | Make pm2 auto-boot at server restart: web-1 | $ pm2 startup web-1 | web-1 | To go further checkout: ssrf_proxy-1 | 2025/03/24 09:17:55| Using 8192 Store buckets ssrf_proxy-1 | 2025/03/24 09:17:55| Max Mem size: 262144 KB ssrf_proxy-1 | 2025/03/24 09:17:55| Max Swap size: 0 KB ssrf_proxy-1 | 2025/03/24 09:17:55| Using Least Load store dir selection ssrf_proxy-1 | 2025/03/24 09:17:55| Set Current Directory to /var/spool/squid ssrf_proxy-1 | 2025/03/24 09:17:55| Finished loading MIME types and icons. web-1 | http://pm2.io/ web-1 | web-1 | web-1 | ------------- web-1 | web-1 | pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages) ssrf_proxy-1 | 2025/03/24 09:17:55| HTCP Disabled. ssrf_proxy-1 | 2025/03/24 09:17:55| Pinger socket opened on FD 15 ssrf_proxy-1 | 2025/03/24 09:17:55| Squid plugin modules loaded: 0 ssrf_proxy-1 | 2025/03/24 09:17:55| Adaptation support is off. ssrf_proxy-1 | 2025/03/24 09:17:55| Accepting HTTP Socket connections at conn3 local=[::]:3128 remote=[::] FD 12 flags=9 web-1 | 2025-03-24T09:17:55: PM2 log: Launching in no daemon mode web-1 | 2025-03-24T09:17:55: PM2 log: [PM2] Starting /app/web/server.js in cluster_mode (2 instances) web-1 | 2025-03-24T09:17:55: PM2 log: App [dify-web:0] starting in -cluster mode- web-1 | 2025-03-24T09:17:55: PM2 log: App [dify-web:0] online web-1 | 2025-03-24T09:17:55: PM2 log: App [dify-web:1] starting in -cluster mode- web-1 | 2025-03-24T09:17:55: PM2 log: App [dify-web:1] online nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 43 ssrf_proxy-1 | listening port: 3128 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 44 ssrf_proxy-1 | 2025/03/24 09:17:55| Accepting reverse-proxy HTTP Socket connections at conn5 local=[::]:8194 remote=[::] FD 13 flags=9 ssrf_proxy-1 | listening port: 8194 ssrf_proxy-1 | 2025/03/24 09:17:55| Configuring Parent sandbox nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 45 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 46 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 47 ssrf_proxy-1 | 2025/03/24 09:17:55 pinger| Initialising ICMP pinger ... ssrf_proxy-1 | 2025/03/24 09:17:55 pinger| ICMP socket opened. ssrf_proxy-1 | 2025/03/24 09:17:55 pinger| ICMPv6 socket opened ssrf_proxy-1 | 2025/03/24 09:17:56| storeLateRelease: released 0 objects ssrf_proxy-1 | 2025/03/24 09:18:25| ERROR: Connection to sandbox failed ssrf_proxy-1 | 2025/03/24 09:18:25| Detected DEAD Parent: sandbox nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 48 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 49 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 50 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 51 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 52 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 53 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 54 web-1 | 2025-03-24T09:17:55: PM2 log: [PM2] Done. web-1 | 2025-03-24T09:17:55: PM2 log: ┌────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ web-1 | │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 55 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 56 web-1 | ├────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ web-1 | │ 0 │ dify-web │ default │ 1.1.2 │ cluster │ 23 │ 0s │ 0 │ online │ 0% │ 55.1mb │ undefin… │ disabled │ web-1 | │ 1 │ dify-web │ default │ 1.1.2 │ cluster │ 30 │ 0s │ 0 │ online │ 0% │ 50.7mb │ undefin… │ disabled │ web-1 | └────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ web-1 | 2025-03-24T09:17:55: PM2 log: [--no-daemon] Continue to stream logs web-1 | 2025-03-24T09:17:55: PM2 log: [--no-daemon] Exit on target PM2 exit pid=7 web-1 | 09:17:55 0|dify-web | ▲ Next.js 15.2.3 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 57 nginx-1 | 2025/03/24 09:17:55 [notice] 10#10: start worker process 58 nginx-1 | 172.18.0.1 - - [24/Mar/2025:09:18:16 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" nginx-1 | 172.18.0.1 - - [24/Mar/2025:09:18:32 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" nginx-1 | 2025/03/24 09:19:32 [error] 21#21: *5 upstream timed out (110: Connection timed out) while connecting to upstream, client: 172.18.0.1, server: _, request: "GET /install HTTP/1.1", upstream: "http://172.18.0.5:3000/install", host: "localhost" web-1 | 09:17:55 0|dify-web | - Local: http://640f2a71a1b9:3000 web-1 | 09:17:55 0|dify-web | - Network: http://640f2a71a1b9:3000 web-1 | 09:17:55 0|dify-web | ✓ Starting... web-1 | 09:17:55 1|dify-web | ▲ Next.js 15.2.3 web-1 | 09:17:55 1|dify-web | - Local: http://640f2a71a1b9:3000 web-1 | 09:17:55 1|dify-web | - Network: http://640f2a71a1b9:3000 web-1 | 09:17:55 1|dify-web | ✓ Starting... web-1 | 09:17:55 0|dify-web | ✓ Ready in 115ms web-1 | 09:17:55 1|dify-web | ✓ Ready in 111ms nginx-1 | 172.18.0.1 - - [24/Mar/2025:09:19:32 +0000] "GET /install HTTP/1.1" 504 167 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" ```
yindo added the 🌚 invalid🤔 cant-reproduce labels 2026-02-21 19:05:26 -05:00
yindo closed this issue 2026-02-21 19:05:27 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

Hey there, @TT-web-byte! 👋 I'm here to assist you with bugs, questions, and more while you wait for a human maintainer. Let's squash those bugs together!

I found a similar open issue regarding a 504 Gateway Time-out error when accessing the Dify installation page. Here are some steps you can take to troubleshoot and potentially resolve the issue:

  1. Check Docker Containers: Ensure all Docker containers are running smoothly by executing docker compose ps and checking logs for any errors with docker logs <container_name>.

  2. Nginx Configuration: Verify that the Nginx reverse proxy is correctly configured and running, as it handles routing for the application. Check the Nginx configuration files to ensure they are correctly set up to route requests to the appropriate services.

  3. Environment Variables: Check the environment variables in your .env file to ensure they are correctly set, especially those related to server configuration and URLs.

  4. Restart Docker Containers: Restart the Docker containers using:

    docker compose down
    docker compose up -d
    
  5. Database Connection: The logs indicate a database connection timeout. Ensure that the database service is running and accessible. Check the database connection parameters in your configuration files.

  6. Network and Firewall: Ensure that no firewall rules are blocking the necessary ports (e.g., 80, 443, 5001) and that your network settings allow for the required connections.

  7. Resource Limitations: Check if the server running the database has enough resources (CPU, memory) to handle the connection requests promptly. The recommended system resource requirements for running Dify in a Docker environment are a CPU with at least 2 cores and RAM of at least 4 GiB [1].

These steps should help you identify and resolve the issue causing the 504 Gateway Time-out error.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Greeting --> Hey there, @TT-web-byte! 👋 I'm here to assist you with bugs, questions, and more while you wait for a human maintainer. Let's squash those bugs together! <!-- Answer --> I found a similar open issue regarding a 504 Gateway Time-out error when accessing the Dify installation page. Here are some steps you can take to troubleshoot and potentially resolve the issue: 1. **Check Docker Containers**: Ensure all Docker containers are running smoothly by executing `docker compose ps` and checking logs for any errors with `docker logs <container_name>`. 2. **Nginx Configuration**: Verify that the Nginx reverse proxy is correctly configured and running, as it handles routing for the application. Check the Nginx configuration files to ensure they are correctly set up to route requests to the appropriate services. 3. **Environment Variables**: Check the environment variables in your `.env` file to ensure they are correctly set, especially those related to server configuration and URLs. 4. **Restart Docker Containers**: Restart the Docker containers using: ```bash docker compose down docker compose up -d ``` 5. **Database Connection**: The logs indicate a database connection timeout. Ensure that the database service is running and accessible. Check the database connection parameters in your configuration files. 6. **Network and Firewall**: Ensure that no firewall rules are blocking the necessary ports (e.g., 80, 443, 5001) and that your network settings allow for the required connections. 7. **Resource Limitations**: Check if the server running the database has enough resources (CPU, memory) to handle the connection requests promptly. The recommended system resource requirements for running Dify in a Docker environment are a CPU with at least 2 cores and RAM of at least 4 GiB <sup>[[1]](https://github.com/langgenius/dify/blob/main/README.md)</sup>. These steps should help you identify and resolve the issue causing the 504 Gateway Time-out error. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/c51bcfea-67ca-465f-805a-b19bb1a91fea?feedback_type=other)</sup>
Author
Owner

@TT-web-byte commented on GitHub (Mar 24, 2025):

@dosu Hi,The following are the running logs of each container:

sudo docker logs docker-plugin_daemon-1
2025/03/24 09:17:54 pool.go:32: [INFO]init routine pool, size: 10000

2025/03/24 09:20:04 /app/internal/db/init.go:17
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)

2025/03/24 09:22:15 /app/internal/db/init.go:21
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
2025/03/24 09:22:15 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out))

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc000401d00, 0x1, 0x1})
	/app/internal/utils/log/log.go:40 +0x326
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
	/app/internal/utils/log/log.go:66
github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?)
	/app/internal/db/init.go:144 +0xde
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc0001161e0, 0xc0000f0388)
	/app/internal/server/server.go:67 +0xd2
main.main()
	/app/cmd/server/main.go:28 +0xff
2025/03/24 09:22:16 pool.go:32: [INFO]init routine pool, size: 10000

2025/03/24 09:24:26 /app/internal/db/init.go:17
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)

2025/03/24 09:26:38 /app/internal/db/init.go:21
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
2025/03/24 09:26:38 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out))

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc000453d00, 0x1, 0x1})
	/app/internal/utils/log/log.go:40 +0x326
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
	/app/internal/utils/log/log.go:66
github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?)
	/app/internal/db/init.go:144 +0xde
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc00012ab88, 0xc00014c708)
	/app/internal/server/server.go:67 +0xd2
main.main()
	/app/cmd/server/main.go:28 +0xff
2025/03/24 09:26:38 pool.go:32: [INFO]init routine pool, size: 10000

2025/03/24 09:28:49 /app/internal/db/init.go:17
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)

2025/03/24 09:31:00 /app/internal/db/init.go:21
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
2025/03/24 09:31:00 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out))

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc0003e5d00, 0x1, 0x1})
	/app/internal/utils/log/log.go:40 +0x326
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
	/app/internal/utils/log/log.go:66
github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?)
	/app/internal/db/init.go:144 +0xde
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc000116330, 0xc00047f188)
	/app/internal/server/server.go:67 +0xd2
main.main()
	/app/cmd/server/main.go:28 +0xff
2025/03/24 09:31:00 pool.go:32: [INFO]init routine pool, size: 10000

2025/03/24 09:33:11 /app/internal/db/init.go:17
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)

2025/03/24 09:35:22 /app/internal/db/init.go:21
[error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
2025/03/24 09:35:22 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)
panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out))

goroutine 1 [running]:
github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc00041fd00, 0x1, 0x1})
	/app/internal/utils/log/log.go:40 +0x326
github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...)
	/app/internal/utils/log/log.go:66
github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?)
	/app/internal/db/init.go:144 +0xde
github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc000010330, 0xc00014c708)
	/app/internal/server/server.go:67 +0xd2
main.main()
	/app/cmd/server/main.go:28 +0xff
2025/03/24 09:35:23 pool.go:32: [INFO]init routine pool, size: 10000


sudo docker logs docker-nginx-1
2025/03/24 09:17:55 [notice] 10#10: using the "epoll" event method
2025/03/24 09:17:55 [notice] 10#10: nginx/1.27.4
2025/03/24 09:17:55 [notice] 10#10: built by gcc 12.2.0 (Debian 12.2.0-14) 
2025/03/24 09:17:55 [notice] 10#10: OS: Linux 5.4.0-26-generic
2025/03/24 09:17:55 [notice] 10#10: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2025/03/24 09:17:55 [notice] 10#10: start worker processes
2025/03/24 09:17:55 [notice] 10#10: start worker process 19
2025/03/24 09:17:55 [notice] 10#10: start worker process 20
2025/03/24 09:17:55 [notice] 10#10: start worker process 21
2025/03/24 09:17:55 [notice] 10#10: start worker process 22
2025/03/24 09:17:55 [notice] 10#10: start worker process 23
2025/03/24 09:17:55 [notice] 10#10: start worker process 24
2025/03/24 09:17:55 [notice] 10#10: start worker process 25
2025/03/24 09:17:55 [notice] 10#10: start worker process 26
2025/03/24 09:17:55 [notice] 10#10: start worker process 27
2025/03/24 09:17:55 [notice] 10#10: start worker process 28
2025/03/24 09:17:55 [notice] 10#10: start worker process 29
2025/03/24 09:17:55 [notice] 10#10: start worker process 30
2025/03/24 09:17:55 [notice] 10#10: start worker process 31
2025/03/24 09:17:55 [notice] 10#10: start worker process 32
2025/03/24 09:17:55 [notice] 10#10: start worker process 33
2025/03/24 09:17:55 [notice] 10#10: start worker process 34
2025/03/24 09:17:55 [notice] 10#10: start worker process 35
2025/03/24 09:17:55 [notice] 10#10: start worker process 36
2025/03/24 09:17:55 [notice] 10#10: start worker process 37
2025/03/24 09:17:55 [notice] 10#10: start worker process 38
2025/03/24 09:17:55 [notice] 10#10: start worker process 39
2025/03/24 09:17:55 [notice] 10#10: start worker process 40
2025/03/24 09:17:55 [notice] 10#10: start worker process 41
2025/03/24 09:17:55 [notice] 10#10: start worker process 42
2025/03/24 09:17:55 [notice] 10#10: start worker process 43
2025/03/24 09:17:55 [notice] 10#10: start worker process 44
2025/03/24 09:17:55 [notice] 10#10: start worker process 45
2025/03/24 09:17:55 [notice] 10#10: start worker process 46
2025/03/24 09:17:55 [notice] 10#10: start worker process 47
2025/03/24 09:17:55 [notice] 10#10: start worker process 48
2025/03/24 09:17:55 [notice] 10#10: start worker process 49
2025/03/24 09:17:55 [notice] 10#10: start worker process 50
2025/03/24 09:17:55 [notice] 10#10: start worker process 51
2025/03/24 09:17:55 [notice] 10#10: start worker process 52
2025/03/24 09:17:55 [notice] 10#10: start worker process 53
2025/03/24 09:17:55 [notice] 10#10: start worker process 54
2025/03/24 09:17:55 [notice] 10#10: start worker process 55
2025/03/24 09:17:55 [notice] 10#10: start worker process 56
2025/03/24 09:17:55 [notice] 10#10: start worker process 57
2025/03/24 09:17:55 [notice] 10#10: start worker process 58
172.18.0.1 - - [24/Mar/2025:09:18:16 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
172.18.0.1 - - [24/Mar/2025:09:18:32 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
2025/03/24 09:19:32 [error] 21#21: *5 upstream timed out (110: Connection timed out) while connecting to upstream, client: 172.18.0.1, server: _, request: "GET /install HTTP/1.1", upstream: "http://172.18.0.5:3000/install", host: "localhost"
172.18.0.1 - - [24/Mar/2025:09:19:32 +0000] "GET /install HTTP/1.1" 504 167 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"
172.18.0.1 - - [24/Mar/2025:09:20:45 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-"


sudo docker logs docker-db-1

PostgreSQL Database directory appears to contain a database; Skipping initialization

2025-03-24 09:17:54.651 UTC [1] LOG:  starting PostgreSQL 15.12 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
2025-03-24 09:17:54.651 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2025-03-24 09:17:54.652 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2025-03-24 09:17:54.663 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-03-24 09:17:54.678 UTC [29] LOG:  database system was shut down at 2025-03-24 09:11:24 UTC
2025-03-24 09:17:54.692 UTC [1] LOG:  database system is ready to accept connections
2025-03-24 09:22:54.777 UTC [27] LOG:  checkpoint starting: time
2025-03-24 09:22:54.810 UTC [27] LOG:  checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.011 s, sync=0.002 s, total=0.033 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB



sudo docker logs docker-api-1
Running migrations
2025-03-24 09:18:01.337 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:18:01.338 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
/app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d'
  """
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:20:41.109 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:20:41.110 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:23:16.746 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:23:16.746 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:25:56.349 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:25:56.350 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:28:36.116 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:28:36.116 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:31:15.666 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:31:15.666 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:33:55.651 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:33:55.652 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:36:35.389 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:36:35.389 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.
Preparing database migration...
Traceback (most recent call last):
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry
    raise error
  File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry
    return do()
           ^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect
    raise err
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect
    sock.connect(socket_address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect
    self._internal_connect(address)
  File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect
    raise _SocketError(err, strerror(err))
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/api/.venv/bin/flask", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main
    cli.main()
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/commands.py", line 662, in upgrade_db
    if lock.acquire(blocking=False):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire
    if self.do_acquire(token):
       ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire
    if self.redis.set(self.name, token, nx=True, px=timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set
    return self.execute_command("SET", *pieces, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection
    connection.connect()
  File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect
    raise TimeoutError("Timeout connecting to server")
redis.exceptions.TimeoutError: Timeout connecting to server
Running migrations
2025-03-24 09:39:15.082 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16.
2025-03-24 09:39:15.083 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads.

@TT-web-byte commented on GitHub (Mar 24, 2025): @dosu Hi,The following are the running logs of each container: ``` sudo docker logs docker-plugin_daemon-1 2025/03/24 09:17:54 pool.go:32: [INFO]init routine pool, size: 10000 2025/03/24 09:20:04 /app/internal/db/init.go:17 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:22:15 /app/internal/db/init.go:21 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:22:15 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)) goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc000401d00, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x326 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?) /app/internal/db/init.go:144 +0xde github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc0001161e0, 0xc0000f0388) /app/internal/server/server.go:67 +0xd2 main.main() /app/cmd/server/main.go:28 +0xff 2025/03/24 09:22:16 pool.go:32: [INFO]init routine pool, size: 10000 2025/03/24 09:24:26 /app/internal/db/init.go:17 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:26:38 /app/internal/db/init.go:21 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:26:38 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)) goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc000453d00, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x326 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?) /app/internal/db/init.go:144 +0xde github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc00012ab88, 0xc00014c708) /app/internal/server/server.go:67 +0xd2 main.main() /app/cmd/server/main.go:28 +0xff 2025/03/24 09:26:38 pool.go:32: [INFO]init routine pool, size: 10000 2025/03/24 09:28:49 /app/internal/db/init.go:17 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:31:00 /app/internal/db/init.go:21 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:31:00 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)) goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc0003e5d00, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x326 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?) /app/internal/db/init.go:144 +0xde github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc000116330, 0xc00047f188) /app/internal/server/server.go:67 +0xd2 main.main() /app/cmd/server/main.go:28 +0xff 2025/03/24 09:31:00 pool.go:32: [INFO]init routine pool, size: 10000 2025/03/24 09:33:11 /app/internal/db/init.go:17 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=dify_plugin`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:35:22 /app/internal/db/init.go:21 [error] failed to initialize database, got error failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) 2025/03/24 09:35:22 init.go:144: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out) panic: [PANIC]failed to init dify plugin db: failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)%!(EXTRA *pgconn.ConnectError=failed to connect to `host=db user=postgres database=postgres`: dial error (timeout: dial tcp 172.18.0.3:5432: connect: connection timed out)) goroutine 1 [running]: github.com/langgenius/dify-plugin-daemon/internal/utils/log.writeLog({0x16d5294, 0x5}, {0x170423d?, 0x7?}, 0x1, {0xc00041fd00, 0x1, 0x1}) /app/internal/utils/log/log.go:40 +0x326 github.com/langgenius/dify-plugin-daemon/internal/utils/log.Panic(...) /app/internal/utils/log/log.go:66 github.com/langgenius/dify-plugin-daemon/internal/db.Init(0x2710?) /app/internal/db/init.go:144 +0xde github.com/langgenius/dify-plugin-daemon/internal/server.(*App).Run(0xc000010330, 0xc00014c708) /app/internal/server/server.go:67 +0xd2 main.main() /app/cmd/server/main.go:28 +0xff 2025/03/24 09:35:23 pool.go:32: [INFO]init routine pool, size: 10000 sudo docker logs docker-nginx-1 2025/03/24 09:17:55 [notice] 10#10: using the "epoll" event method 2025/03/24 09:17:55 [notice] 10#10: nginx/1.27.4 2025/03/24 09:17:55 [notice] 10#10: built by gcc 12.2.0 (Debian 12.2.0-14) 2025/03/24 09:17:55 [notice] 10#10: OS: Linux 5.4.0-26-generic 2025/03/24 09:17:55 [notice] 10#10: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2025/03/24 09:17:55 [notice] 10#10: start worker processes 2025/03/24 09:17:55 [notice] 10#10: start worker process 19 2025/03/24 09:17:55 [notice] 10#10: start worker process 20 2025/03/24 09:17:55 [notice] 10#10: start worker process 21 2025/03/24 09:17:55 [notice] 10#10: start worker process 22 2025/03/24 09:17:55 [notice] 10#10: start worker process 23 2025/03/24 09:17:55 [notice] 10#10: start worker process 24 2025/03/24 09:17:55 [notice] 10#10: start worker process 25 2025/03/24 09:17:55 [notice] 10#10: start worker process 26 2025/03/24 09:17:55 [notice] 10#10: start worker process 27 2025/03/24 09:17:55 [notice] 10#10: start worker process 28 2025/03/24 09:17:55 [notice] 10#10: start worker process 29 2025/03/24 09:17:55 [notice] 10#10: start worker process 30 2025/03/24 09:17:55 [notice] 10#10: start worker process 31 2025/03/24 09:17:55 [notice] 10#10: start worker process 32 2025/03/24 09:17:55 [notice] 10#10: start worker process 33 2025/03/24 09:17:55 [notice] 10#10: start worker process 34 2025/03/24 09:17:55 [notice] 10#10: start worker process 35 2025/03/24 09:17:55 [notice] 10#10: start worker process 36 2025/03/24 09:17:55 [notice] 10#10: start worker process 37 2025/03/24 09:17:55 [notice] 10#10: start worker process 38 2025/03/24 09:17:55 [notice] 10#10: start worker process 39 2025/03/24 09:17:55 [notice] 10#10: start worker process 40 2025/03/24 09:17:55 [notice] 10#10: start worker process 41 2025/03/24 09:17:55 [notice] 10#10: start worker process 42 2025/03/24 09:17:55 [notice] 10#10: start worker process 43 2025/03/24 09:17:55 [notice] 10#10: start worker process 44 2025/03/24 09:17:55 [notice] 10#10: start worker process 45 2025/03/24 09:17:55 [notice] 10#10: start worker process 46 2025/03/24 09:17:55 [notice] 10#10: start worker process 47 2025/03/24 09:17:55 [notice] 10#10: start worker process 48 2025/03/24 09:17:55 [notice] 10#10: start worker process 49 2025/03/24 09:17:55 [notice] 10#10: start worker process 50 2025/03/24 09:17:55 [notice] 10#10: start worker process 51 2025/03/24 09:17:55 [notice] 10#10: start worker process 52 2025/03/24 09:17:55 [notice] 10#10: start worker process 53 2025/03/24 09:17:55 [notice] 10#10: start worker process 54 2025/03/24 09:17:55 [notice] 10#10: start worker process 55 2025/03/24 09:17:55 [notice] 10#10: start worker process 56 2025/03/24 09:17:55 [notice] 10#10: start worker process 57 2025/03/24 09:17:55 [notice] 10#10: start worker process 58 172.18.0.1 - - [24/Mar/2025:09:18:16 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 172.18.0.1 - - [24/Mar/2025:09:18:32 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025/03/24 09:19:32 [error] 21#21: *5 upstream timed out (110: Connection timed out) while connecting to upstream, client: 172.18.0.1, server: _, request: "GET /install HTTP/1.1", upstream: "http://172.18.0.5:3000/install", host: "localhost" 172.18.0.1 - - [24/Mar/2025:09:19:32 +0000] "GET /install HTTP/1.1" 504 167 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 172.18.0.1 - - [24/Mar/2025:09:20:45 +0000] "GET /install HTTP/1.1" 499 0 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:136.0) Gecko/20100101 Firefox/136.0" "-" sudo docker logs docker-db-1 PostgreSQL Database directory appears to contain a database; Skipping initialization 2025-03-24 09:17:54.651 UTC [1] LOG: starting PostgreSQL 15.12 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit 2025-03-24 09:17:54.651 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-03-24 09:17:54.652 UTC [1] LOG: listening on IPv6 address "::", port 5432 2025-03-24 09:17:54.663 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2025-03-24 09:17:54.678 UTC [29] LOG: database system was shut down at 2025-03-24 09:11:24 UTC 2025-03-24 09:17:54.692 UTC [1] LOG: database system is ready to accept connections 2025-03-24 09:22:54.777 UTC [27] LOG: checkpoint starting: time 2025-03-24 09:22:54.810 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.011 s, sync=0.002 s, total=0.033 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB sudo docker logs docker-api-1 Running migrations 2025-03-24 09:18:01.337 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:18:01.338 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. /app/api/.venv/lib/python3.12/site-packages/opik/evaluation/metrics/heuristics/regex_match.py:8: SyntaxWarning: invalid escape sequence '\d' """ Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:20:41.109 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:20:41.110 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:23:16.746 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:23:16.746 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:25:56.349 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:25:56.350 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:28:36.116 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:28:36.116 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:31:15.666 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:31:15.666 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:33:55.651 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:33:55.652 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:36:35.389 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:36:35.389 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. Preparing database migration... Traceback (most recent call last): File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 277, in connect sock = self.retry.call_with_retry( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 67, in call_with_retry raise error File "/app/api/.venv/lib/python3.12/site-packages/redis/retry.py", line 62, in call_with_retry return do() ^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 278, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) ^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 639, in _connect raise err File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 627, in _connect sock.connect(socket_address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 586, in connect self._internal_connect(address) File "/app/api/.venv/lib/python3.12/site-packages/gevent/_socketcommon.py", line 630, in _internal_connect raise _SocketError(err, strerror(err)) TimeoutError: [Errno 110] Connection timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/app/api/.venv/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/flask/cli.py", line 1129, in main cli.main() File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1082, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1697, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 1443, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/click/core.py", line 788, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/commands.py", line 662, in upgrade_db if lock.acquire(blocking=False): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 210, in acquire if self.do_acquire(token): ^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/lock.py", line 226, in do_acquire if self.redis.set(self.name, token, nx=True, px=timeout): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/commands/core.py", line 2333, in set return self.execute_command("SET", *pieces, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/client.py", line 545, in execute_command conn = self.connection or pool.get_connection(command_name, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 1074, in get_connection connection.connect() File "/app/api/.venv/lib/python3.12/site-packages/redis/connection.py", line 281, in connect raise TimeoutError("Timeout connecting to server") redis.exceptions.TimeoutError: Timeout connecting to server Running migrations 2025-03-24 09:39:15.082 INFO [MainThread] [utils.py:149] - Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 16. 2025-03-24 09:39:15.083 INFO [MainThread] [utils.py:162] - NumExpr defaulting to 16 threads. ```
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

The database connection timeout errors you're experiencing can be addressed by following these steps:

  1. Check Database Container: Ensure that the database container is running and accessible. You can verify this by executing docker ps to see if the database container is up and running.

  2. Increase Timeout: Add the following environment variable to the plugin_daemon service in your docker-compose.yaml file to increase the execution timeout:

    environment:
      PLUGIN_MAX_EXECUTION_TIMEOUT: 2400
    
  3. Restart Services: Stop all containers, remove existing volumes, and restart the services to ensure a clean setup:

    docker compose down
    docker compose up -d
    
  4. Database Migrations: Ensure that database migrations are applied to create the necessary tables. This can help resolve any missing table errors.

  5. Resource Allocation: Ensure that your system meets the recommended resource requirements, which are a CPU with at least 2 cores and RAM of at least 4 GiB [1].

These steps should help resolve the database connection timeout issues in your Docker environment [2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Answer --> The database connection timeout errors you're experiencing can be addressed by following these steps: 1. **Check Database Container**: Ensure that the database container is running and accessible. You can verify this by executing `docker ps` to see if the database container is up and running. 2. **Increase Timeout**: Add the following environment variable to the `plugin_daemon` service in your `docker-compose.yaml` file to increase the execution timeout: ```yaml environment: PLUGIN_MAX_EXECUTION_TIMEOUT: 2400 ``` 3. **Restart Services**: Stop all containers, remove existing volumes, and restart the services to ensure a clean setup: ```bash docker compose down docker compose up -d ``` 4. **Database Migrations**: Ensure that database migrations are applied to create the necessary tables. This can help resolve any missing table errors. 5. **Resource Allocation**: Ensure that your system meets the recommended resource requirements, which are a CPU with at least 2 cores and RAM of at least 4 GiB <sup>[[1]](https://github.com/langgenius/dify/blob/main/README.md)</sup>. These steps should help resolve the database connection timeout issues in your Docker environment <sup>[[2]](https://github.com/langgenius/dify/issues/14978)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/13540)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/54f65bda-c1b2-4937-8ac0-beb3ec735775?feedback_type=other)</sup>
Author
Owner

@TT-web-byte commented on GitHub (Mar 24, 2025):

@dosu Hi,Still no effect

@TT-web-byte commented on GitHub (Mar 24, 2025): @dosu Hi,Still no effect
Author
Owner

@dosubot[bot] commented on GitHub (Mar 24, 2025):

To further troubleshoot the database connection timeout issue, consider the following steps:

  1. Verify Network Configuration: Ensure that the Docker network is correctly configured and that the db service is accessible from other services. You can check the network settings using docker network inspect <network_name>.

  2. Check Database Logs: Review the PostgreSQL logs for any errors or warnings that might indicate why connections are timing out. This can provide insights into potential issues with the database service itself.

  3. Service Dependencies: Ensure that the plugin_daemon service is correctly set to depend on the db service in your docker-compose.yaml file. This ensures that the database is fully initialized before the plugin_daemon attempts to connect.

  4. Database Configuration: Double-check the database connection settings in your .env file or docker-compose.yaml to ensure they match the actual database configuration (e.g., host, port, username, password).

  5. Firewall and Security Groups: Verify that there are no firewall rules or security groups blocking the connection to the database port (5432).

  6. Resource Monitoring: Monitor the resource usage on your host machine to ensure there are no CPU or memory bottlenecks that could be affecting the database performance.

  7. Docker Compose Logs: Check the logs of all services using docker compose logs to identify any other potential issues that might be affecting the database connectivity.

These steps should help identify and resolve the underlying cause of the database connection timeouts.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 24, 2025): <!-- Answer --> To further troubleshoot the database connection timeout issue, consider the following steps: 1. **Verify Network Configuration**: Ensure that the Docker network is correctly configured and that the `db` service is accessible from other services. You can check the network settings using `docker network inspect <network_name>`. 2. **Check Database Logs**: Review the PostgreSQL logs for any errors or warnings that might indicate why connections are timing out. This can provide insights into potential issues with the database service itself. 3. **Service Dependencies**: Ensure that the `plugin_daemon` service is correctly set to depend on the `db` service in your `docker-compose.yaml` file. This ensures that the database is fully initialized before the `plugin_daemon` attempts to connect. 4. **Database Configuration**: Double-check the database connection settings in your `.env` file or `docker-compose.yaml` to ensure they match the actual database configuration (e.g., host, port, username, password). 5. **Firewall and Security Groups**: Verify that there are no firewall rules or security groups blocking the connection to the database port (5432). 6. **Resource Monitoring**: Monitor the resource usage on your host machine to ensure there are no CPU or memory bottlenecks that could be affecting the database performance. 7. **Docker Compose Logs**: Check the logs of all services using `docker compose logs` to identify any other potential issues that might be affecting the database connectivity. These steps should help identify and resolve the underlying cause of the database connection timeouts. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8b007de2-c309-4d52-9253-b69f480570e5?feedback_type=other)</sup>
Author
Owner

@caiyuanhangDicp commented on GitHub (Mar 26, 2025):

same issue

@caiyuanhangDicp commented on GitHub (Mar 26, 2025): same issue
Author
Owner

@xuanyaoming commented on GitHub (Mar 26, 2025):

Have the same problem. The installation tutorial doesn't work. My message says something is wrong with the DB configs.

@xuanyaoming commented on GitHub (Mar 26, 2025): Have the same problem. The installation tutorial doesn't work. My message says something is wrong with the DB configs.
Author
Owner

@xuanyaoming commented on GitHub (Mar 26, 2025):

Have the same problem. The installation tutorial doesn't work. My message says something is wrong with the DB configs.

Fixed it. The problem occurs in Win 10 system. The real reason is docker can't get the volume permission right. Here is a quick fix: (docker-compose.yaml)

services:
  db:
    image: postgres:latest
    volumes:
      - my_pgdata_volume:/var/lib/postgresql/data/pgdata
volumes:
  my_pgdata_volume:
@xuanyaoming commented on GitHub (Mar 26, 2025): > Have the same problem. The installation tutorial doesn't work. My message says something is wrong with the DB configs. Fixed it. The problem occurs in Win 10 system. The real reason is docker can't get the volume permission right. Here is a quick fix: (docker-compose.yaml) ``` services: db: image: postgres:latest volumes: - my_pgdata_volume:/var/lib/postgresql/data/pgdata volumes: my_pgdata_volume: ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12043