Here is the error from commandline snap refresh nextcloud
2022-11-30 21:49:00,260 - database - INFO - postgres executing: /snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database
initdb: invalid locale settings; check LANG and LC_* environment variables
2022-11-30 21:49:01,066 - database - ERROR - postgres error: The files belonging to this database system will be owned by user “nextcloud”.
This user must also own the server process.
Traceback (most recent call last):
File “/snap/nextcloud/631/meta/hooks/post-refresh”, line 7, in
Installer().post_refresh()
File “/snap/nextcloud/631/hooks/installer.py”, line 97, in post_refresh
self.db.init()
File “/snap/nextcloud/631/hooks/postgres.py”, line 33, in init
self.run(‘{0}/bin/initdb.sh {1}’.format(self.app_dir, self.database_dir))
File “/snap/nextcloud/631/hooks/postgres.py”, line 55, in run
raise e
File “/snap/nextcloud/631/hooks/postgres.py”, line 51, in run
output = check_output(cmd, shell=True).decode()
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘/snap/nextcloud/current/bin/initdb.sh /var/snap/nextcloud/current/database’ returned non-zero exit status 1.