Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error handling when unable to connect to database #37424

Closed
6 of 9 tasks
MasterCrake opened this issue Mar 27, 2023 · 2 comments · Fixed by #37458
Closed
6 of 9 tasks

[Bug]: Error handling when unable to connect to database #37424

MasterCrake opened this issue Mar 27, 2023 · 2 comments · Fixed by #37458
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug
Milestone

Comments

@MasterCrake
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

We had a network failure and our nextcloud instance lost connection to the mysql database server we are running. The error handling in this situation was inadequate to troubleshoot the issue. No logs were written to nextcloud.logs (loglevel debug) and no hint about the issue was given to the user. I would like this error to produce some kind of log to nextcloud.logs to enable efficient troubleshooting. My way of solving it was to simply remove the catches in index.php to expose the raw exception to the end user, no other method I tried managed to produce any indication at all about what was wrong.

Steps to reproduce

  1. Setup docker container running mysql:8.0.32.
  2. Setup docker container running nextcloud:25.0.3-apache.
  3. Disable network connection between containers.
  4. Access nextcloud start page.

Expected behavior

Exceptions thrown in index.php error handling should write to nextcloud.log.

Installation method

Community Docker image

Nextcloud Server version

25

Operating system

RHEL/CentOS

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

Unable to run command in docker container.

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

nextcloud.log only contains logs from before the network failure.

@MasterCrake MasterCrake added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Mar 27, 2023
@Fenn-CS
Copy link
Contributor

Fenn-CS commented Mar 28, 2023

I would like to look into this!

Steps :

  1. Reproduce
  2. Correctly log error (if reproduced)

@MasterCrake
Copy link
Author

Great, initially we had both the nextcloud and the mysql instances working, then there was a network failure between them. There was some exception thrown that landed in the try/catch block in index.php. My usual solution would be to write something helpful to the log in the catch block. I have however not worked very much with php so I did not dare trying to fix it myself.

My guess is that the easiest way of reproducing it is by starting the two instances in docker and after installation shut down the mysql instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants