Skip to content

Worker container fails to start on Windows (Docker Desktop + Python 3.13) #2

@billlzzz10

Description

@billlzzz10

Note: this is just a tracking issue for my environment (Windows, Python 3.13)

Summary

The bl1nk-worker container fails to start in my environment (Windows + Docker Desktop + Python 3.13).
I'm opening this as a tracking issue so I can document the setup steps, dependency changes, and runtime errors I hit.


Environment

  • OS: Windows 11 (using Git Bash / MINGW64)
  • Docker Desktop: 4.52.0
  • Docker Engine: 29.0.1 (linux/amd64)
  • Docker context: desktop-linux
  • Repo: bl1nk-agent-builder
  • Branch: main
  • Host Python: 3.13.x (used for pip-compile and setup scripts)
  • Worker image Python: 3.11-slim (according to Dockerfile.worker)

What I did

  1. Cloned the repo and created a virtualenv:

    python -m venv .venv
    source .venv/Scripts/activate  # on Windows Git Bash
  2. Installed pip + pip-tools:

    python -m pip install --upgrade pip pip-tools
  3. Compiled worker requirements:

    python -m piptools compile apps/worker/requirements.in -o apps/worker/requirements.txt

    To make this work on Python 3.13 I had to let pip-tools relax a few pinned versions that were not available for my Python version, e.g.:

    • litellm: 1.13.4 → resolved to 1.13.2
    • cryptography: 41.0.8 → resolved to 41.0.7
    • psycopg[binary]: 3.1.12 → resolved to 3.3.2
    • sse-starlette: 1.8.0 → resolved to 1.8.2
    • anyio: ended up as 3.7.1 due to FastAPI's constraints

    The generated apps/worker/requirements.txt now installs correctly.

  4. Installed the Python deps:

    python -m pip install -r apps/worker/requirements.txt --no-deps
  5. Ran the setup script:

    python scripts/setup.py

    This completed successfully (DB, env, Docker files, etc.).

  6. Started the dev environment:

    ./scripts/dev.sh

What happened

Docker builds for bridge and worker succeed, and the following containers start:

  • bl1nk-redis: healthy
  • bl1nk-postgres: healthy
  • bl1nk-prometheus: running
  • bl1nk-grafana: running
  • bl1nk-bridge: running

However, bl1nk-worker ends up in Error state and the compose script reports:

dependency failed to start: container bl1nk-worker is unhealthy


Logs from bl1nk-worker

Latest logs (after several rounds of fixes) look like this:

docker logs bl1nk-worker --tail=50

Traceback (most recent call last):
  File "/usr/local/bin/uvicorn", line 8, in <module>
    sys.exit(main())
  ...
  File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 467, in load
    self.loaded_app = import_from_string(self.app)
  ...
  File "/app/apps/worker/app/main.py", line 37, in <module>
    from app.services.task_orchestrator import TaskOrchestrator
  File "/app/apps/worker/app/services/task_orchestrator.py", line 13, in <module>
    from app.database.redis import get_redis, set_task_status, get_task_status
ImportError: cannot import name 'set_task_status' from 'app.database.redis' (/app/apps/worker/app/database/redis.py)

Before this, I also hit:

  1. aioredis / TimeoutError error on Python 3.13

    File "/usr/local/lib/python3.11/site-packages/aioredis/exceptions.py", line 14, in <module>
      class TimeoutError(asyncio.TimeoutError, builtins.TimeoutError, RedisError):
    TypeError: duplicate base class TimeoutError
    

    This seems related to CPython 3.13 changes and aioredis' usage of asyncio.TimeoutError + builtins.TimeoutError.

  2. Missing symbols in local code

    • ImportError: cannot import name 'redis_health_check' from 'app.database.redis'
    • ImportError: cannot import name 'metrics_router' from 'app.routes.metrics'

    I locally added:

    # apps/worker/app/routes/metrics.py
    metrics_router = router

    and stubbed the missing redis helpers in app/database/redis.py to move past these, but I assume the project is supposed to provide these implementations.


Questions

  1. Is Python 3.13 (for local tooling / pip-compile) currently supported for this repo, or should I be using a specific Python version (e.g. 3.11) end-to-end?
  2. Are redis_health_check, set_task_status, get_task_status, and metrics_router expected to exist in the current main branch, or is there a mismatch between code and docs?
  3. Is there a recommended constraints file / lock file for apps/worker so I don't have to re-resolve all dependencies against Python 3.13?

Extra

If helpful, I can attach:

  • My generated apps/worker/requirements.txt
  • Full docker-compose.yml and Dockerfile.worker
  • Full docker logs bl1nk-worker output

---

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions