Loading failed for the <script> with source “https://*/index.php/js/core/merged-template-prepend.js



Install Details:

Nextcloud version (eg, 12.0.2): 13.0.4
Operating system and version (eg, Ubuntu 17.04): [Don’t know how to check this]
Apache or nginx version (eg, Apache 2.4.25): [Don’t know how to check this]
PHP version (eg, 7.1): 7.1

Issue Description:

I am self hosting a NextCloud install on a Dreamhost server. Recently, they required me to create a new user, which triggered some script on their end to move the files to another directory on their servers. Since then, my Nextcloud instance is completely unavailable. I have tried to fix it with them, they are of no help whatsoever.

So I would like to know if anyone could provide me any help on how to fix this. The files are all there, the databases are all accessible, but nothing works. See https://docs.jansensan.net.

[Thu Jan 31 15:00:02 2019] [error] [client] 
stat failed for 
\\/home\\/jansensan\\/docs.jansensan.net\\/data\\/nextcloud.log at 
(X11; Linux x86_64) AppleWebKit\\/537.36 (KHTML, like Gecko) 
Chrome\\/53.0.2785.143 Safari\\/537.36","version":""} 
[Thu Jan 31 15:00:02 2019] [error] [client] 
Permission denied at 
(X11; Linux x86_64) AppleWebKit\\/537.36 (KHTML, like Gecko) 
Chrome\\/53.0.2785.143 Safari\\/537.36","version":""} 

At this point I am completely blocked, and I see no other solution than to reinstall the whole damn thing, which is not interesting to me whatsoever.

Any help would be appreciated, I would love to love FOSS, but when crazy things like these happen, I am less interested.

Thanks in advance for any guidance.

Should I reinstall NextCloud?

The problem seems to be your log file. Check the permissions!


Thanks for replying quickly @JABAHOSTING. The current permissions are 644, and the original install were 640. I tried switching them to 640 and tested, to no avail. Should they have had another value?


Wait, looking at your line, it makes me realize that it is pointing to an old directory. Are there paths saved somewhere within Nextcloud that could be hardcoded and pointing to a wrong location after the files were moved?


Nextcloud create the log file into the datadirectory. Have you change the datadirectory in the config.php?

Is the owner of the Log file correct?


Ok so I went to config.php, corrected that part, it’s moving forward a bit. Things appear on-screen.

Looking at the browser console, there are multiple errors.

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). [files:1:1](https://docs.jansensan.net/index.php/apps/files/)

Loading failed for the &lt;script&gt; with source “https://docs.jansensan.net/index.php/js/core/merged-template-prepend.js?v=b83073ec-3”. [files:45:1](https://docs.jansensan.net/index.php/apps/files/)

Loading failed for the &lt;script&gt; with source “https://docs.jansensan.net/index.php/js/notifications/merged.js?v=b83073ec-3”.


This kind of error happens when a domain tries to load files from another domain, which is not the case here… Is this something about permissions? Those files are 644 at this time.


Where is your datadirectory? Is it in your docroot?


It’s at /home/jansensandocs/ and the install is at /home/jansensandocs/docs.jansensan.net/. I am unable to go to the /home/ directory, as my users do not have that permission.


You have php openbasedir active? If yes, what is you openbasedir?

I think that the Webserver does not have access to /home/jansensandocs/ only in /home/jansensandocs/docs.jansensan.net/.

If you dont know, what I mean change the datadirectory back to /home/jansensandocs/docs.jansensan.net/


I don’t know what is “php openbasedir” Where can I find this?

At this time all the files are at the proper place of /home/jansensandocs/docs.jansensan.net/. There are issues with loading files even though they are there…




Ok this seems to be about trying to load files outside of the directory of the user, which is not the current case. All the files of the install are at the proper location.

The issues that the browser is spitting is because it cannot load files. These errors would happen if for example https://domain123.com is trying to load files from https://domainabc.com. But in this case, all files are on the same domain, under the proper install directory.


Would there be an entry in the error logs if the open_basedir is the cause of those errors?


Normal yes, like this ->PHP Warning: Unknown: open_basedir restriction in effect.


There was nothing like that.

The browser throws an error:

Loading failed for the <script> with source “https://docs.jansensan.net/index.php/js/core/merged-template-prepend.js?v=b83073ec-3”.

That URL makes no sense, why would there be a directory called “index.php”?


I am still unable to figure out what this issue is, nor can I find documentation about it. These are the current errors (in the browser console) that I am facing:

Content Security Policy: The page’s settings blocked the loading of a resource at inline (“script-src”). [login:1:1](https://docs.jansensan.net/index.php/login)

Loading failed for the &lt;script&gt; with source “https://docs.jansensan.net/index.php/js/core/merged-share-backend.js?v=b83073ec-3”. [login:25:1](https://docs.jansensan.net/index.php/login)

Loading failed for the &lt;script&gt; with source “https://docs.jansensan.net/index.php/js/core/merged-login.js?v=b83073ec-3”. [login:32:1](https://docs.jansensan.net/index.php/login)

JQMIGRATE: Migrate is installed, version 1.4.0 [core.js:7:542](https://docs.jansensan.net/core/vendor/core.js?v=b83073ec-3)

Loading failed for the &lt;script&gt; with source “https://docs.jansensan.net/index.php/apps/theming/js/theming?v=3”. [login:54:1](https://docs.jansensan.net/index.php/login)

Source map error: request failed with status 500 Resource URL: https://docs.jansensan.net/core/vendor/core.js?v=b83073ec-3 Source Map URL: purify.min.js.map[Learn More]

Any guidance to help me fix this issue is greatly appreciated. At this time, I cannot log into the NextCloud install at all.

Should I reinstall NextCloud?
Should I reinstall NextCloud?

Is this the policy set by Nextcloud or an additional one? (just thinking loud).

In case you have a special theme or some “exotic” app, I’d try to disable this first and see if it helps. Perhaps an app or something is using some absolute paths it generated upon activation. But that is all wild guessing.

Or with the new server, perhaps something on their configuration has changed…