ERROR: syntax error at or near "q" #472

Closed
opened 2026-04-05 16:16:32 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @LucaDiba on 9/2/2025

Hi, I'm trying to deploy Postgresus with the docker compose setup, but I'm getting a few errors when I start the container:

# ...
2025-09-02T00:47:18.513311371Z PostgreSQL is ready!
2025-09-02T00:47:18.513346651Z Setting up database and user...
2025-09-02T00:47:18.537730707Z ALTER ROLE
2025-09-02T00:47:18.538046315Z 2025-09-02 00:47:18.537 UTC [41] ERROR:  database "postgresus" already exists
2025-09-02T00:47:18.538059115Z 2025-09-02 00:47:18.537 UTC [41] STATEMENT:  CREATE DATABASE "postgresus" OWNER postgres;
2025-09-02T00:47:18.538219759Z ERROR:  database "postgresus" already exists
2025-09-02T00:47:18.538548686Z 2025-09-02 00:47:18.538 UTC [41] ERROR:  syntax error at or near "q" at character 1
2025-09-02T00:47:18.538560567Z 2025-09-02 00:47:18.538 UTC [41] STATEMENT:  q
2025-09-02T00:47:18.538647049Z ERROR:  syntax error at or near "q"
2025-09-02T00:47:18.538673169Z LINE 1: q
2025-09-02T00:47:18.538675970Z         ^
2025-09-02T00:47:18.540471132Z Starting Postgresus application...
2025-09-02T00:47:18.551041382Z time="2025/09/02 00:47:18" msg="Text structured logger initialized"
2025-09-02T00:47:18.563126747Z time="2025/09/02 00:47:18" msg="Running database migrations..."
2025-09-02T00:47:18.563261990Z time="2025/09/02 00:47:18" msg="Trying to load .env" path=/app/.env
2025-09-02T00:47:18.563412834Z time="2025/09/02 00:47:18" msg="Successfully loaded .env" path=/app/.env
2025-09-02T00:47:18.563434154Z time="2025/09/02 00:47:18" msg="ENV_MODE loaded" mode=production
2025-09-02T00:47:18.563447795Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=13 path=/usr/lib/postgresql/13/bin
2025-09-02T00:47:18.564194052Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=13 path=/usr/lib/postgresql/13/bin/pg_dump
2025-09-02T00:47:18.564204532Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=13
2025-09-02T00:47:18.564207692Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=13 path=/usr/lib/postgresql/13/bin/psql
2025-09-02T00:47:18.564210613Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=13
2025-09-02T00:47:18.564213213Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=13 path=/usr/lib/postgresql/13/bin
2025-09-02T00:47:18.564216013Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=14 path=/usr/lib/postgresql/14/bin
2025-09-02T00:47:18.564218733Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=14 path=/usr/lib/postgresql/14/bin/pg_dump
2025-09-02T00:47:18.564221733Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=14
2025-09-02T00:47:18.564224373Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=14 path=/usr/lib/postgresql/14/bin/psql
2025-09-02T00:47:18.564227253Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=14
2025-09-02T00:47:18.564229853Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=14 path=/usr/lib/postgresql/14/bin
2025-09-02T00:47:18.564232653Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=15 path=/usr/lib/postgresql/15/bin
2025-09-02T00:47:18.564235373Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=15 path=/usr/lib/postgresql/15/bin/pg_dump
2025-09-02T00:47:18.564238173Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=15
2025-09-02T00:47:18.564255454Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=15 path=/usr/lib/postgresql/15/bin/psql
2025-09-02T00:47:18.564259854Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=15
2025-09-02T00:47:18.564282214Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=15 path=/usr/lib/postgresql/15/bin
2025-09-02T00:47:18.564285494Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=16 path=/usr/lib/postgresql/16/bin
2025-09-02T00:47:18.564289014Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=16 path=/usr/lib/postgresql/16/bin/pg_dump
2025-09-02T00:47:18.564291934Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=16
2025-09-02T00:47:18.564294494Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=16 path=/usr/lib/postgresql/16/bin/psql
2025-09-02T00:47:18.564297215Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=16
2025-09-02T00:47:18.564299855Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=16 path=/usr/lib/postgresql/16/bin
2025-09-02T00:47:18.564302695Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=17 path=/usr/lib/postgresql/17/bin
2025-09-02T00:47:18.564305375Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=17 path=/usr/lib/postgresql/17/bin/pg_dump
2025-09-02T00:47:18.564308095Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=17
2025-09-02T00:47:18.564310695Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=17 path=/usr/lib/postgresql/17/bin/psql
2025-09-02T00:47:18.564313375Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=17
2025-09-02T00:47:18.564315935Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=17 path=/usr/lib/postgresql/17/bin
2025-09-02T00:47:18.564318575Z time="2025/09/02 00:47:18" msg="All PostgreSQL version-specific client tools verification completed successfully!"
2025-09-02T00:47:18.564321375Z time="2025/09/02 00:47:18" msg="Environment variables loaded successfully!"
2025-09-02T00:47:18.568360311Z time="2025/09/02 00:47:18" msg="Failed to run migrations" error="fork/exec /usr/local/bin/goose: exec format error" output=""

I'm not sure why it complains about the existing database for fresh installations. But also there seems to be a syntax error in the startup script?

