Occ setupchecks fails because it tries access over HTTP

I use nextcloud v29.0.6 on Ubuntu 23.10 with nginx.

I run occ setupchecks -vv and I get these errors (though the cloud itself works fine):

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.

HTTP headers: Could not check that your web server serves security headers correctly, unable to query /nextcloud/index.php/heartbeat

In my nginx logs I can see it tries to access over HTTP:

  • HEAD /nextcloud/apps/settings/js/map-test.js.map HTTP/1.1
  • HEAD /nextcloud/apps/settings/js/esm-test.mjs HTTP/1.1
  • GET /nextcloud/index.php/heartbeat HTTP/1.1

Using HTTPS solves the access issue (e.g. https://adrhc.go.ro/nextcloud/index.php/heartbeat works fine) but how can I tell to occ setupchecks to use HTTPS?

I have these in config.php:

  'overwriteprotocol' => 'https',
  'overwritehost' => 'adrhc.go.ro',
  'overwritewebroot' => '/nextcloud',
  'overwrite.cli.url' => 'https://adrhc.go.ro/nextcloud',
  'trusted_domains' => 
  array (
    0 => 'adrhc.go.ro',
  ),

In Administration / Overview the issue above determines an:

Error occurred while checking server setup

red message, because, I guess, internally uses occ setupchecks too.

UPDATE
I only have nextcloud configured in the nginx https server but nothing on the http side.

There are some additional refinements going on with the setup checks that may help a bit more in situations such as yours, but please also check your trusted_domains + matching DNS resolution from the Nextcloud server (or container, if applicable): Upgrade to Nextcloud 28 — Nextcloud latest Administration Manual latest documentation

I updated the post with:

  'trusted_domains' => 
  array (
    0 => 'adrhc.go.ro',
  ),

There’s no way to be a DNS issue because if it would be one, my nginx wouldn’t be hit, i.e. I see in its logs how occ setupchecks tries to access the above URL over HTTP.

By the way, I don’t use HTTP, i.e. I have nothing configured for nextcloud for HTTP.

I managed to print the URL occ setupchecks is using; many of them are badly created, e.g.:
https://adrhc.go.ro/**nextcloud/nextcloud**/apps
https://adrhc.go.ro/nextcloud/**nextcloud//home**/gigi/apps

What’s wrong with my configuration that the URLs are badly created? on the other hand the running nextcloud instance is working fine …

1 Like

I guess something is wrong with lib/private/URLGenerator.php:getAbsoluteURL. I created an issue for it: [Bug]: URLGenerator getAbsoluteURL is not working properly · Issue #47880 · nextcloud/server · GitHub.

be helpful if you gave a how instead of contantly linking that page, which doesnt describe how to do any of the ‘resolutions’…

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.