Topic on Project:Support desk

Skin and load.php error in Chrome and others

11
PediarS (talkcontribs)
  • MediaWiki 1.24.2
  • PHP 5.4.39 (cgi-fcgi)
  • MySQL 5.5.42-cll

Hi, I installed a new clean Wiki 1.24.2 in my VPS host, and now I have a problem with skins and load.php in Google Chrome.

I tried all of solutions I find on this board and other sites, like some code in .htaccess (this fix the problem in Firefox) and LocalSettings minimal changes and stuff (cache, localhost URL, etc.).

But in Google Chrome, Opera and other similar browsers -included mobile version- nothing work.

The specific error is:

Refused to execute script from '/w/load.php?debug=false&lang=es&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=20150521T163633Z' because its MIME type ('(null)') is not executable, and strict MIME type checking is enabled.

and...

index.php?title=Especial:Entrar:14 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "/w/load.php?debug=false&lang=es&modules=mediawiki.leg….button%2Ccheckbox%2Cinput%7Cskins.vector.styles&only=styles&skin=vector&*".

So, all the CSS and Vector skin is gone.

  • RewriteEngine On
  • RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
  • RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
  • RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
  • RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
  • RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]
  • RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
  • RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
  • RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
  • RewriteCond %{QUERY_STRING} only=styles
  • RewriteRule ^load.php - [QSA,E=content_type:text/css]
  • RewriteCond %{QUERY_STRING} only=scripts
  • RewriteRule ^load.php - [QSA,E=content_type:application/javascript]
  • RewriteCond %{REQUEST_URI} !^/(redirect|load|texvc|index).php
  • RewriteRule ^(api|load)\.php - [L]

This is my htaccess, this fix (I guess) the problem only in Firefox and sometimes I can see everything perfectly in other browsers until -after a couple of clicks- error happen again. I think it's an important, check it as soon as possible because affects the entirety wiki and cause inconvenience to visitors.

Thanks for your cooperation.

PediarS (talkcontribs)

More info here, I have to edit URL links because I could not publish.

Error screenshot: imgur[.]com/1jJiUDs.png

.htaccess screenshot: imgur[.]com/fGtfCoF.png

My wiki: pediars[.]com

Ciencia Al Poder (talkcontribs)

You shouldn't need to set a content-type for load.php URLs, MediaWiki should send the correct content-type.

The URL scheme of the wiki is that it's published at /w and it has rewrite rules for short URLs at /wiki. But your .htaccess has rules on lines 14, 17, 19 and 21 that matches the start of the URL (because they have the "^" character) but no /w is present. From my understanding, from line 12 to the end shouldn't be necessary.

Aimednovac (talkcontribs)

Hello,

I have the same error : Refused to execute script from 'http://localhost/Wiki/load.php?debug=false&lang=fr&modules=startup&only=scripts&skin=vector' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

all the CSS and Vector skin is gone.

When I supress the table module_dps it works on a page, there is a cache problem somewhere

  • MediaWiki 1.29.1
  • PHP 5.6.25
  • MySQL 5.7.14

Do you have a solution? thank you in advance

Ciencia Al Poder (talkcontribs)
Aimednovac (talkcontribs)

I already tried. It works if I drop the contents of modules_dps. It is enough that I call once another page (which will work the first time) then http: //localhost/Wiki/load.php? Debug = false & lang = fr & modules = startup & only = scripts & skin = vector will be in error.

thnks

Ciencia Al Poder (talkcontribs)

Ok, but what I was asking is what do you get on that URL when it errors out. In fact I expect it to display detailed error information so please be sure you set $wgShowExceptionDetails = true; in LocalSettings.php

This post was hidden by Aimednovac (history)
Aimednovac (talkcontribs)

I already activated the function $wgShowExceptionDetails = true;

when i use the url, i have :

( ! ) Catchable fatal error: Argument 1 passed to ResourceLoaderModule::expandRelativePaths() must be of the type array, null given, called in C:\workspaces\Wiki\WikiPaprec\includes\resourceloader\ResourceLoader.php on line 133 and defined in C:\workspaces\Wiki\WikiPaprec\includes\resourceloader\ResourceLoaderModule.php on line 546
Ciencia Al Poder (talkcontribs)

It seems there's a problem when decoding the json string from the md_deps column of module_deps. Maybe the table is using a strange collation causing non-ascii characters to be mangled and causing issues (which shouldn't be the case since the column is a mediumblob type which means it stores binary data), or the string is cut-off. This is specially true when you say truncating the table makes it work on the first load.

Check the table structure and make sure it's as described in module_deps table.

Execute also this select to see what's the maximum data length stored on the table:

select md_module, md_skin, length(md_deps) from module_deps order by length(md_deps) desc limit 5;
Aimednovac (talkcontribs)

good very good.

Effectively md_deps is supposed to be in nvarchar (max) ==> longtext in MySQL, but it was a varchar (255) I changed the type to longtext is it works.

Thank you very much