Update error: Creating backup fails


I am trying to update Nextcloud from version 16.0.3 to 17.0.2 (channel: “stable”).
The updater gets stuck at step “Create backup: Parsing response failed. Step 3 is currently in process. Please reload this page later.”

I can still use my Nextcloud install but just cannot get it updated.

Nextcloud version: 16.0.3.
Operating system and version: Unknown (Hosted)
Apache or nginx version: Unknown (Hosted)
PHP version: 7.2

I tried to follow the steps in other posts (like here or here)

  • manually editing out my config file : ‘maintenance’ => true , to false. --> Did not work, it was already on false.
  • removing the updater-oc** and appdata-oc** directories, inside the data folder. --> I can then restart the update, but it stops at the same step.

I do not have access to my /var/log/ directory. From inside Nextcloud settings, here are some of the logs.

Unable to create file
“touch(): Unable to create file /home/sites/site1/web/nextcloud/data/appdata_ocb5c5u54iap/js/core/merged-template-prepend.js because No such file or directory at /home/sites/site100006107/web/nextcloud/lib/private/Files/Storage/Local.php#207”

I get this message many times with the numbers #143, #207 & #217.

Unable to create directory

OCP\Files\NotPermittedException: Could not create path
    /home/sites/site100006107/web/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php - line 83:
    /home/sites/site100006107/web/nextcloud/lib/private/Template/JSCombiner.php - line 177:
    /home/sites/site100006107/web/nextcloud/lib/private/Template/JSCombiner.php - line 103:
    OC\Template\JSCombiner->cache("/home/sites ... s", "merged-template-prepend.js", OC\Files\Sim ... {})
    /home/sites/site100006107/web/nextcloud/lib/private/Template/JSResourceLocator.php - line 114:
    OC\Template\JSCombiner->process("/home/sites ... d", "core/js/mer ... n", "core")
    /home/sites/site100006107/web/nextcloud/lib/private/Template/JSResourceLocator.php - line 70:
    OC\Template\JSResourceLocator->cacheAndAppendCombineJsonIfExist("/home/sites ... d", "core/js/mer ... n")
    /home/sites/site100006107/web/nextcloud/lib/private/Template/ResourceLocator.php - line 78:
    /home/sites/site100006107/web/nextcloud/lib/private/TemplateLayout.php - line 332:
    OC\Template\ResourceLocator->find([ "core/js/d ... "])
    /home/sites/site100006107/web/nextcloud/lib/private/TemplateLayout.php - line 160:
    OC\TemplateLayout::findJavascriptFiles([ "core/js/d ... "])
    /home/sites/site100006107/web/nextcloud/lib/private/legacy/template.php - line 183:
    OC\TemplateLayout->__construct("error", "")
    /home/sites/site100006107/web/nextcloud/lib/private/Template/Base.php - line 131:
    /home/sites/site100006107/web/nextcloud/lib/private/legacy/template.php - line 332:
    /home/sites/site100006107/web/nextcloud/index.php - line 69:
    OC_Template::printExceptionErrorPage(OCP\Files\No ... {}, 500)
1 Like

So as I see, this is your data directory:
and this you installation directory:

Do you have any access to these filesystems?
And can you check if

Hi hartmut001 and thanks for helping me!

I do not have access to the filesystem other than FTP. I should be able to access everything under the /web directory, though.

The directory /home/sites/site1/web/nextcloud/data/appdata_ocb5c5u54iap/js/core does exist. There are three files in there:

Strange - as I understand the error message, it tries to create a file that is already there (merged-template-prepend.js) and complaines that it doesn’t exist.
Is there a problem with file or directory permissions?

The permissions for the core directory are drwxrws (770).
And all the files inside have -rw-rw (660).

Looks fine to me…


I am facing the same problem with a different outcome. I tried to update from NC to 16.x The updater got stuck at a certain point. I tried it several times within a month until my webGUI wasn’t available at all. It was first laggy (opening slowly and not loading all elements, apps crashed) until only the desktop syncing client worked and finally unavailable . Unfortunately I can’t recall at which step the update got stuck.

Nextcloud version:
Operating system: Debian/Openmediavault (localy hosted)
Nginx version: 4.0.4
PHP Version: 7.0.33
Nextcloud SSD space: 13GB free
Nextcloud data folder: ~300GB free

Current status:

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

