Error 500 and unable to connect to DB

Hi,
Out of the blue my dockerized Nextcloud instance began to throw this error out:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Before that it was working fine so this has me somewhat baffled.

I don’t seem to know where the error.log file is located at, the nextcloud.log doesn’t truly give that much data.

Tried performing a container upgrade via docker-compose and increasing the version number and that is when I got an error related to not being able to connect to the DB, nothing has changed on the DB, it is reachable via PHP MyAdmin and the data seems to be there.

I am out of words with this one, any tips about the error log and how to see it or where to look at?

Thanks,

Unless you’ve adjusted the default log level and location, the nextcloud.log in your data directory should have the full stack trace associated with this 500/internal server error.

Tried performing a container upgrade via docker-compose and increasing the version number and that is when I got an error related to not being able to connect to the DB

The Docker log for your Nextcloud app container will tell you if the upgrade succeeded, etc. Try docker compose logs [container_name] or similar.

Thanks for getting back to me.

Set the logs to the below parameters, while I do see the file there, the file is empty, no matter what I do.

 "log_type" => "file",
  "logfile" => "/var/www/html/nextcloud.log",
  "loglevel" => 0,
  "logdateformat" => "F d, Y H:i:s",

I can see the logs streaming up, this is all they give :frowning:
[29/Apr/2024:01:50:57 +0000] "GET /index.php/204 HTTP/1.1" 500 702 "-" "Mozilla/5.0 (Windows) mirall/3.12.2stable-Win64 (build 20240320) (Nextcloud, windows-10.0.22631 ClientArchitecture: x86_64 OsArchitecture: x86_64)"

That is how I initially got the DB message, what I am now unable to see is which DB is it trying to use or why is it even failing to begin with

That’s an unusual place to put your log. It’ll break Nextcloud updates. It needs to either be in the data folder or entirely outside your installation folder (web root)

that is when I got an error related to not being able to connect to the DB,

Can you post the precise error message?

Created the log file there just to see if it populated, it did indeed but still the same issue, no log lines are being written to either my test one or the default one even though is setup to be at debug levels :frowning:

Hi,
Ended up following the steps from this thread Manually moving one user to new server
As well as for whatever reason my user account became unable to connect to the DB server and had to solve it via

ALTER USER 'nextcloud'@'%' IDENTIFIED WITH mysql_native_password;
FLUSH PRIVILEGES;

Created a new container, moved files over and rediscovered them.