zylon-ai/private-gpt · error · ValueError
The arq worker mode does not support arguments yet
Error message
The arq worker mode does not support arguments yet
What it means
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.
Source
Thrown at private_gpt/worker/modes.py:125
"0.0.0.0",
"--port",
os.environ.get("API_PORT", "8090"),
"--no-access-log",
"--log-level",
"critical",
]
def _with_healthcheck(command: list[str]) -> list[list[str]]:
commands = [command]
if os.environ.get("API_ENABLED", "true").lower() == "true":
commands.append(_healthcheck_command())
return commands
def run_arq(args: Sequence[str]) -> None:
if args:
raise ValueError("The arq worker mode does not support arguments yet")
arq_app = importlib.import_module(f"{_app_module()}.arq")
arq_app.run_arq_worker()
def run_celery(
args: Sequence[str],
*,
celery_settings_provider: Callable[[], CelerySettings] = lambda: settings().celery,
) -> None:
celery_args = _build_celery_args(celery_settings_provider())
typer.echo(f"Starting celery worker with args: {' '.join(celery_args)}")
command = [
sys.executable,
"-m",
"celery",
"--app",
f"{_app_module()}.celery",
"worker",View on GitHub (pinned to 4a030776a3)
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
Example fix
# before PGPT_WORKER_MODE=arq private-gpt worker arq --concurrency 4 # after PGPT_WORKER_MODE=arq private-gpt worker arq # tune concurrency in settings.yaml instead
Defensive patterns
Strategy: validation
Validate before calling
import os, sys
mode = os.environ.get("PGPT_WORKER_MODE", "")
if mode == "arq" and len(sys.argv) > 1:
raise SystemExit("arq mode takes no CLI args; configure via settings.yaml") Type guard
null
Try / catch
try:
run_arq(args)
except ValueError as e:
if "does not support arguments" in str(e):
args = () # retry without args, moving config to settings
else:
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Binary not found in PATH: {binary!r}
- Server did not become ready within {_HEALTH_TIMEOUT}s
- Server is already running with PID {existing_pid}
- Unknown command: {cmd!r}
- Unsupported scheduler.chat.mode={self.scheduler.chat.mode!r}
AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15).
Data as JSON: /api/errors/98aff16e61e29606.
Report an issue: GitHub.