photos icon indicating copy to clipboard operation
photos copied to clipboard

Internal server error at cloud.nextcloud com

Open rakekniven opened this issue 3 years ago • 1 comments

Describe the bug

Selecting photos app shows internal server error.

To Reproduce Steps to reproduce the behavior:

  1. I opened https://cloud.nextcloud.com/
  2. Logged in
  3. Selected photos app
  4. Internal server error is shown

Expected behavior Photos app should open.

Screenshots Bildschirmfoto 2022-09-24 um 17 43 43

Desktop (please complete the following information):

  • OS: macOS
  • Browser: firefox
  • Version: 104

NC version: 25.0.0 RC 1

Additional context Other users at community chat confirmed error.

rakekniven avatar Sep 24 '22 15:09 rakekniven

Hi, Which section?

skjnldsv avatar Sep 25 '22 14:09 skjnldsv

Hello, what do you mean with section?

I just click at photos: Bildschirmfoto 2022-09-25 um 18 46 48

rakekniven avatar Sep 25 '22 16:09 rakekniven

Log entry with above request_id subz8Hzjsm8u9RaBLlKY:

{
  "reqId": "subz8Hzjsm8u9RaBLlKY",
  "level": 3,
  "time": "2022-09-24T15:43:32+00:00",
  "remoteAddr": "…",
  "user": "…(guest app account)",
  "app": "index",
  "method": "GET",
  "url": "/apps/photos/",
  "message": "No create permission for folder",
  "userAgent": "…",
  "version": "25.0.0.13",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "No create permission for folder",
    "Code": 0,
    "Trace": [
      {
        "function": "newFolder",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->",
        "args": [
          "/Photos"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 72,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "__class__": "OC\\Files\\Node\\Folder"
            },
            "newFolder"
          ],
          [
            "/Photos"
          ]
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/Files/Node/LazyFolder.php",
        "line": 419,
        "function": "__call",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": [
          "newFolder",
          [
            "/Photos"
          ]
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/apps/photos/lib/Service/UserConfigService.php",
        "line": 67,
        "function": "newFolder",
        "class": "OC\\Files\\Node\\LazyFolder",
        "type": "->",
        "args": [
          "/Photos"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/apps/photos/lib/Controller/PageController.php",
        "line": 112,
        "function": "getUserConfig",
        "class": "OCA\\Photos\\Service\\UserConfigService",
        "type": "->",
        "args": [
          "photosLocation"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 225,
        "function": "index",
        "class": "OCA\\Photos\\Controller\\PageController",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 133,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Photos\\Controller\\PageController"
          },
          "index"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/AppFramework/App.php",
        "line": 172,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Photos\\Controller\\PageController"
          },
          "index"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/Route/Router.php",
        "line": 298,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Photos\\Controller\\PageController",
          "index",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          [
            "photos.page.index"
          ]
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/lib/base.php",
        "line": 1047,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/photos/"
        ]
      },
      {
        "file": "/var/www/cloud.nextcloud.com/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/cloud.nextcloud.com/nextcloud/lib/private/Files/Node/Folder.php",
    "Line": 172,
    "CustomMessage": "--"
  }
}

Guest accounts have 0 quota iirc.

nickvergessen avatar Sep 26 '22 03:09 nickvergessen

@skjnldsv We should probably check if the user can create files or folders here: https://github.com/nextcloud/photos/blob/a07c06ff6919ddba691eb1ee110d997127d1975b/lib/Service/UserConfigService.php#L62-L69

Maybe:

if (!$userFolder->nodeExists($value) && $userFolder->isCreatable()) {
	$userFolder->newFolder($value);
}

Then hide upload buttons ?

artonge avatar Sep 26 '22 08:09 artonge

Similar to this I guess: https://github.com/nextcloud/photos/blob/a07c06ff6919ddba691eb1ee110d997127d1975b/lib/Controller/PageController.php#L130-L132

nickvergessen avatar Sep 26 '22 08:09 nickvergessen

Same with NC version: 25.0.0 RC3. Checked seconds ago.

rakekniven avatar Oct 11 '22 07:10 rakekniven

@skjnldsv We should probably check if the user can create files or folders here:

For the upload I would say this is a secondary feature. Maybe I should check the quota before uploading.

In the meantime, I guess we can also expose the quota with an initial state to avoid generating more requests :thinking:

skjnldsv avatar Oct 11 '22 13:10 skjnldsv