Hello, my nextcloud is not working anymore. Error message:
Sep 10 22:32:32 server nextcloud-setup-start[532958]: Next Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "oc_appconfig" does not exist
Sep 10 22:32:32 server nextcloud-setup-start[532958]: LINE 1: SELECT * FROM "oc_appconfig"
Sep 10 22:32:32 server nextcloud-setup-start[532958]: ^ in /nix/store/9qnln1n8d9xgxqlhy0nbkd2v6l0x2hbm-nextcloud-2
I suspect it has something to do with the code I recently added to my config, because before it did not happen. Here the relevant snippet out of my config:
I understand that there is a desire for additional config options to be added to the NixOS service to support this. In the meantime to get Nexcloud started again, is it possible to manually grant the permission? Since the database it stateful, it shouldn’t cause problems with future rebuilds and it could always be documented in comments in the .nix configuration.
Or is this more complicated than I am understanding?
BTW: I am also interested in this topic because I run Nextcloud on a NixOS server. I currently run it using an oci-container from Docker Hub along with an oci-container for mariadb; but I was thinking I may move to the services.nextcloud option.
@genson i tried to ensure user permissions but all of that does not really work. I land on a page where it asks me if i want to use sqlite or postgres even though i specified that
This is happening to me after switching from 23.05 to 23.11 and replacing services.postgresql.ensureUsers.*.ensurePermissions with services.postgresql.ensureUsers.*.ensureDBOwnership = true. Disappears when reverting.
I have the same issue and it is due to this commit: nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgre… · Ma27/nixpkgs@4845956 · GitHub
it basically broke my nextcloud installation completely and I haven’t figured it out yet either :-/
The old config throws an error and doesn’t build, the new config complains about the missing “oc_appconfig” table. The main issue seems to be that the dbuser and dbname were different, but making them the same messes up the existing db.
Did you have any joy with getting this back up and running? I’ve got the same error. Everything else appears to still be in the database though, apart from the oc_appconfig table.