Okay, so I'm not sure if this was a "me" problem or a NixOps problem, but I am slightly leaning towards the latter, hence this issue.
1) I created a key for a Nextcloud database password.
2) I installed Nextcloud using the deployment key (this has no issues) [yes, the nextcloud user is in the keys group].
3) I try using Nextcloud—and I get an error saying that "the file provided by NixOS does not exist" or whatever.
I decided to do some debugging.
1) The key file exists and there are no permission issues. It is readable from the nextcloud user account, from which PHP is running on (which I also found through debugging). If I do sudo -u nextcloud cat /run/keys/nextcloud-db-password, I will 100% of the time have no issues.
2) … This is the strange one. chmod 777 does nothing. Changing the permissions to any number has no effect on this strange behaviour. When… trying to curl localhost and get Nextcloud, I will get this error exactly 1/3 of the time. Eg. curl localhost will throw an error about the DB password file not existing, then it will throw the same error again, then it will load just fine. Then the cycle repeats: error, error, success.
It's definitely not some really broken permission error as well. To temporarily work around this problem, I put my key in environment.etc or whatever, and Nextcloud works just fine with restricted permissions and whatnot, leading me to believe this is a NixOps issue (with deployment.keys).
Not sure if this is a duplicate somehow; I'm more than happy to provide an MCVE… just wanted to get this issue out so I don't forget to make it!
Okay, so I'm not sure if this was a "me" problem or a NixOps problem, but I am slightly leaning towards the latter, hence this issue.
1) I created a key for a Nextcloud database password. 2) I installed Nextcloud using the deployment key (this has no issues) [yes, the
nextcloud
user is in thekeys
group]. 3) I try using Nextcloud—and I get an error saying that "the file provided by NixOS does not exist" or whatever.I decided to do some debugging.
1) The key file exists and there are no permission issues. It is readable from the
nextcloud
user account, from which PHP is running on (which I also found through debugging). If I dosudo -u nextcloud cat /run/keys/nextcloud-db-password
, I will 100% of the time have no issues. 2) … This is the strange one.chmod 777
does nothing. Changing the permissions to any number has no effect on this strange behaviour. When… trying tocurl localhost
and get Nextcloud, I will get this error exactly 1/3 of the time. Eg.curl localhost
will throw an error about the DB password file not existing, then it will throw the same error again, then it will load just fine. Then the cycle repeats: error, error, success.It's definitely not some really broken permission error as well. To temporarily work around this problem, I put my key in
environment.etc
or whatever, and Nextcloud works just fine with restricted permissions and whatnot, leading me to believe this is a NixOps issue (withdeployment.keys
).Not sure if this is a duplicate somehow; I'm more than happy to provide an MCVE… just wanted to get this issue out so I don't forget to make it!