Closed rchaconmolero closed 7 months ago
Are you saying you know with certainty the test should pass in your environment?
Can you confirm things that require mjs
are fully functioning:
Yes. Activity and logging show current logs entries.
What is the output of:
curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs
@rchaconmolero this would be interesting because what that test does is testing to access your instance and check the returned mime type. Meaning if your server can not resolve its own host name it will fail here.
What is the output of:
curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs
Also it would be really helpful if you could set the logging level to debug and send the logfile or at least search the log for an entry like the following and send that entry if it exists:
Can not connect to local server for checking JavaScript modules support
Meaning if your server can not resolve its own host name it will fail here.
Specifically*: At least one of Nextcloud's configured trusted_domains
must be accessible (via its URL) from the Nextcloud app server itself.
*Or at least that's my take from my first read though of this recently added code
In Chrome or webserver, URL --> "https://next01d.canal-sur.interno/apps/settings/js/esm-test.mjs"
/**
export default 'Hello'
.- The output to the command
# curl -I https://next01d.canal-sur.interno/apps/settings/js/esm-test.mjs HTTP/2 200
strict-transport-security: max-age=15552000; includeSubDomains
referrer-policy: no-referrer
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-robots-tag: noindex, nofollow
x-xss-protection: 1; mode=block
last-modified: Sat, 20 Jan 2024 10:43:51 GMT
etag: "6d-60f5e45bc0776"
accept-ranges: bytes
content-length: 109
vary: Accept-Encoding
cache-control: max-age=15778463
content-type: text/javascript
date: Sun, 21 Jan 2024 05:27:03 GMT
server: Apache
I can confirm the same issue, after update: 28.0.1 to 28.0.2 RC1
My output from curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs
:
HTTP/1.1 200 OK
Date: Sun, 21 Jan 2024 11:11:18 GMT
Server: Apache/2.4.57 (AlmaLinux) OpenSSL/3.0.7
Strict-Transport-Security: max-age=63072000
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
Upgrade: h2
Connection: Upgrade
Last-Modified: Sun, 21 Jan 2024 07:11:10 GMT
ETag: "6d-60f6f6af88f68"
Accept-Ranges: bytes
Content-Length: 109
Cache-Control: max-age=15778463
Content-Type: text/javascript
For those with the problem, can you please:
Also it would be really helpful if you could set the logging level to debug and send the logfile here, or at least, search the log for an entry like the following and send that complete entry if it exists:
Can not connect to local server for checking JavaScript modules support
I am simultaneously also have the "Could not load log entries" error. Currently investigating. Edit: Above was a ublock issue.
Yes, my log contains this entry:
LocalServerExceptionCould not detect any host Can not connect to local server for checking JavaScript modules support
Also has this Entry: LocalServerException Host violates local access rules Can not connect to local server for checking JavaScript modules support
@pandusen can you post the full RAW stack trace from the log reader app about
Can not connect to local server for checking JavaScript modules support
?
Sure (I have replaced fqdn and username.)
Could not detect any host:
{
"reqId": "Za0hieI4tzKF-QVLu1D6wwAA1iE",
"level": 0,
"time": "2024-01-21T13:52:11+00:00",
"remoteAddr": "192.168.0.30",
"user": "user",
"app": "settings",
"method": "GET",
"url": "/index.php/settings/ajax/checksetup",
"message": "Can not connect to local server for checking JavaScript modules support",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"version": "28.0.2.0",
"exception": {
"Exception": "OCP\\Http\\Client\\LocalServerException",
"Message": "Could not detect any host",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/nextcloud/lib/private/Http/Client/Client.php",
"line": 260,
"function": "preventLocalAddress",
"class": "OC\\Http\\Client\\Client",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/apps/settings/lib/SetupChecks/JavaScriptModules.php",
"line": 67,
"function": "head",
"class": "OC\\Http\\Client\\Client",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/SetupCheck/SetupCheckManager.php",
"line": 49,
"function": "run",
"class": "OCA\\Settings\\SetupChecks\\JavaScriptModules",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/apps/settings/lib/Controller/CheckSetupController.php",
"line": 303,
"function": "runAll",
"class": "OC\\SetupCheck\\SetupCheckManager",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "check",
"class": "OCA\\Settings\\Controller\\CheckSetupController",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/html/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/html/nextcloud/lib/private/Http/Client/Client.php",
"Line": 192,
"message": "Can not connect to local server for checking JavaScript modules support",
"exception": [],
"url": "cloud.nextcloud.tld/apps/settings/js/esm-test.mjs",
"CustomMessage": "Can not connect to local server for checking JavaScript modules support"
},
"id": "65ad22baddbdd"
}
Host violates local access rules:
{
"reqId": "Za0hieI4tzKF-QVLu1D6wwAA1iE",
"level": 0,
"time": "2024-01-21T13:52:11+00:00",
"remoteAddr": "192.168.0.30",
"user": "user",
"app": "settings",
"method": "GET",
"url": "/index.php/settings/ajax/checksetup",
"message": "Can not connect to local server for checking JavaScript modules support",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
"version": "28.0.2.0",
"exception": {
"Exception": "OCP\\Http\\Client\\LocalServerException",
"Message": "Host violates local access rules",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php",
"line": 35,
"function": "OC\\Http\\Client\\{closure}",
"class": "OC\\Http\\Client\\DnsPinMiddleware",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
"line": 31,
"function": "__invoke",
"class": "GuzzleHttp\\PrepareBodyMiddleware",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php",
"line": 71,
"function": "GuzzleHttp\\{closure}",
"class": "GuzzleHttp\\Middleware",
"type": "::",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
"line": 63,
"function": "__invoke",
"class": "GuzzleHttp\\RedirectMiddleware",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php",
"line": 75,
"function": "GuzzleHttp\\{closure}",
"class": "GuzzleHttp\\Middleware",
"type": "::",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
"line": 331,
"function": "__invoke",
"class": "GuzzleHttp\\HandlerStack",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
"line": 168,
"function": "transfer",
"class": "GuzzleHttp\\Client",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
"line": 187,
"function": "requestAsync",
"class": "GuzzleHttp\\Client",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/var/www/html/nextcloud/lib/private/Http/Client/Client.php",
"line": 261,
"function": "request",
"class": "GuzzleHttp\\Client",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/apps/settings/lib/SetupChecks/JavaScriptModules.php",
"line": 67,
"function": "head",
"class": "OC\\Http\\Client\\Client",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/SetupCheck/SetupCheckManager.php",
"line": 49,
"function": "run",
"class": "OCA\\Settings\\SetupChecks\\JavaScriptModules",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/apps/settings/lib/Controller/CheckSetupController.php",
"line": 303,
"function": "runAll",
"class": "OC\\SetupCheck\\SetupCheckManager",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "check",
"class": "OCA\\Settings\\Controller\\CheckSetupController",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/AppFramework/App.php",
"line": 184,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/lib/private/Route/Router.php",
"line": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/var/www/html/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/var/www/html/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/var/www/html/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",
"Line": 150,
"message": "Can not connect to local server for checking JavaScript modules support",
"exception": [],
"url": "https://cloud.nextcloud.tld/apps/settings/js/esm-test.mjs",
"CustomMessage": "Can not connect to local server for checking JavaScript modules support"
},
"id": "65ad22badfee9"
}
{"reqId":"gyjwFmfci2qcrrnrMlA6","level":0,"time":"2024-01-21T15:24:40+01:00","remoteAddr":"10.236.138.4","user":"adminnext","app":"settings","method":"GET","url":"/settings/ajax/checksetup","message":"Can not connect to local server for checking JavaScript modules support","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0","version":"28.0.2.0","exception":{"Exception":"OCP\Http\Client\LocalServerException","Message":"Could not detect any host","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Http/Client/Client.php","line":260,"function":"preventLocalAddress","class":"OC\Http\Client\Client","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/SetupChecks/JavaScriptModules.php","line":67,"function":"head","class":"OC\Http\Client\Client","type":"->"},{"file":"/var/www/nextcloud/lib/private/SetupCheck/SetupCheckManager.php","line":49,"function":"run","class":"OCA\Settings\SetupChecks\JavaScriptModules","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":303,"function":"runAll","class":"OC\SetupCheck\SetupCheckManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"check","class":"OCA\Settings\Controller\CheckSetupController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1069,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Http/Client/Client.php","Line":192,"message":"Can not connect to local server for checking JavaScript modules support","exception":[],"url":"next01d.canal-sur.interno/apps/settings/js/esm-test.mjs","CustomMessage":"Can not connect to local server for checking JavaScript modules support"},"id":"65ad296c9a981"}
@susnux should we add a
'nextcloud' => ['allow_local_address' => true]
to the httpClient params?
@susnux should we add a
'nextcloud' => ['allow_local_address' => true]
to the httpClient params?
Yes! I wonder why it did work when I tested it. This will probably resolve this issue!
@pandusen please try https://github.com/nextcloud/server/pull/42999 and report back if possible.
In my case, with 'allow_local_address' => true, in config.php does not resolve the problem.
Same here. The output of curl shows it being returned as content-type: text/javascript , however I still get the error show. Adding allow_local_address to the config.php does not change anything.
Have you all tried the PR, or just edited the config.php file?
I did both. I edited line 67 in apps/settings/lib/SetupChecks/JavaScriptModules.php , which was then formatted into multiple lines, and I added line 78.
I did both. I edited line 67 in apps/settings/lib/SetupChecks/JavaScriptModules.php , which was then formatted into multiple lines, and I added line 78.
Can you please look at your log and send the log message?
Also it would be really helpful if you could set the logging level to debug and send the logfile here, or at least, search the log for an entry like the following and send that complete entry if it exists:
Can not connect to local server for checking JavaScript modules support
As this should now be a different one
Ok I'm out of ideas here, and I can't reproduce the error on my test instances 😭
curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs
But, as long as the Content-Type
returned by the above comand is either application/javascript
or text/javascript
, this warning/error is purely cosmetic and everything works as expected 👍
The PR by it selv, cleared the error in the Nextcloud dashboard. Adding the line in config.php, makes no difference. For good measure i copied the edited loop from my JavaScriptModeules.php, in case i mistyped, and just broke the checking function.
foreach ($testURLs as $testURL) {
try {
$client = $this->clientService->newClient();
$response = $client->head($testURL, [
'connect_timeout' => 10,
'nextcloud' => [
'allow_local_address' => true,
],
]);
if (preg_match('/(text|application)\/javascript/i', $response->getHeader('Content-Type'))) {
return SetupResult::success();
}
} catch (\Throwable $e) {
$this->logger->debug('Can not connect to local server for checking JavaScript modules support', ['exception' => $e, 'url' => $testURL]);
return SetupResult::warning($this->l10n->t('Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.'));
}
}
return SetupResult::error($this->l10n->t('Blablabla'));
@pandusen so I understand it correctly, if using the code from the pull request the error is gone?
@susnux Yes, in my instance, the error is gone after updating the code. It is neither in Dashboard or Logfile at Debug level. (Seemingly, I dont even have to add anything to the Nextcloud config.php)
ok thank you :)
After upgrading to 28.02 RC3 I noticed that there is no support for self-signed certificates and the behavior is to leave an unclear-able warning message:
"Could not check for JavaScript support. Please check manually if your webserver serves .mjs files using the JavaScript MIME type."
Can you add a flag in the JavaScriptModeules.php to support self-signed certificates? Something like: 'nextcloud' => 'allow_local_address' => true, 'ignore_ssl_certificate' => true, ],
OR
'nextcloud' => 'allow_local_address' => true, 'allow_self_signed_certs' => true, ],
After upgrading to 28.02 RC3 I noticed that there is no support for self-signed certificates and the behavior is to leave an unclear-able warning message:
"Could not check for JavaScript support. Please check manually if your webserver serves .mjs files using the JavaScript MIME type."
Can you add a flag in the JavaScriptModeules.php to support self-signed certificates? Something like: 'nextcloud' => 'allow_local_address' => true, 'ignore_ssl_certificate' => true, ],
OR
'nextcloud' => 'allow_local_address' => true, 'allow_self_signed_certs' => true, ],
@theoriginalguy I think this is a good solution. In RC4 version the problem still occurs
After upgrading to 28.02 RC3 I noticed that there is no support for self-signed certificates and the behavior is to leave an unclear-able warning message:
Different issue, handled in https://github.com/nextcloud/server/issues/43153
For those that experience this issue and use nginx
as reverse proxy:
I had the same issue and tested with esm-test.mjs
command above:
$ curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs
HTTP/2 200
server: nginx
date: Thu, 01 Feb 2024 14:19:31 GMT
content-type: application/octet-stream
content-length: 109
last-modified: Thu, 01 Feb 2024 08:37:38 GMT
etag: "65bb5852-6d"
strict-transport-security: max-age=63072000; includeSubDomains; preload
referrer-policy: no-referrer
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-robots-tag: noindex, nofollow
x-xss-protection: 1; mode=block
accept-ranges: bytes
Noting that the content-type
is application/octet-stream
being my default mime-type for extensions, nginx
obviously doesn't have the '.mjs' extension in the mime.types file.
I fixed the issue by adding the .mjs extension to nginx.conf like this:
http {
...
include /etc/nginx/mime.types;
types {
application/javascript mjs;
}
default_type application/octet-stream;
...
}
Credits: https://github.com/storybookjs/storybook/issues/20157#issuecomment-1500456820
For those that experience this issue and use
nginx
as reverse proxy:I had the same issue and tested with
esm-test.mjs
command above:$ curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs HTTP/2 200 server: nginx date: Thu, 01 Feb 2024 14:19:31 GMT content-type: application/octet-stream content-length: 109 last-modified: Thu, 01 Feb 2024 08:37:38 GMT etag: "65bb5852-6d" strict-transport-security: max-age=63072000; includeSubDomains; preload referrer-policy: no-referrer x-content-type-options: nosniff x-download-options: noopen x-frame-options: SAMEORIGIN x-permitted-cross-domain-policies: none x-robots-tag: noindex, nofollow x-xss-protection: 1; mode=block accept-ranges: bytes
Noting that the
content-type
isapplication/octet-stream
being my default mime-type for extensions,nginx
obviously doesn't have the '.mjs' extension in the mime.types file.I fixed the issue by adding the .mjs extension to nginx.conf like this:
http { ... include /etc/nginx/mime.types; types { application/javascript mjs; } default_type application/octet-stream; ... }
After fixing the mime-type issue as described above, my nginx still won't deliver .mjs correctly.
In the /etc/nginx/sites-enabled/your-vhost.conf I had to add mjs also: Look for this and add mjs to location:
# Adding the cache control header for js, css and map files
# Make sure it is BELOW the PHP block
location ~ \.(?:css|mjs|js|woff2?|svg|gif|map|png|jpg|ico)$ {
Both changes are also fully covered in the Admin Manual:
https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
For those that experience this issue and use
nginx
as reverse proxy: I had the same issue and tested withesm-test.mjs
command above:$ curl -I https://your.nextcloud.tld/apps/settings/js/esm-test.mjs HTTP/2 200 server: nginx date: Thu, 01 Feb 2024 14:19:31 GMT content-type: application/octet-stream content-length: 109 last-modified: Thu, 01 Feb 2024 08:37:38 GMT etag: "65bb5852-6d" strict-transport-security: max-age=63072000; includeSubDomains; preload referrer-policy: no-referrer x-content-type-options: nosniff x-download-options: noopen x-frame-options: SAMEORIGIN x-permitted-cross-domain-policies: none x-robots-tag: noindex, nofollow x-xss-protection: 1; mode=block accept-ranges: bytes
Noting that the
content-type
isapplication/octet-stream
being my default mime-type for extensions,nginx
obviously doesn't have the '.mjs' extension in the mime.types file. I fixed the issue by adding the .mjs extension to nginx.conf like this:http { ... include /etc/nginx/mime.types; types { application/javascript mjs; } default_type application/octet-stream; ... }
After fixing the mime-type issue as described above, my nginx still won't deliver .mjs correctly.
In the /etc/nginx/sites-enabled/your-vhost.conf I had to add mjs also: Look for this and add mjs to location:
# Adding the cache control header for js, css and map files # Make sure it is BELOW the PHP block location ~ \.(?:css|mjs|js|woff2?|svg|gif|map|png|jpg|ico)$ {
I applied these changed to my mime.types file and vhost and the error was gone. Thanks!
Many thanks for this solution. I have the same case in nginx.
I added:
application/javascript mjs;
in /etc/nginx/mime.types
and in vhost config:
location ~ \.(?:css|mjs|js|svg|gif|png|jpg|ico|wasm|tflite|map)
Same issue here I don't use nginx My Activities feed and Logs work fine
I've tried with 'allow_local_address' => true into the config.php and no luck, going to remove it
FWIW:
and
me@me ~ % curl -I https://mydomain/apps/settings/js/esm-test.mjs
HTTP/1.1 200 OK
Date: Fri, 02 Feb 2024 14:26:12 GMT
Server: Apache/2.4.41 (Ubuntu)
Strict-Transport-Security: max-age=15552000; includeSubDomains
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
Last-Modified: Fri, 02 Feb 2024 13:55:53 GMT
ETag: "6d-6106678759834"
Accept-Ranges: bytes
Content-Length: 109
Cache-Control: max-age=15778463
Content-Type: text/javascript
Should I make a new bug report @susnux , it looks like this one is closed (I admit I didn't notice this when I commented)
@hardingt Not sure your installation environment, but what happens when you run that curl
command from the Nextcloud app container/server itself?
@hardingt are you running 28.0.2? If not please update as the fixes are included in that version. If you use self signed certificates you would have to wait for 28.0.3 and just ignore the warning.
Running 28.0.2, it's when I first noticed the issue (I upgraded just this morning)
I'm not sure how to run the curl command from the app server itself, when I do it just hangs, is there a specific path I should be using instead of https://mydomain/apps/settings/js/esm-test.mjs?
root@nextcloud:/var/www/nextcloud/config# curl -I https://mydomain/apps/settings/js/esm-test.mjs
I usually cancel it after 30 seconds.
Maybe try -v
flag to show where it hangs?
Also you might need the index.php/
part within the URL, depending on the configuration of your server?
You could also enable debug log level ('loglevel' => 0
) and post the log entry from the failed setup check.
Also getting this error after updating from 28.0.1 to 28.0.2
I was hit by this after upgrading NC 27.6 to 28.2
I've solved this for me by modifying the file /etc/nginx/mime.type, changing the line
application/javascript js;
to
application/javascript js mjs;
If a change to the webserver config is required, then there should be instructions to to so
@vasyugan
If a change to the webserver config is required, then there should be instructions to to so
There are. See the Admin Manual. :-) The nginx config in the manual for the last two major releases includes it and it was also noted in the first release that required it in the release notes section of the Admin Manual. It's been required since NC27, but impacts more things in NC28 so a lot of folks didn't notice until now. :-)
@joshtrichards I see it here:
and here
but both reference nginx, many of us aren't using nginx it seems from the logs posted here.
@susnux I'll take a look tomorrow with the suggestions you given. My guess is that my dns isn't set up to redirect my domain name to local host, and I'm not savvy enough to know what setting that up would do to the SSL cert:
curl: (60) SSL: no alternative certificate subject name matches target host name 'localhost'
I'll see about turning on the debug log.
@hardingt
but both reference nginx, many of us aren't using nginx it seems from the logs posted here.
It's irrelevant for Apache since we provide an updated .htaccess
with each release. And we don't provide configs for any other web servers.
I'm using apache. After updating to 28.0.2 today I'm getting the error:
Could not check for JavaScript support. Please check manually if your webserver serves `.mjs` files using the JavaScript MIME type.
Output of curl -I https://DOMAIN/apps/settings/js/esm-test.mjs
:
HTTP/1.1 200 OK
Date: Fri, 02 Feb 2024 18:57:01 GMT
Server: Apache/2.4.57 (Debian)
Strict-Transport-Security: max-age=15552000; includeSubDomains
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: noindex, nofollow
X-XSS-Protection: 1; mode=block
Upgrade: h2,h2c
Connection: Upgrade
Last-Modified: Thu, 01 Feb 2024 09:37:38 GMT
ETag: "6d-6104ebefcdc80"
Accept-Ranges: bytes
Content-Length: 109
Vary: Accept-Encoding
Cache-Control: max-age=15778463
Content-Type: text/javascript
I was having the same issue with 28.0.2 on Apache. I used to connect to Apache directly, but have now pfSense in front of it. It appeared, that the certificate on Apache expired (did not notice as I connect via pfSense and ignore cert issues from the backend). This was however causing issues with the check for .mjs. After updating the certificate, the error was gone.
If a change to the webserver config is required, then there should be instructions to to so
As Josh already mentioned, this is in the Admin manual since Nextcloud 27.
Please see here for the self-signed certificate issue: https://github.com/nextcloud/server/issues/43153
trusted_domains
)..mjs
support.curl -I https://DOMAIN/apps/settings/js/esm-test.mjs
shows content type text/javascript
nextcloud.log
when setting loglevel
to 0.You can safely ignore the warning if curl -I https://DOMAIN/apps/settings/js/esm-test.mjs shows content type text/javascript
I have the same problem and curl shows "content type text/javascript", but I hate ignoring warnings, if this warning is so insignificant, there should be an option to hide this warning and still get the green tick.
Why is this closed? Its not resolved? I Have tryed every tip here and nothing works. Letsencrypt Cert, nginx and nginx as Reverse Proxy.
i don't know why, but i have two instances and one of them has this warning. The other not.
⚠️ This issue respects the following points: ⚠️
Bug description
After upgrade from 28.0.1 to 28.0.2 RC1 appears in security and setup warning page: There are some errors regarding your setup. Your webserver does not serve
.mjs
files using the JavaScript MIME type. This will break some apps by preventing browsers from executing the JavaScript files. You should configure your webserver to serve.mjs
files with either thetext/javascript
orapplication/javascript
MIME type.Steps to reproduce
.mjs
files using the JavaScript MIME type. This will break some apps by preventing browsers from executing the JavaScript files. You should configure your webserver to serve.mjs
files with either thetext/javascript
orapplication/javascript
MIME type.Expected behavior
No messages about "Your webserver does not serve
.mjs
files using the JavaScript MIME type."Installation method
Community Manual installation with Archive
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
None
Is this bug present after an update or on a fresh install?
Updated from a MINOR version (ex. 22.1 to 22.2)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
No response