Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Persistent volume for Blockscout's Postgres can crash on startup on Macs #87

Open
steezeburger opened this issue Aug 21, 2023 · 3 comments
Assignees

Comments

@steezeburger
Copy link
Member

steezeburger commented Aug 21, 2023

I will sometimes get an error when Blockscout's Postgres is starting up related to data already existing. This blocks Blockscout from starting.

| The database cluster will be initialized with locale "en_US.utf8".                                                                                                                             │
│ The default database encoding has accordingly been set to "UTF8".                                                                                                                              │
│ The default text search configuration will be set to "english".                                                                                                                                │
│                                                                                                                                                                                                │
│ Data page checksums are disabled.                                                                                                                                                              │
│                                                                                                                                                                                                │
│ initdb: error: directory "/var/lib/postgresql/data" exists but is not empty                                                                                                                    │
│ If you want to create a new database system, either remove or empty                                                                                                                            │
│ the directory "/var/lib/postgresql/data" or run initdb                                                                                                                                         │
│ with an argument other than "/var/lib/postgresql/data".
@steezeburger steezeburger added this to the MS-5 milestone Aug 21, 2023
@steezeburger
Copy link
Member Author

@steezeburger steezeburger self-assigned this Aug 21, 2023
@steezeburger
Copy link
Member Author

steezeburger commented Aug 21, 2023

I think it's not finding PG_VERSION for some reason
https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh#L229C19-L229C29

@steezeburger
Copy link
Member Author

steezeburger commented Aug 21, 2023

Found the issue!

MacOS runs a periodic cleaner on the temp directory that deletes files that haven't been used in 3 days. It only deletes files but not directories, so postgres was seeing that the data directory existed but the check for PG_VERSION failed.

@steezeburger steezeburger changed the title Persistent volumes for Blockscout Postgres may cause crash on startup Persistent volumes for Blockscout Postgres can cause crash on startup on Macs Aug 22, 2023
@steezeburger steezeburger changed the title Persistent volumes for Blockscout Postgres can cause crash on startup on Macs Persistent volume for Blockscout's Postgres can crash on startup on Macs Aug 22, 2023
@steezeburger steezeburger removed this from the MS-5 milestone Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant