nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.34k stars 4.06k forks source link

[Bug]: "Error occurred while checking server setup" on 29.0.6.1 #47907

Closed adrhc closed 1 month ago

adrhc commented 1 month ago

⚠️ This issue respects the following points: ⚠️

Bug description

The https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview page is showing the message:

Error occurred while checking server setup

but the command occ setupchecks -vv executes correctly; I use some rewrites, only on the http (port 80) server, on my nginx 1.25.5, to help it:

rewrite ^/nextcloud$                            https://adrhc.go.ro/nextcloud/          permanent;
rewrite ^/nextcloud(/.*)$                       https://adrhc.go.ro/nextcloud$1     last;

These are the main issues reported because indeed, I don't have /.well-known/webfinger:

⚠ OCS provider resolving: Could not check if your web server properly resolves the OCM and OCS provider URLs. To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its trusted_domains or the overwrite.cli.url.
⚠ .well-known URLs: Your web server is not properly set up to resolve .well-known URLs, failed on: /.well-known/webfinger If I set check_for_working_wellknown_setup to false, .well-known check is skipped.

In my nginx error log I see around 6 or 12 lines like below, no matter whether the well-known check is performed:

2024/09/11 21:33:31 [alert] 2819376#0: worker process 2820217 exited on signal 11 (core dumped)

The same happens for nginx 1.22.1 and 1.27.1; it doesn't happen though for nextcloud 28; on nextcloud 28 https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview worked fine; I migrated from 28 to 29 and now I stumble on this issue.

I use Nextcloud in a subdir of the NGINX webroot setup with a slight variation: I added the nginx root declaration (e.g. root /var/www) inside location ^~ /nextcloud declaration because I want to have another root for my nginx global configuration.

Steps to reproduce

  1. access https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview as administrator

Expected behavior

I expect the occ setupchecks -vv output to be displayed by https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview page instead of the "Error occurred while checking server setup" message.

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MySQL

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

Upgraded to a MAJOR version (ex. 28 to 29)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
  "system": {
    "default_phone_region": "RO",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
      "adrhc.go.ro"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "logtimezone": "Europe/Bucharest",
    "debug": false,
    "logfile": "/home/gigi/apps/log/nextcloud.log",
    "loglevel": 2,
    "dbtype": "mysql",
    "version": "29.0.6.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "theme": "",
    "maintenance": false,
    "trashbin_retention_obligation": "auto",
    "overwriteprotocol": "https",
    "overwritehost": "adrhc.go.ro",
    "overwritewebroot": "/nextcloud",
    "overwrite.cli.url": "https://adrhc.go.ro/nextcloud",
    "preview_max_memory": 409600,
    "preview_max_filesize_image": 10240,
    "enabledPreviewProviders": [
      "OC\\Preview\\Illustrator",
      "OC\\Preview\\HEIC",
      "OC\\Preview\\Movie",
      "OC\\Preview\\MSOffice2003",
      "OC\\Preview\\MSOffice2007",
      "OC\\Preview\\MSOfficeDoc",
      "OC\\Preview\\PDF",
      "OC\\Preview\\Photoshop",
      "OC\\Preview\\Postscript",
      "OC\\Preview\\StarOffice",
      "OC\\Preview\\SVG",
      "OC\\Preview\\TIFF",
      "OC\\Preview\\Font",
      "OC\\Preview\\PNG",
      "OC\\Preview\\JPEG",
      "OC\\Preview\\GIF",
      "OC\\Preview\\BMP",
      "OC\\Preview\\XBitmap",
      "OC\\Preview\\MP3",
      "OC\\Preview\\TXT",
      "OC\\Preview\\MarkDown",
      "OC\\Preview\\OpenDocument",
      "OC\\Preview\\Krita"
    ]
  }
}

List of activated Apps

Enabled: - activity: 2.21.1 - camerarawpreviews: 0.8.5 - circles: 29.0.0-dev - cloud_federation_api: 1.12.0 - comments: 1.19.0 - contactsinteraction: 1.10.0 - dashboard: 7.9.0 - dav: 1.30.1 - federatedfilesharing: 1.19.0 - federation: 1.19.0 - files: 2.1.1 - files_downloadlimit: 2.0.0 - files_external: 1.21.0 - files_pdfviewer: 2.10.0 - files_reminders: 1.2.0 - files_sharing: 1.21.0 - files_trashbin: 1.19.0 - files_versions: 1.22.0 - firstrunwizard: 2.18.0 - logreader: 2.14.0 - lookup_server_connector: 1.17.0 - nextcloud_announcements: 1.18.0 - notes: 4.10.1 - notifications: 2.17.0 - oauth2: 1.17.0 - password_policy: 1.19.0 - photos: 2.5.0 - previewgenerator: 5.6.0 - privacy: 1.13.0 - provisioning_api: 1.19.0 - recommendations: 2.1.0 - related_resources: 1.4.0 - serverinfo: 1.19.0 - settings: 1.12.0 - sharebymail: 1.19.0 - support: 1.12.0 - survey_client: 1.17.0 - systemtags: 1.19.0 - text: 3.10.1 - theming: 2.4.0 - twofactor_backupcodes: 1.18.0 - updatenotification: 1.19.1 - user_status: 1.9.0 - viewer: 2.3.0 - weather_status: 1.9.0 - workflowengine: 2.11.0 Disabled: - admin_audit: 1.19.0 - bruteforcesettings: 2.9.0 - encryption: 2.17.0 - suspicious_login: 7.0.0 (installed 6.0.0) - twofactor_totp: 11.0.0-dev - user_ldap: 1.20.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

no log is created

Additional info

my nextcloud server is working fine with no errors, not in its logs or Ubuntu's logs (files or systemd) or nginx logs (other than for https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview page)

solracsf commented 1 month ago

Cc @susnux maybe you can confirm that https://github.com/nextcloud/server/pull/47883 also fixes this issue?

adrhc commented 1 month ago

Cc @susnux maybe you can confirm that #47883 also fixes this issue?

That issue affects occ setupchecks which I "fixed" with the nginx rewrite described above; even so, when using the web page to run setupchecks the link generation happens on another code path, as I pointed out in the related bug (i.e. https://github.com/nextcloud/server/issues/47880), hence for the web page the links are generated correctly (I can see the difference in the nginx log, i.e. the web page run is not checking the same paths as occ setupchecks does).

I'll check it anyway, I just wait the next minor release.

susnux commented 1 month ago

2024/09/11 21:33:31 [alert] 2819376#0: worker process 2820217 exited on signal 11 (core dumped)

This means there is something fishy with your server software (php-fpm or nginx) this is unrelated to Nextcloud.

susnux commented 1 month ago

Error occurred while checking server setup

Can you check your browser logs (dev tools) and also the network tab?

adrhc commented 1 month ago

2024/09/11 21:33:31 [alert] 2819376#0: worker process 2820217 exited on signal 11 (core dumped)

This means there is something fishy with your server software (php-fpm or nginx) this is unrelated to Nextcloud.

I thought the same but I switched from nginx 1.22.1 to 1.25.5 and is the same; on nextcloud 28, and till 29, I never had this issue while the rest was the same (nginx and php 8.2).

PS: I'm a developer so you can ask me to do whatever tech stuff

setupchecks setupchecks-nw

PS: nothing is visible with occ log:watch or in the nextcloud.log (which I guess is the same thing)

adrhc commented 1 month ago

overview

when I access https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview ...

adrhc commented 1 month ago

When I open any of these links in another browser tab:

I get something (which I guess is correct): details-get

adrhc commented 1 month ago

https://adrhc.go.ro/nextcloud/ocs/v2.php/apps/user_status/api/v1/heartbeat?format=json works and is very similar (as URL) to https://adrhc.go.ro/nextcloud/ocs/v2.php/cloud/groups/details which doesn't (I'm not sure if it should) - this means that most probably my environment is fine (i.e. nginx, php, fpm).

Besides, the problems are only with https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview, any other page has no issue (in browser's Developer tools) hence it's hard to believe there's something wrong with my setup.

https://adrhc.go.ro/nextcloud/index.php/settings/admin/overview takes about 4-5s to execute and based on those 6 or 12 nginx crashes behind scene I guess it tries about 6 paths and it fails; if I remember correcly, URLGenerator -> getAbsoluteURL is generating about that amount (i.e. 6) of paths (see also https://github.com/nextcloud/server/issues/47880) -> but does this really matters? even with check_for_working_wellknown_setup set to false is the same.

adrhc commented 1 month ago

I'm not sure those nginx crashes matter; when I run occ setupchecks they occur for it too but I still get the setupchecks report (where except the .well-known check everything else is fine).

mritzmann commented 1 month ago

fyi: There are other reports in the forum that look similar. Apparently all affected users use Nextcloud in a subfolder.

https://help.nextcloud.com/t/many-could-not-check-on-security-and-setup-warnings/201840

adrhc commented 1 month ago

Cc @susnux maybe you can confirm that #47883 also fixes this issue?

That issue affects occ setupchecks which I "fixed" with the nginx rewrite described above; even so, when using the web page to run setupchecks the link generation happens on another code path, as I pointed out in the related bug (i.e. #47880), hence for the web page the links are generated correctly (I can see the difference in the nginx log, i.e. the web page run is not checking the same paths as occ setupchecks does).

I'll check it anyway, I just wait the next minor release.

@susnux with 29.0.7 my nginx has less crashes, only 2, but I get these:

  ⚠ JavaScript source map support: Your webserver is not set up to serve `.js.map` files. Without these files, JavaScript Source Maps won't function properly, making it more challenging to troubleshoot and debug any issues that may arise.
  ⚠ JavaScript modules support: Could not check for JavaScript support via any of your `trusted_domains` nor `overwrite.cli.url`. This may be the result of a server-side DNS mismatch or outbound firewall rule. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.

To allow this check to run you have to make sure that your webserver can connect to itself. Therefor it must be able to resolve and connect to at least one its trusted_domains or the overwrite.cli.url.

Somehow the nginx rewrites I used to "help" occ setupchecks -vv to pass the above 2 checks are no longer helpful:

rewrite ^/nextcloud$                            https://adrhc.go.ro/nextcloud/          permanent;
rewrite ^/nextcloud(/.*)$                       https://adrhc.go.ro/nextcloud$1     last;
susnux commented 1 month ago

This should be fixed with Nextcloud 29.0.8 the fix was merged today, so you would have to wait for the next maintenance release, sorry!

But in your case: If apps like viewer, text or forms work. Then you can ignore those errors. They will vanish with that next release.

doc75 commented 1 month ago

@susnux is it possible to link the PR with the fix ? [Edit: I guess this is #47883 mentioned above. Sorry I missed it at first]

I have the same issue, but with a nextcloud not in a subfolder of the domain and I would like to see if the fix will also solve my issue.

[Edit: issue was coming for a too big nextcloud.log file on my test environment - I should check my logrotate config]