{"reqId":"mGSqb8nMYM5lAUM4PjsZ","level":3,"time":"2020-03-16T12:41:06+00:00","remoteAddr":"","user":"--","app":"core","method":"GET","url":"\/","message":{"Exception":"OCP\\Files\\NotPermittedException","Message":"Could not create path","Code":0,"Trace":[{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Files\/SimpleFS\/SimpleFolder.php","line":83,"function":"newFile","class":"OC\\Files\\Node\\Folder","type":"->","args":["merged-template-prepend.js"]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/JSCombiner.php","line":177,"function":"newFile","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->","args":["merged-template-prepend.js"]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/JSCombiner.php","line":103,"function":"cache","class":"OC\\Template\\JSCombiner","type":"->","args":["\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/core\/js","merged-template-prepend.js",{"__class__":"OC\\Files\\SimpleFS\\SimpleFolder"}]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/JSResourceLocator.php","line":114,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3","core\/js\/merged-template-prepend.json","core"]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/JSResourceLocator.php","line":70,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->","args":["\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3","core\/js\/merged-template-prepend.json"]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/ResourceLocator.php","line":78,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->","args":["js\/merged-template-prepend"]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/TemplateLayout.php","line":328,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/de","js\/backgroundjobs","search\/l10n\/de","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates","core\/js\/merged-share-backend"]]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/TemplateLayout.php","line":160,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::","args":[["vendor\/core","js\/merged-template-prepend","search\/js\/search","core\/l10n\/de","js\/backgroundjobs","search\/l10n\/de","search\/js\/searchprovider","js\/jquery-ui-fixes","js\/files\/fileinfo","js\/files\/client","js\/contactsmenu","js\/contactsmenu_templates","core\/js\/merged-share-backend"]]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/legacy\/template.php","line":211,"function":"__construct","class":"OC\\TemplateLayout","type":"->","args":["error",""]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Template\/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/legacy\/template.php","line":360,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/index.php","line":69,"function":"printExceptionErrorPage","class":"OC_Template","type":"::","args":[{"__class__":"OCP\\Files\\NotPermittedException"},500]}],"File":"\/srv\/dev-disk-by-id-ata-TS32GSSD340K_0104932DD5570979003E-part3\/lib\/private\/Files\/Node\/Folder.php","Line":185,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko\/20100101 Firefox\/74.0","version":""}

As @hartmut001 recommended to check the appdata_*/js/core/, the folder contains in my case:
Bildschirmfoto vom 2020-03-16 14-02-35
All files were created in 2018. The permissions for the Nextcloud folders were set to 770 www-data.

Unfortunately the occ maintenance:repair didn’t help.
- Repair MySQL collation
- All tables already have the correct collation -> nothing to do
- Repair mime types
- Clean tags and favorites
- 0 tags of deleted users have been removed.
- 0 tags for delete files have been removed.
- 0 tag entries for deleted tags have been removed.
- 0 tags with no entries have been removed.
- Repair invalid shares
- Remove shares of a users root folder
- Move .step file of updater to backup location
- Fix potential broken mount points
- No mounts updated
- Repair invalid paths in file cache
- Add log rotate job
- Clear frontend caches
- Image cache cleared
- SCSS cache cleared
- JS cache cleared
- Clear every generated avatar on major updates
- Add preview background cleanup job
- Queue a one-time job to cleanup old backups of the updater
- Repair pending cron jobs
- No need to repair pending cron jobs.
- Extract the vcard uid and store it in the db
- Remove potentially over exposing share links
- No need to remove link shares.
- Fix the share type of guest shares when migrating from ownCloud
- Generate unique id on created circle
- Generate unique id on circles
0 [>---------------------------]
- Using shorten unique id instead of circle id
- Cleaning shares database of dead shares
- Fix component of birthday calendars
- 4 birthday calendars updated.
- Fix broken values of calendar objects
0 [>---------------------------]
- Registering building of calendar search index as background job
- Repair step already executed
- Registering background jobs to update cache for webcal calendars
- Added 0 background jobs to update webcal calendars
- Clean up orphan event and contact data
- 0 events without a calendar have been cleaned up
- 0 properties without an events have been cleaned up
- 0 changes without a calendar have been cleaned up
- 0 contacts without an addressbook have been cleaned up
- 0 properties without a contact have been cleaned up
- 0 changes without an addressbook have been cleaned up
- Remove activity entries of private events
- Removed 0 activity entries
- Fix the share type of guest shares when migrating from ownCloud
- Copy the share password into the dedicated column
- Update OAuth token expiration times
- Add background job to check for backup codes

Furthermore I tried these steps cache Issue with JS after a backup of the nextcloud folders. But the logs still produced the same log as listed above.

Any hind or help is mostly appreciated. :slightly_smiling_face:


is very bad stuff…
Is the system really trying to access devicefiles…??? :astonished:
As Linux “experienced” guy I would say this will not work, because the access should go by
but never-ever via devicefiles - this is for OS-Layer only

Thank you for your answer @hartmut001. In Openmediavault (omv) you can create a shared file which is usually located in the /srv/dev-disk-by… directory. With the Nginx plugin (in omv) you can make Nextcloud available to a web service. This way it worked for the last two years.

Further steps I have tried:

    1. run this commands on the nextcloud folder

chown -R www-data:www-data nextcloud
find nextcloud/ -type d -exec chmod 750 {} ;
find nextcloud/ -type f -exec chmod 640 {} ;

Unfortunately I still receive the same error result (logs and web page) as described in the previous post.

    1. switched off nginx and replaced all the Nextcloud files for the manual installation of version 16. It didn’t work because the php version 7.0.33 (I am using) is to old for Nextcloud 16. Since omv is using php, I can not replace it with a newer version. Therefore I decided to stick for now with Nextcloud 15. Php 7.3 will be supported in omv 5 - which is not on a stable release.
    1. Reinstalled manually Nextcloud version 15.0.4. Still receiving the same error log as before.

Further ideas are mostly welcome :slight_smile:

My work around was by setting up a docker with Nextcloud version 18.0.3. After a backup of the database and relevant folder’s (Nextcloud as described in the Nextcloud manuell, I was able to restore all my data as well apps in the docker.

Unfortunately I could not find the root cause of my problem. Nevertheless thank you for your support. :slight_smile:

We are brand new to Nextcloud and I just thought I would share our experience. We have a fresh install of Nextcloud 18.0.4 and we just tried to use the built in update tool to go to 18.0.5. We are also getting a problem at backup time:

X Create Backup
Parsing response failed. 503 Service Unavailable

Service Unavailable

The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Apache/2.4.43 (Debian) Server at cloud.domainname.uk Port 443