[SOLVED] Upgrade to 18.0.2.2 error Could not create path

I updated my server using the web portal to do the update. I did not see any errors.

Here is my log trace:

https://pastebin.com/AyyG4dUU

I had updated the code on the page to spit out the file that it was trying to create.

“url”: “/index.php/login”,
“message”: {
“Exception”: “OCP\Files\NotPermittedException”,
“Message”: “Could not create path /appdata_oc1njr7k29sp/js/core/merged-template-prepend.js”,
“Code”: 0,
“Trace”: [

It seems like the path is not set correctly and it is trying to create the file on the root file system. Does anyone know why this could be happening?

I had a similar issue so hopefully this will help. I upgraded to 18.0.3 from 17 and got this when trying to open various apps (partial trace below):

"app": "index",
"method": "GET",
"url": "/index.php/apps/tasks/",
"message": {
"Exception": "OCP\\Files\\NotPermittedException",
"Message": "Could not create path",
"Code": 0,
"Trace": [
  {
    "file": "/var/www/html/lib/private/Files/SimpleFS/SimpleFolder.php",
    "line": 84,
    "function": "newFile",
    "class": "OC\\Files\\Node\\Folder",
    "type": "->",
    "args": [
      "c9fc-28e4-tasks.css"
    ]
  },
  {
    "file": "/var/www/html/lib/private/Template/SCSSCacher.php",
    "line": 312,
    "function": "newFile",
    "class": "OC\\Files\\SimpleFS\\SimpleFolder",
    "type": "->",
    "args": [
      "c9fc-28e4-tasks.css"
    ]
  },
  {
    "file": "/var/www/html/lib/private/Template/SCSSCacher.php",
    "line": 182,
    "function": "cache",
    "class": "OC\\Template\\SCSSCacher",
    "type": "->",
    "args": [
      "/var/www/html/custom_apps/tasks/css",
      "c9fc-28e4-tasks.css",
      "tasks.scss",
      {
        "__class__": "OC\\Files\\SimpleFS\\SimpleFolder"
      },
      "/custom_apps/tasks/css"
    ]
  },

I solved it by running php occ files:scan-app-data while logged in as user www-data.

Your stack trace look a bit different so I don’t know if it’s specific to an app or something else. I had also previously run the following commands, which might be worth trying as well:

php occ files:scan;
php occ files:cleanup;

Good luck!

Thanks for the suggestions. I tried all the commands. Unfortunately, it did not solve my problem, but the command: scan-app-data returned the following error:

sudo -u www-data php occ files:scan-app-data

Scanning AppData for files
Path not found: /appdata_oc1njr7k29sp

I now have something new to try and chase down.

Much appreciated!

With the latest find, thanks to ajmayer. I found this thread.

I tried to delete the instance to see if it would create a new folder.

Like so…

sudo -u www-data php occ config:system:delete oc1njr7k29sp

System config value oc1njr7k29sp deleted

I then re-ran

sudo -u www-data php occ files:scan-app-data

Scanning AppData for files
Path not found: /appdata_oc1njr7k29sp

So it seems it did not delete the instance and create a new one.

To add additional info.

Nextcloud is running fine and I can still sync files. I just can not log into the web UI.
My database is on an external server.

Here is an on my issue. I found that the instanceid is now in the config.php file and not the database. So what I did was just add an x to instanceid that was already set.

Once that was updated, I ran the command for scan-app-data.

sudo -u www-data php occ files:scan-app-data

The error was the same. Rechecking my config.php for the datadirectory path I wanted to see if an appdata directory existed. Of course, there was nothing there. I created a new appdata directory named like so…

appdata_myinstanceidx

The folder was created under the datadirectory path. Verified and set the correct permissions for the folder. I re-ran scan-app-data, and it said it was found! I fired up the web browser and low and behold it now loads, and I can log in.

On a side note, my nextcloud has updated a few times since I started looking at this issue and is now on version 18.0.4.2

1 Like

I’m running Nextcloud 17 in a Docker on Unraid and was getting a similar “Could not create path” error when trying to log into the UI and @jrivera’s “scan-app-data” suggestion got me going in the right direction, ultimately landing on the following run from within the Docker container (I have no idea why my user is “abc”):
sudo -u abc -s /bin/bash -c "php7 /config/www/nextcloud/occ files:scan-app-data"