Mail app fails to load due to MIME type mismatch

Hi all,

I’m running Nextcloud 10.0.1 on Debian 8 with Apache 2.4.10, PHP 5.6.27, and MySQL 5.5.53. The installation is migrated from a former OwnCloud 9 instance.

Beside the common stable apps (contacts, calendar, activity etc) the experimental apps Notes, QOwnNotesAPI and Tasks are installed and active.

Everything runs fine and as expected already for quite a while. The only exception is the mail app, when I try to open it, loading ends with the rotating circles.

Firefox’ console show the following error:

Refused to execute script from 'http://<host>/owncloud/apps/mail/init.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Uncaught Error: Script error for "init"(…)


20:50:46.727 The resource from “https://<host>/owncloud/apps/files/” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff). 1 mail
20:50:46.728 Error: Script error for "init" 1 require.js:168:17
	makeError https://<host>/owncloud/apps/mail/js/vendor/requirejs/require.js:168:17
	newContext/context.onScriptError https://<host>/owncloud/apps/mail/js/vendor/requirejs/require.js:1735:36
	onStopRequest resource://gre/modules/WebRequest.jsm:221:18

mod_mime appears to be configured correctly and there are no related messages in the log.

Any suggestions what could be wrong?

Thanks a lot,

could you check your browser’s network log and check what mime type the server returns for that file?

Moreover are you using debug mode in production? The Nextcloud server should serve the minified mail.min.js instead of the source file init.js. :confused:

Hi Christoph,

thanks for your response!
The debug flag was not set at all, I set it explicitly to ‘false’.

The init.js is indeed returned as text/html, as the only JS file. For all others the right MIME type is used. But I noticed a difference, init.js is delivered (again as the only JS resource) with status code 302 and a location header https:///owncloud/apps/files/

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Length: 0
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Content-Type: text/html; charset=UTF-8
Date: Fri, 25 Nov 2016 18:37:23 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=86
Location: https://<host>/owncloud/apps/files/
Pragma: no-cache
Server: Apache/2.4.10 (Debian)
Strict-Transport-Security: max-age=15768000
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-Robots-Tag: none
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block

Does this make any sense for you?


Thank you for your detailed response.

This is clearly a bug, maybe related to Could you please file an issue at our github repo and provide the information that is asked in the issue template? Thanks!


the issue seems to be limited to manually installed builds from (last try with those from 28. Nov). Meanwhile I’ve tried the version from the store (didn’t noticed it there before) and this one starts.
Should I raise a ticket anyway?

Sorry in case I caused needless trouble.

I’m pretty sure this is the very same problem. Hence I’m closing this topic here :slight_smile: