• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved JS files served with illegal characters

sjerp van wouden

New Pleskian
hi everyone

I've got an issue with JS files being served with illegal characters. [nak][stx] showing up. The files get corrupted.

Around the web a seemingly related issue has to do with vagrantbox's handling of sendfile.
in the nginx.conf one should add "sendfile = off". Also it's suggested to force UTF-8 encoding.
Reloading or restarting the nginx (and apache) does not resolve anything. Then again I don't have vagrantbox.

I've done all things suggested around the web and have been stuck the past 10 hours on this.

I have a relatively new Centos 7 VPS / 12.5 plesk installation with an Virtuozzo virtualisation. Only difference being that I've installed MariaDB 10.2 as my databases were mysql 5.6 which was incompatible with the 5.5.x shipped with plesk.

The frontend result can be seen at www.vloerwerk.org.

So this shows up in the middle of the jquery library:
ngth;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),R(f,d,e[d])));N.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){O.set(this,a)}):„-����„-��������������������•%������������@—%����x„-������������0„-�����@������0„-������������void 0!==c)return c;if(d=n.camelCase(a),c=O.get(f,d),void 0!==c)return c;if(c=R(f,d,void 0),void 0!==c)return c}else d=n.camelCase(a),this.each(function(){var c=O.get(this,d);O.set(this,d,b),

One would say this is not plesk but nginx related, however, serverfault refused this question.

This issue goes in tandam with 404 on css.map and js.map files.

Also I support that any non wp-admin, non frontpage url giving me a 404 is also related.

regards
Sjerp

--------------------------------------------------

HYPOTHESIS

Well it's still kind of puzzling, but this seems to be the case:
The apache-nginx (under plesk) cannot deal with corruption. Be it from a single record or a single file. The apache keeps going but the nginx get confused and writes garbage into the thing it specifically does, being sending the static files. So a corrupted featured image in Wordpress can mess up your JS. After you've confused nginx once, it's a lost fight for this WP. Reinstall completely (hard learned lesson). The "sendfile off" issue seems related due to it's context but is not at all related.

PRACTICALLY

Never have corrupted files. When trying to recover sites after for example corrupted file systems, take a working backup and put that online, put your corrupted WP in Xampp; export the posts through the XML exporter and transfer posts manually from the XML file. Don't transfer images that's dangerous: one corrupt file will kill your system. Open them in paint or something and save again so that corruption gets removed.
 
Last edited:
listing some tried things.

assuming: additional nginx directives in plesk makes /etc/nginx/nginx.conf obsolete; direct edit of plesk nginx conf not possible (autogenerated); work through 'plesk additional nginx directives' in apache & nginx settings. "sendfile off;" no effect. Cannot write contexts here also. Assumption is also wrong. Conf loaded in series.

It could be related to nginx serves corrupted files when files edited in host mounted volume · Issue #68 · noplay/docker-osx · GitHub
"I get weird file corruption when mounting /var/www into this container."
Indeed my stuff is in /var/www. The suggested solution (nest the sendfile off) does not seem to apply.
 
Last edited:
Then finally I resolved to reinstalling my entire VPS. Now files are server normally, initially!

I thought it was fixed but no. This might be the culprit: AFTER i entered wp-admin, looked into updating WP, I noticed my screen got jumbled. And then in the console the good old errors because of the corrupted js files started showing up again...

Here's the riddle...
update core -> reinstall WP fixes it; all styles and JS good again.
then switching to frontpage messes it up again.
where you're on the update core page, it's all messy again.
 
Last edited:
Back
Top