{"record":{"id":"98aff16e61e29606","repo":"zylon-ai/private-gpt","slug":"the-arq-worker-mode-does-not-support-arguments-yet","errorCode":null,"errorMessage":"The arq worker mode does not support arguments yet","messagePattern":"The arq worker mode does not support arguments yet","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/worker/modes.py","lineNumber":125,"sourceCode":"        \"0.0.0.0\",\n        \"--port\",\n        os.environ.get(\"API_PORT\", \"8090\"),\n        \"--no-access-log\",\n        \"--log-level\",\n        \"critical\",\n    ]\n\n\ndef _with_healthcheck(command: list[str]) -> list[list[str]]:\n    commands = [command]\n    if os.environ.get(\"API_ENABLED\", \"true\").lower() == \"true\":\n        commands.append(_healthcheck_command())\n    return commands\n\n\ndef run_arq(args: Sequence[str]) -> None:\n    if args:\n        raise ValueError(\"The arq worker mode does not support arguments yet\")\n    arq_app = importlib.import_module(f\"{_app_module()}.arq\")\n    arq_app.run_arq_worker()\n\n\ndef run_celery(\n    args: Sequence[str],\n    *,\n    celery_settings_provider: Callable[[], CelerySettings] = lambda: settings().celery,\n) -> None:\n    celery_args = _build_celery_args(celery_settings_provider())\n    typer.echo(f\"Starting celery worker with args: {' '.join(celery_args)}\")\n    command = [\n        sys.executable,\n        \"-m\",\n        \"celery\",\n        \"--app\",\n        f\"{_app_module()}.celery\",\n        \"worker\",","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/worker/modes.py#L107-L143","documentation":"Raised by run_arq when the 'arq' worker mode is invoked with extra command-line arguments. Unlike the celery mode, which forwards args to the celery CLI, the arq launcher ignores argv entirely and refuses to run rather than silently dropping user-specified options like a queue name or concurrency flag.","triggerScenarios":"Running the worker CLI as `private-gpt worker arq --queue default` or `... arq -w 4`; a deployment script or Docker CMD that appends generic worker flags to every worker mode; a supervisor/systemd unit reused from the celery configuration and pointed at arq.","commonSituations":"Migrating a deployment from celery to arq mode and keeping the old arg flags; wrapper scripts that pass '--concurrency' style options unconditionally; container orchestrators templating the same args array into all worker containers.","solutions":["Remove all arguments from the arq worker invocation - configure it via settings/env instead (e.g. celery/arq settings blocks in settings.yaml)","If you need celery-style CLI args, switch the worker mode to celery, which builds and forwards them","Pass configuration through PGPT_* environment variables or the settings file rather than argv"],"exampleFix":"# before\nPGPT_WORKER_MODE=arq private-gpt worker arq --concurrency 4\n\n# after\nPGPT_WORKER_MODE=arq private-gpt worker arq\n# tune concurrency in settings.yaml instead","handlingStrategy":"validation","validationCode":"import os, sys\n\nmode = os.environ.get(\"PGPT_WORKER_MODE\", \"\")\nif mode == \"arq\" and len(sys.argv) > 1:\n    raise SystemExit(\"arq mode takes no CLI args; configure via settings.yaml\")","typeGuard":"null","tryCatchPattern":"try:\n    run_arq(args)\nexcept ValueError as e:\n    if \"does not support arguments\" in str(e):\n        args = ()  # retry without args, moving config to settings\n    else:\n        raise","preventionTips":["Pass worker configuration via settings.yaml / PGPT_* env vars, never argv, for arq mode","Keep one deployment template per worker mode instead of a shared args list","Document the argument restrictions per mode in the deploy README"],"tags":["worker","arq","cli","arguments"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}