Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while Zipping when root folder is read only: No create permission for path #39

Open
szaimen opened this issue Nov 18, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@szaimen
Copy link

szaimen commented Nov 18, 2021

Just tried the app and I got the following issue:

{
  "reqId": "ddnrK6weTbpLI0qMPo7o",
  "level": 3,
  "time": "2021-11-19T00:55:02+01:00",
  "remoteAddr": "",
  "user": "--",
  "app": "files_zip",
  "method": "",
  "url": "--",
  "message": "Failed to create zip archive",
  "userAgent": "--",
  "version": "22.2.3.0",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "No create permission for path",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/files_zip/lib/Service/ZipService.php",
        "line": 92,
        "function": "newFile",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/files_zip/lib/BackgroundJob/ZipJob.php",
        "line": 65,
        "function": "zip",
        "class": "OCA\\FilesZip\\Service\\ZipService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
        "line": 79,
        "function": "run",
        "class": "OCA\\FilesZip\\BackgroundJob\\ZipJob",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/public/BackgroundJob/QueuedJob.php",
        "line": 47,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\Job",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/cron.php",
        "line": 127,
        "function": "execute",
        "class": "OCP\\BackgroundJob\\QueuedJob",
        "type": "->"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Files/Node/Folder.php",
    "Line": 209,
    "CustomMessage": "Failed to create zip archive"
  },
  "id": "6196e81a535c6"
}

It has most likely the same reason why nextcloud/server#25787 happened.

@juliusknorr
Copy link
Member

From the PR:

The thing is that I have actually create permissions in the folder I was trying to create the zip archive in. But the root folder itself is read only on my instance which probably triggered the issue although it should work in the directory I am in...
(see nextcloud/server#25787 where something like this happened to)

@joshtrichards
Copy link
Member

Seems to have been poked at a bit more here:

nextcloud/server#26396

And here:

nextcloud/cms_pico#167

Which seems like a whole it of redundant and extra work just because newFile checks the root/base.

This would seem a clean solution:

nextcloud/server#26396 (comment)

I don't think any changes like this were made but I'll have to return to this later when I have more time:

https://github.com/nextcloud/server/blob/6e41ebcc126a846d3de0c737e62f673a0e4f1b49/lib/private/Files/Node/Folder.php#L179

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants