Postgres container will not initiate the Nextcloud database because of Timezone error
psql: error: ... FATAL: invalid value for parameter "TimeZone": "Europe/Kyiv"
A workaround is to keep the nextcloud-aio-mastercontainer and remove all the other AiO containers and their PVs. And start them again with some other TZ.
The problem and the workaround are for Nextcloud AiO setup inside docker container environment. However can be adopted for any other Nextcloud implementation
Most *nix OSes still have an outdated timezone lists. So the AiO setup wizard statement " You can get valid values by looking at the ‘TZ database name’ column of this list: click here." is a kind of misleading. IANA had updated the TZ data for Ukrainian cities years ago, but it takes time to propagate. Keep reporting, keep pushing though! “Boritesia - poborete” (c)
- Login to
- Stop containers
- Keep the nextcloud-aio-mastercontainer and remove all the other AiO containers and their PVs
- If your server is to be multinational, use UTC +0 and save the hassle . Or else, change timezone to some capital with the same TZ (and same DST!!!) as yours. For Ukraine/Kyiv it can be Helsinki, Tallinn, Riga, Vilnius, Chisinau, Bucharest, Sofia*, Athens.
- Refresh the AiO page!
- AiO will find out that the containers are missing and will offer something like: “ Container updates are available … Start and update containers”, which in these very case means to initiate new containers and PVs for them
- Check the database container logs - they should look much better now
- Be patient - it may take a long time for main Nextcloud container to initiate. (follow the logs )
be very careful and think twice if you are adopting thise workaround for a running Nextcloud with your data inside
Database TZ error log:
The files belonging to this database system will be owned by user "postgres". This user must also own the server process. 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. fixing permissions on existing directory /var/lib/postgresql/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... UTC creating configuration files ... ok running bootstrap script ... ok sh: locale: not found 2022-08-12 07:30:27.247 UTC  WARNING: no usable system locales were found performing post-bootstrap initialization ... ok initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. syncing data to disk ... ok Success. You can now start the database server using: pg_ctl -D /var/lib/postgresql/data -l logfile start waiting for server to start....2022-08-12 07:30:33.560 UTC  LOG: starting PostgreSQL 14.4 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 11.2.1_git20220219) 11.2.1 20220219, 64-bit 2022-08-12 07:30:33.576 UTC  LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2022-08-12 07:30:33.605 UTC  LOG: database system was shut down at 2022-08-12 07:30:31 UTC 2022-08-12 07:30:33.625 UTC  LOG: database system is ready to accept connections done server started 2022-08-12 07:30:33.834 UTC  FATAL: invalid value for parameter "TimeZone": "Europe/Kyiv" psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: invalid value for parameter "TimeZone": "Europe/Kyiv" 2022-08-12 07:30:33.871 UTC  FATAL: database "nextcloud_database" does not exist pg_dump: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "nextcloud_database" does not exist waiting for server to shut down....2022-08-12 07:30:33.877 UTC  LOG: received fast shutdown request 2022-08-12 07:30:33.886 UTC  LOG: aborting any active transactions 2022-08-12 07:30:33.889 UTC  LOG: background worker "logical replication launcher" (PID 43) exited with exit code 1 2022-08-12 07:30:33.890 UTC  LOG: shutting down 2022-08-12 07:30:33.959 UTC  LOG: database system is shut down done server stopped