Skip to content

fix(scripts/single.sh): remove invalid empty-db startup command and correct debug/error logging#382

Open
Giriprasada wants to merge 1 commit into
immauss:masterfrom
Giriprasada:master
Open

fix(scripts/single.sh): remove invalid empty-db startup command and correct debug/error logging#382
Giriprasada wants to merge 1 commit into
immauss:masterfrom
Giriprasada:master

Conversation

@Giriprasada

@Giriprasada Giriprasada commented Jun 15, 2026

Copy link
Copy Markdown

Describe the bug
When CREATE_EMPTY_DATABASE=true (or NEWDB=true), scripts/single.sh fails during startup because the script contains a stray line:

--rebuild-gvmd-data=report_formats

That line is not a shell command and aborts the script.

To Reproduce

  1. Start the container with NEWDB=true or CREATE_EMPTY_DATABASE=true.
  2. Use a Docker command or docker-compose.yml with the env var set.
  3. Watch the startup logs for the failure during the empty DB creation stage.

Expected behavior
The container should finish empty DB creation and continue startup.

Environment

  • OS: [e.g. Ubuntu 20.10]
  • Memory available to OS: [ 4G ]
  • Container environment used with version: [ docker ]

Additional context

  • The bug is in scripts/single.sh in the CREATE_EMPTY_DATABASE branch.
  • There is also a debug-print bug with ${var} instead of ${!var}.
  • The postgres failure message uses $? incorrectly instead of $PGFAIL.

Resolution
Remove or fix the stray command:

--rebuild-gvmd-data=report_formats

…orrect debug/error output

- remove stray `--rebuild-gvmd-data=report_formats` line from CREATE_EMPTY_DATABASE path
- fix debug logging to print actual variable values with `${!var}`
- report actual PostgreSQL start failure code using `$PGFAIL`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant