lukemcqueen/hermes-cortex/arq-worker-startup-pitfalls

Claude Code and agent skill by lukemcqueen/hermes-cortex

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when an arq worker crash-loops or runs no jobs.

Install

npx vskill@latest install lukemcqueen/hermes-cortex/arq-worker-startup-pitfalls

SKILL.md

The same SKILL.md was published earlier as lukemcqueen/hermes-cortex/arq-worker-startup-pitfalls.

arq Worker Startup Pitfalls

Three independent failures that all look like "the worker container won't stay up". Check them in order.

1. TypeError: 'type' object is not iterable at map(func, functions)

Cause: arq 0.28's Worker.__init__ takes functions as its FIRST positional argument. Calling Worker(WorkerSettings) passes the settings class itself as the functions sequence:

python
# ❌ BAD — passes the class, not its functions
asyncio.run(Worker(WorkerSettings).run())
# TypeError: 'type' object is not iterable

Fix: use the exported run_worker() helper, which expands the settings class via get_kwargs() and blocks running the loop (Worker.run() is synchronous):

python
from arq import run_worker
class WorkerSettings:
functions = JOB_FUNCTIONS # list of async funcs
redis_settings = _arq_settings() # arq.connections.RedisSettings
...
run_worker(WorkerSettings) # blocks, runs the worker loop

Note: create_worker exists in arq.worker but is NOT exported from arq/__init__.py in 0.28 — from arq import create_worker raises ImportError. Use run_worker.

2. Worker runs uvicorn (or nothing) instead of its job script

Cause A — entrypoint ignores CMD: the image ENTRYPOINT ends with exec uvicorn ... unconditionally, so compose command: python3 arq_worker.py is discarded. Fix: exec the supplied command when present, fall back to the API server:

bash
if [ "$#" -gt 0 ]; then
exec "$@"
fi
exec .venv/bin/uvicorn app.main:app ...

Cause B — job script missing from image: the Dockerfile never COPYs the worker entrypoint (arq_worker.py). Add it:

dockerfile
COPY arq_worker.py ./

3. Worker connects to the wrong Redis port

Cause: .env carries the HOST-side published port (e.g. REDIS_PORT=13212) and it leaks into containers via env_file: .env. Inside the compose network Redis listens on 6379, so the worker logs redis=redis:13212 and can't connect.

Fix: pin the internal port explicitly in the compose service environment (overrides env_file):

yaml
environment:
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD:-your-redis-password}
REDIS_PORT: 6379

Verification

bash
docker ps --format '{{.Names}}\t{{.Status}}' | grep worker # Up, not Restarting
docker logs worker | tail -10
# expect: Starting worker for N functions: ...
# redis_version=... clients_connected=1

Pitfalls

  • Images with baked /app need a rebuild (./run build worker) for

arq_worker.py / entrypoint changes; docker cp is only a temporary dev-loop test.

  • Check the pinned arq version in uv.lock before using API helpers —

0.28 exports run_worker, not create_worker.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/lukemcqueen/hermes-cortex/arq-worker-startup-pitfalls/badge)](https://verified-skill.com/skills/lukemcqueen/hermes-cortex/arq-worker-startup-pitfalls)

Something wrong with this skill or its page? Tell us.