Skip to content

Sleep time for restore too low #2

@KnightWhoSaysNeeeowWumPing

Description

First and foremost thank you for this helpful little backup script.

I encounterd a small issue when trying to restore a database dump for the Tandoor Recipes database container.

I restored using the command sudo python3 backups.py -L backups/ website with backups being the sub-directory where my dumps are located and website being the section in my config.ini.
The restore failed with the following error:

Loading DB dump ... 
Stopping tandoor_db_recipes_1 ... done
Starting tandoor_db_recipes_1 ... done
psql: could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
DB dump loaded!

I figured out that in this line

time.sleep(2)

of the load_pg_dump function you wait 2 seconds.
On my Raspberry Pi 4 (Kernel 5.10.17-v7l+) this seems to be too less for the container to be up and running again so the psql command fails.

Increasing the sleep time to 10 simply resolved the issue for me.

Just wanted to let you (and others) know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions