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

**URL:** <https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787>\
**Category:** ℹ️ Support\
**Tags:** nc13\
**Created:** [February 3, 2019, 2:29pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787 "2019-02-03T14:29:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 2:29pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/1 "2019-02-03T14:29:02Z")

</div>

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](https://docs.jansensan.net).

- I have made sure to add the intl extension (because they didnt when they created the new directory): [https://help.dreamhost.com/hc/en-us/articles/360003820252-How-to-enable-the-intl](https://help.dreamhost.com/hc/en-us/articles/360003820252-How-to-enable-the-intl)
- I have checked some file permissions to ensure they are the same on the target location as on the original
- I have been told there is this error, but I have not idea what to do with this:

```auto
[Thu Jan 31 15:00:02 2019] [error] [client 216.112.17.10] 
{"reqId":"XFN98tBx2fEAAAtAYJUAAAAL","level":3,"time":"2019-01-31T23:00:02+00:00","remoteAddr":"216.112.17.10","user":"--","app":"PHP","method":"GET","url":"\\/","message":"fileperms(): 
stat failed for 
\\/home\\/jansensan\\/docs.jansensan.net\\/data\\/nextcloud.log at 
\\/home\\/jansensandocs\\/docs.jansensan.net\\/lib\\/private\\/Log\\/File.php#136","userAgent":"Mozilla\\/5.0 
(X11; Linux x86_64) AppleWebKit\\/537.36 (KHTML, like Gecko) 
Chrome\\/53.0.2785.143 Safari\\/537.36","version":"13.0.4.0"} 
[Thu Jan 31 15:00:02 2019] [error] [client 216.112.17.10] 
{"reqId":"XFN98tBx2fEAAAtAYJUAAAAL","level":3,"time":"2019-01-31T23:00:02+00:00","remoteAddr":"216.112.17.10","user":"--","app":"PHP","method":"GET","url":"\\/","message":"chmod(): 
Permission denied at 
\\/home\\/jansensandocs\\/docs.jansensan.net\\/lib\\/private\\/Log\\/File.php#137","userAgent":"Mozilla\\/5.0 
(X11; Linux x86_64) AppleWebKit\\/537.36 (KHTML, like Gecko) 
Chrome\\/53.0.2785.143 Safari\\/537.36","version":"13.0.4.0"} 

```

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.  
-m.

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 2:39pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/2 "2019-02-03T14:39:15Z")

</div>

> [@jansensan](#):
>
> \/home\/jansensan\/docs.jansensan.net\/data\/nextcloud.log

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

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 2:41pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/3 "2019-02-03T14:41:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 2:43pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/4 "2019-02-03T14:43:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 2:46pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/5 "2019-02-03T14:46:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 2:49pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/6 "2019-02-03T14:49:29Z")

</div>

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.

```auto
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”.

```

etc.

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.

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 2:53pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/7 "2019-02-03T14:53:18Z")

</div>

> [@jansensan](#):
>
> 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.

Where is your datadirectory? Is it in your docroot?

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 2:57pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/8 "2019-02-03T14:57:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 3:01pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/9 "2019-02-03T15:01:15Z")

</div>

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/

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 3:07pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/10 "2019-02-03T15:07:52Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 3:11pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/11 "2019-02-03T15:11:57Z")

</div>

[http://blog.dreamhosters.com/kbase/index.cgi?area=2526](http://blog.dreamhosters.com/kbase/index.cgi?area=2526)

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 3:15pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/12 "2019-02-03T15:15:54Z")

</div>

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](https://domain123.com) is trying to load files from [https://domainabc.com](https://domainabc.com). But in this case, all files are on the same domain, under the proper install directory.

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 3:17pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/13 "2019-02-03T15:17:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JABAHOSTING](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jabahosting/32/10494_2.png) [@JABAHOSTING](https://help.nextcloud.com/u/JABAHOSTING)\
**Post date:** [February 3, 2019, 3:20pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/14 "2019-02-03T15:20:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 3, 2019, 4:44pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/15 "2019-02-03T16:44:49Z")

</div>

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”](https://docs.jansensan.net/index.php/js/core/merged-template-prepend.js?v=b83073ec-3%E2%80%9D).

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

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 6, 2019, 3:32pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/16 "2019-02-06T15:32:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/6_22734026db12803ebb3e059622ac3534.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [February 12, 2019, 1:35pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/17 "2019-02-12T13:35:23Z")

</div>

> [@jansensan](#):
>
> Content Security Policy:

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…

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [February 26, 2019, 2:23am UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/18 "2019-02-26T02:23:53Z")

</div>

Content Security Policy is something a server app sets when it returns files so that only the same server can load files. As I have not changed this, and as there is no way my host (Dreamhost) has changed that, I can only conclude that the problem comes from NextCloud.

```
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 <script> with source “https://docs.jansensan.net/index.php/js/core/merged-template-prepend.js?v=43bb0505-3”. [login:23:1](https://docs.jansensan.net/index.php/login)

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

```

I have tried upgrading the server, which seemed to work until it gave an error at code integrity check. The errors above are still visible.

At this time, I cannot go through login. Since my only option is to delete everything, I would appreciate some guidance as to how I can backup my calendar _so that I can use it with another service_. I don’t think I am interested in working with this server anymore, too much time invested, too much of a risk to lose important data.

Thanks in advance for any help regarding backing up my calendar.

---

<div class="post-metadata">

**Author:** ![Bernie\_O](https://help.nextcloud.com/user_avatar/help.nextcloud.com/bernie_o/32/40181_2.png) [@Bernie\_O](https://help.nextcloud.com/u/Bernie_O)\
**Post date:** [February 26, 2019, 6:08am UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/19 "2019-02-26T06:08:04Z")

</div>

> [@jansensan](#):
>
> Thanks in advance for any help regarding backing up my calendar.

If you have shell access to your server, you might be able to use my script [calcardbackup](https://help.nextcloud.com/t/calcardbackup-bash-script-to-backup-nextcloud-calendars-and-addressbooks-as-ics-vcf-files/11978) to backup your calendar (this depends on the Operating system of the server).

If you don’t have shell access to this server, but you have shell access to another server (running linux), where you could import a database dump from the broken installation: then you also could backup your calendar with the same script (have a look at the section “does this work with a broken instance” in the README).

---

<div class="post-metadata">

**Author:** ![jansensan](https://help.nextcloud.com/letter_avatar/jansensan/32/6_22734026db12803ebb3e059622ac3534.png) [@jansensan](https://help.nextcloud.com/u/jansensan)\
**Post date:** [April 2, 2019, 10:27pm UTC](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787/20 "2019-04-02T22:27:00Z")

</div>

Thanks for this, I hadn’t seen this answer. I will investigate this.

[Next page](https://help.nextcloud.com/t/loading-failed-for-the-script-with-source-https-index-php-js-core-merged-template-prepend-js/46787.md?page=2)
