-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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]: v28 - Your webserver does not serve .mjs
files using the JavaScript MIME type...
#42989
Comments
Are you saying you know with certainty the test should pass in your environment? Can you confirm things that require
|
What is the output of:
|
@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.
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:
|
Specifically*: At least one of Nextcloud's configured *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
|
I can confirm the same issue, after update: 28.0.1 to 28.0.2 RC1 My output from
|
For those with the problem, can you please:
|
.mjs
files using the JavaScript MIME type....".mjs
files using the JavaScript MIME type...
I am simultaneously also have the "Could not load log entries" error. 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: |
@pandusen can you post the full RAW stack trace from the log reader app about |
Sure Could not detect any host:
Host violates local access rules:
|
This comment was marked as duplicate.
This comment was marked as duplicate.
@susnux should we add a
to the httpClient params?
|
Yes! I wonder why it did work when I tested it. This will probably resolve this issue! |
I do not use self-signed certs. My certs are not expired.
My server can connect to itself.
I use apache2.
|
This comment was marked as resolved.
This comment was marked as resolved.
Just for the ones deploying nextcloud on docker with nginx proxy, just deployed this version of nginx.conf (mine was quite outdated): https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf And error just went away: Curl without mjs support:
Curl with mjs support on nginx:
On my test server Nextcloud general settings doesn't show the issue anymore as you can see on the previous image, on my production server it shows it but when i curl esm-test.mjs it responds correctly:
So i suppose that on PRO all is working fine anyways. |
Always remember: Your webserver needs to be able to connect to one of the If it still happens even if you check the points from above, please open a NEW ticket including LOG ENTRIES for the setupcheck with DEBUG logging enabled. |
I was able to fix the error message; there was still a wrong host entry in /etc/hosts. With "PUBLICIP your.nextcloud.com" the error message has now disappeared. Just a little tip, maybe check the host file :) |
Yes, if you use Unix with Docker and revers proxy is install in another VM. Easy way diagnostic this problem is call "curl -I https://our.nextcloud.com/apps/settings/js/esm-test.mjs" with external VM if you get content-type: text/javascript, you have problem with hosts file. |
The test for .mjs file fails also on a site protected with ssl client certificate, as it cannot use any. |
I have this issue in my Nextcloud due to my setup using Docker containers and reverse proxy, the main URL for the Nextcloud instance is not accessible by the Docker container itself.
This is because
Note that this does not have HTTPS though. I tried to add this as a trusted domain in the config in the hope that it might try to use it in the Javascript check but it doesnt:
Is there anything else I can do? |
You could set |
Thanks, the first option does work, but won't this be overwritten whenever the Docker image is updated? Not a sustainable fix I think. I already have overwrite cli url set to the public URL of the Nextcloud so I can't change this. |
OK - seems I can add host-specific DNS override for the container with the argument I think this is sufficient to fix the issue |
Hello everyone.
In docker it would be something like Best |
Hi, have you checked that this fix persists after a reboot? As I believe by default, Docker issues IP addresses in the Docker network randomly, so there is no guarantee your caddy container will get the same Dockernet IP every time. |
It does persist a reboot. |
Just quickly confirming this on my end. I hope to find time to pin this down and report back in the coming days. |
Not sure what there is to confirm? This occurs when Nextcloud cannot reach itself by the URL you have configured for it. Considering this is most likely the case in setups where people are using reverse proxies, which you are doing, it's almost certainly the cause of your issue. |
I've noticed browser:
I'm not doing reverse proxy but wonder if there's a difference between curl and the browser..? |
Hi, While you may have found the cause of why this issue occurs in your circumstances, that does not mean it is the source of the issue and the only reason it's triggered. As in the O.P's issue; this occured upon an update of Nextcloud - where the issue was not present previously. Also being that mine is deployed from turnkey it was/is configured correctly to reach the URL and prior to the update had no issue so let's refrain from jumping to conclusions as to the cause. Regards |
On my instance, the fix was to disable CloudFlare proxy. The proxy was transforming text/javascript to text/html. There's potentially a "worker" solution for this in CloudFlare, but I did not pursue it. It is also noteworthy to pay attention to apache Some instances of Apache use |
Possible solution for nginx.I am running nextcloud on nginx and updating this part of the nginx nextcloud server config fixed this issue.:
I hope it helps someone ! |
formatting for this section is terrible. WIP See also: * nextcloud/server#42989 could fix with local DNS, or extra_hosts in compose.yml: * https://stackoverflow.com/questions/29076194/using-add-host-or-extra-hosts-with-docker-compose * https://github.com/compose-spec/compose-spec/blob/master/spec.md#extra_hosts
Thanks ondrejlohnisky You're contribution here finally led me to a solution. I had to remove $asset_immutable but doing so finally resolved the issue for me. location ~ .(?:css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite|map)$ {
|
@jlhollowell & @ondrejlohnisky: If adjusting I've seen some tutorials floating around where people appear to attempt to correct what they thing is a typo in the earlier $asset_immutable definition. But doing that is what breaks the later reference to it. The correct config (full can be pulled from the link just mentioned) is below:
[...]
|
this fix my problem @ondrejlohnisky thanks |
la solucion me funciono quitando el asset_immutable, tambien como tenia errores de carga del pdf, de txt, junto una lentitud la cual con esta regla logre hacer que fuera mas fluida # Combined location block for static files including .mjs
|
This issue was fixed for all supported Nextcloud versions. |
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
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.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
# sudo -u www-data php /var/www/nextcloud/occ app:list Enabled: - activity: 2.20.0 - admin_audit: 1.18.0 - bruteforcesettings: 2.8.0 - circles: 28.0.0-dev - cloud_federation_api: 1.11.0 - comments: 1.18.0 - contacts: 5.5.1 - contactsinteraction: 1.9.0 - dashboard: 7.8.0 - dav: 1.29.1 - federatedfilesharing: 1.18.0 - federation: 1.18.0 - files: 2.0.0 - files_accesscontrol: 1.18.0 - files_automatedtagging: 1.18.0 - files_external: 1.20.0 - files_pdfviewer: 2.9.0 - files_reminders: 1.1.0 - files_sharing: 1.20.0 - files_trashbin: 1.18.0 - files_versions: 1.21.0 - groupfolders: 16.0.3 - impersonate: 1.15.0 - logreader: 2.13.0 - lookup_server_connector: 1.16.0 - nextcloud_announcements: 1.17.0 - notifications: 2.16.0 - oauth2: 1.16.3 - onlyoffice: 9.0.0 - password_policy: 1.18.0 - photos: 2.4.0 - privacy: 1.12.0 - provisioning_api: 1.18.0 - recommendations: 2.0.0 - related_resources: 1.3.0 - serverinfo: 1.18.0 - settings: 1.10.1 - sharebymail: 1.18.0 - support: 1.11.0 - survey_client: 1.16.0 - systemtags: 1.18.0 - text: 3.9.1 - theming: 2.3.0 - twofactor_backupcodes: 1.17.0 - updatenotification: 1.18.0 - user_ldap: 1.19.0 - user_status: 1.8.1 - viewer: 2.2.0 - workflowengine: 2.10.0 Disabled: - encryption: 2.16.0 - files_retention: 1.16.0 (installed 1.16.0) - files_rightclick: 0.15.1 (installed 1.6.0) - firstrunwizard: 2.17.0 (installed 2.16.0) - suspicious_login: 6.0.0 - twofactor_totp: 10.0.0-beta.2 (installed 8.0.0-alpha.0) - weather_status: 1.8.0 (installed 1.6.0)
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: