{"record":{"id":"60b7f9bcfb1b64c7","repo":"unionlabs/union","slug":"no-database-set-in-config-queue-commands-require","errorCode":null,"errorMessage":"no database set in config, queue commands require the `pg-queue` database backend","messagePattern":"no database set in config, queue commands require the `pg-queue` database backend","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"voyager/src/main.rs","lineNumber":262,"sourceCode":"                    .map(|module_config| get_plugin_info(&module_config).map(|p| p.name))\n                    .collect::<Result<Vec<_>, _>>()?;\n\n                print_json(&list);\n            }\n        },\n        Command::Queue(cli_msg) => {\n            let db = || {\n                Ok(match get_voyager_config()?.voyager.queue {\n                    QueueConfig::PgQueue(cfg) => {\n                        pg_queue::PgQueue::<VoyagerMessage>::new(PgQueueConfig {\n                            // only one connection is needed for the queue commands\n                            min_connections: 1,\n                            max_connections: 1,\n                            ..cfg\n                        })\n                    }\n                    QueueConfig::InMemory => {\n                        return Err(anyhow!(\n                            \"no database set in config, queue commands \\\n                            require the `pg-queue` database backend\"\n                        ));\n                    }\n                })\n            };\n\n            match cli_msg {\n                QueueCmd::Enqueue { op, rest_url } => {\n                    let rest_url = get_rest_url(rest_url);\n\n                    send_enqueue(&rest_url, op).await?;\n                }\n                QueueCmd::Stats => {\n                    let stats = db()?.await?.stats().await?;\n\n                    print_json(&stats);\n                }","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/voyager/src/main.rs#L244-L280","documentation":"All `voyager queue ...` subcommands (enqueue, requeue, etc.) construct a persistent work queue from `VoyagerConfig.queue`, which is a tagged enum (`QueueConfig`: `in-memory` or `pg-queue`). Only `pg-queue` can be opened as a standalone durable queue from the CLI, because an in-memory queue lives only inside a running relayer process and cannot serve out-of-process queue commands. When the config selects `in-memory`, the closure returns this error before any queue operation starts.","triggerScenarios":"Running `voyager queue enqueue <op>` or any other `queue` subcommand while the config's `queue` field is the default `in-memory` variant (or explicitly set to `{ type = \"in-memory\" }`).","commonSituations":"Using a minimal/generated default config that does not configure Postgres; running queue admin commands against a config intended only for testing the relayer in-memory; upgrading voyager after the queue config format changed to the tagged enum and the TOML no longer selects `pg-queue`.","solutions":["Edit the Voyager config TOML and set the queue to the Postgres backend with a reachable database URL: `queue = { type = \"pg-queue\", database-url = \"postgres://user:pass@host:5432/voyager\" }`.","Confirm Postgres is reachable and the database exists (`psql <url> -c 'select 1'`); apply migrations if this is a fresh database.","If you did not intend to use queue commands, drop them from your command/script — relaying itself works with either backend.","If you intended a durable setup, re-generate or diff your config against a known-good production config so other required fields stay valid."],"exampleFix":"# before (config.toml)\nqueue = { type = \"in-memory\" }\n# $ voyager queue enqueue ...\n# error: no database set in config, queue commands require the `pg-queue` database backend\n\n# after (config.toml)\nqueue = { type = \"pg-queue\", database-url = \"postgres://postgres:postgres@localhost:5432/voyager\" }","handlingStrategy":"validation","validationCode":"# fail fast before running queue commands\ntomlq -r '.queue.type' \"$VOYAGER_CONFIG\" | grep -qx 'pg-queue' || {\n  echo \"queue commands require queue.type = pg-queue in $VOYAGER_CONFIG\" >&2; exit 2;\n}","typeGuard":"fn has_pg_queue(cfg: &VoyagerConfig) -> bool {\n    matches!(cfg.queue, QueueConfig::PgQueue(_))\n}","tryCatchPattern":null,"preventionTips":["Generate production configs from a template that already sets `queue.type = \"pg-queue\"` with a database URL.","Keep Postgres reachable and migrated before invoking queue subcommands.","Separate test configs (in-memory) from ops configs in CI so queue commands never run against in-memory setups.","Assert the queue backend in deployment smoke tests."],"tags":["rust","cli","configuration","postgres","queue","voyager"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}