*Originally created by @LucaDiba on 9/2/2025* Hi, I'm trying to deploy Postgresus with the docker compose setup, but I'm getting a few errors when I start the container: ```sh # ... 2025-09-02T00:47:18.513311371Z PostgreSQL is ready! 2025-09-02T00:47:18.513346651Z Setting up database and user... 2025-09-02T00:47:18.537730707Z ALTER ROLE 2025-09-02T00:47:18.538046315Z 2025-09-02 00:47:18.537 UTC [41] ERROR: database "postgresus" already exists 2025-09-02T00:47:18.538059115Z 2025-09-02 00:47:18.537 UTC [41] STATEMENT: CREATE DATABASE "postgresus" OWNER postgres; 2025-09-02T00:47:18.538219759Z ERROR: database "postgresus" already exists 2025-09-02T00:47:18.538548686Z 2025-09-02 00:47:18.538 UTC [41] ERROR: syntax error at or near "q" at character 1 2025-09-02T00:47:18.538560567Z 2025-09-02 00:47:18.538 UTC [41] STATEMENT: q 2025-09-02T00:47:18.538647049Z ERROR: syntax error at or near "q" 2025-09-02T00:47:18.538673169Z LINE 1: q 2025-09-02T00:47:18.538675970Z ^ 2025-09-02T00:47:18.540471132Z Starting Postgresus application... 2025-09-02T00:47:18.551041382Z time="2025/09/02 00:47:18" msg="Text structured logger initialized" 2025-09-02T00:47:18.563126747Z time="2025/09/02 00:47:18" msg="Running database migrations..." 2025-09-02T00:47:18.563261990Z time="2025/09/02 00:47:18" msg="Trying to load .env" path=/app/.env 2025-09-02T00:47:18.563412834Z time="2025/09/02 00:47:18" msg="Successfully loaded .env" path=/app/.env 2025-09-02T00:47:18.563434154Z time="2025/09/02 00:47:18" msg="ENV_MODE loaded" mode=production 2025-09-02T00:47:18.563447795Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=13 path=/usr/lib/postgresql/13/bin 2025-09-02T00:47:18.564194052Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=13 path=/usr/lib/postgresql/13/bin/pg_dump 2025-09-02T00:47:18.564204532Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=13 2025-09-02T00:47:18.564207692Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=13 path=/usr/lib/postgresql/13/bin/psql 2025-09-02T00:47:18.564210613Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=13 2025-09-02T00:47:18.564213213Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=13 path=/usr/lib/postgresql/13/bin 2025-09-02T00:47:18.564216013Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=14 path=/usr/lib/postgresql/14/bin 2025-09-02T00:47:18.564218733Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=14 path=/usr/lib/postgresql/14/bin/pg_dump 2025-09-02T00:47:18.564221733Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=14 2025-09-02T00:47:18.564224373Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=14 path=/usr/lib/postgresql/14/bin/psql 2025-09-02T00:47:18.564227253Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=14 2025-09-02T00:47:18.564229853Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=14 path=/usr/lib/postgresql/14/bin 2025-09-02T00:47:18.564232653Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=15 path=/usr/lib/postgresql/15/bin 2025-09-02T00:47:18.564235373Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=15 path=/usr/lib/postgresql/15/bin/pg_dump 2025-09-02T00:47:18.564238173Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=15 2025-09-02T00:47:18.564255454Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=15 path=/usr/lib/postgresql/15/bin/psql 2025-09-02T00:47:18.564259854Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=15 2025-09-02T00:47:18.564282214Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=15 path=/usr/lib/postgresql/15/bin 2025-09-02T00:47:18.564285494Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=16 path=/usr/lib/postgresql/16/bin 2025-09-02T00:47:18.564289014Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=16 path=/usr/lib/postgresql/16/bin/pg_dump 2025-09-02T00:47:18.564291934Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=16 2025-09-02T00:47:18.564294494Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=16 path=/usr/lib/postgresql/16/bin/psql 2025-09-02T00:47:18.564297215Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=16 2025-09-02T00:47:18.564299855Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=16 path=/usr/lib/postgresql/16/bin 2025-09-02T00:47:18.564302695Z time="2025/09/02 00:47:18" msg="Verifying PostgreSQL installation" version=17 path=/usr/lib/postgresql/17/bin 2025-09-02T00:47:18.564305375Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=pg_dump version=17 path=/usr/lib/postgresql/17/bin/pg_dump 2025-09-02T00:47:18.564308095Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=pg_dump version=17 2025-09-02T00:47:18.564310695Z time="2025/09/02 00:47:18" msg="Checking for PostgreSQL command" command=psql version=17 path=/usr/lib/postgresql/17/bin/psql 2025-09-02T00:47:18.564313375Z time="2025/09/02 00:47:18" msg="PostgreSQL command found" command=psql version=17 2025-09-02T00:47:18.564315935Z time="2025/09/02 00:47:18" msg="Installation of PostgreSQL verified" version=17 path=/usr/lib/postgresql/17/bin 2025-09-02T00:47:18.564318575Z time="2025/09/02 00:47:18" msg="All PostgreSQL version-specific client tools verification completed successfully!" 2025-09-02T00:47:18.564321375Z time="2025/09/02 00:47:18" msg="Environment variables loaded successfully!" 2025-09-02T00:47:18.568360311Z time="2025/09/02 00:47:18" msg="Failed to run migrations" error="fork/exec /usr/local/bin/goose: exec format error" output="" ``` I'm not sure why it complains about the existing database for fresh installations. But also there seems to be a syntax error in the startup script?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/databasus#472