Error adding attachment #9

Closed
opened 2024-12-30 10:04:06 +00:00 by kemitix · 2 comments
Owner

Error adding attachment /var/folders/0y/3lxyqsyd7gn7vywhmzkz50840000gq/T/.tmpogR2X0/670ac3997967b17d1d2a0908/image.png to card: {"status":500,"message":"Internal server error: Please contact the
server administrator if this error reappears multiple times, please include the request ID "5QURHdMhk9XSjgKq0GIF" below in your report.","requestId":"5QURHdMhk9XSjgKq0GIF"}

  • attachment doesn't get added to card
  • actor doesn't complete properly, causing program to not exit
> Error adding attachment /var/folders/0y/3lxyqsyd7gn7vywhmzkz50840000gq/T/.tmpogR2X0/670ac3997967b17d1d2a0908/image.png to card: {"status":500,"message":"Internal server error: Please contact the server administrator if this error reappears multiple times, please include the request ID \"5QURHdMhk9XSjgKq0GIF\" below in your report.","requestId":"5QURHdMhk9XSjgKq0GIF"} - attachment doesn't get added to card - actor doesn't complete properly, causing program to not exit
kemitix added the
Kind/Bug
label 2024-12-30 10:04:06 +00:00
Author
Owner

ssh dagon docker exec nextcloud-aio-nextcloud grep K8WuSQiI1chFUkgdJgyV data/nextcloud.log | jq | pbcopy

{
  "reqId": "K8WuSQiI1chFUkgdJgyV",
  "level": 3,
  "time": "2024-12-31T07:22:38+00:00",
  "remoteAddr": "192.168.7.9",
  "user": "pcampbell",
  "app": "deck",
  "method": "POST",
  "url": "/index.php/apps/deck/api/v1.0/boards/22/stacks/264/cards/17222/attachments",
  "message": "Exception thrown: OCP\\Files\\NotPermittedException",
  "userAgent": "--",
  "version": "30.0.4.1",
  "exception": {
    "Exception": "OCP\\Files\\NotPermittedException",
    "Message": "Could not create path \"/pcampbell/files/Deck/image (6).png\"",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/custom_apps/deck/lib/Service/FilesAppService.php",
        "line": 188,
        "function": "newFile",
        "class": "OC\\Files\\Node\\Folder",
        "type": "->",
        "args": [
          "image (6).png"
        ]
      },
      {
        "file": "/var/www/html/custom_apps/deck/lib/Service/AttachmentService.php",
        "line": 195,
        "function": "create",
        "class": "OCA\\Deck\\Service\\FilesAppService",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/custom_apps/deck/lib/Controller/AttachmentApiController.php",
        "line": 56,
        "function": "create",
        "class": "OCA\\Deck\\Service\\AttachmentService",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 208,
        "function": "create",
        "class": "OCA\\Deck\\Controller\\AttachmentApiController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 114,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Deck\\Controller\\AttachmentApiController"
          },
          "create"
        ]
      },
      {
        "file": "/var/www/html/lib/private/AppFramework/App.php",
        "line": 161,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\Deck\\Controller\\AttachmentApiController"
          },
          "create"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\Deck\\Controller\\AttachmentApiController",
          "create",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "apiVersion": "1.0",
            "boardId": "22",
            "stackId": "264",
            "cardId": "*** sensitive parameters replaced ***",
            "_route": "deck.attachment_api.create"
          }
        ]
      },
      {
        "file": "/var/www/html/lib/base.php",
        "line": 1003,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/deck/api/v1.0/boards/22/stacks/264/cards/17222/attachments"
        ]
      },
      {
        "file": "/var/www/html/index.php",
        "line": 24,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/html/lib/private/Files/Node/Folder.php",
    "Line": 172,
    "CustomMessage": "Exception thrown: OCP\\Files\\NotPermittedException"
  }
}
`ssh dagon docker exec nextcloud-aio-nextcloud grep K8WuSQiI1chFUkgdJgyV data/nextcloud.log | jq | pbcopy` ```json { "reqId": "K8WuSQiI1chFUkgdJgyV", "level": 3, "time": "2024-12-31T07:22:38+00:00", "remoteAddr": "192.168.7.9", "user": "pcampbell", "app": "deck", "method": "POST", "url": "/index.php/apps/deck/api/v1.0/boards/22/stacks/264/cards/17222/attachments", "message": "Exception thrown: OCP\\Files\\NotPermittedException", "userAgent": "--", "version": "30.0.4.1", "exception": { "Exception": "OCP\\Files\\NotPermittedException", "Message": "Could not create path \"/pcampbell/files/Deck/image (6).png\"", "Code": 0, "Trace": [ { "file": "/var/www/html/custom_apps/deck/lib/Service/FilesAppService.php", "line": 188, "function": "newFile", "class": "OC\\Files\\Node\\Folder", "type": "->", "args": [ "image (6).png" ] }, { "file": "/var/www/html/custom_apps/deck/lib/Service/AttachmentService.php", "line": 195, "function": "create", "class": "OCA\\Deck\\Service\\FilesAppService", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/custom_apps/deck/lib/Controller/AttachmentApiController.php", "line": 56, "function": "create", "class": "OCA\\Deck\\Service\\AttachmentService", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 208, "function": "create", "class": "OCA\\Deck\\Controller\\AttachmentApiController", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/lib/private/AppFramework/Http/Dispatcher.php", "line": 114, "function": "executeController", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\Deck\\Controller\\AttachmentApiController" }, "create" ] }, { "file": "/var/www/html/lib/private/AppFramework/App.php", "line": 161, "function": "dispatch", "class": "OC\\AppFramework\\Http\\Dispatcher", "type": "->", "args": [ { "__class__": "OCA\\Deck\\Controller\\AttachmentApiController" }, "create" ] }, { "file": "/var/www/html/lib/private/Route/Router.php", "line": 302, "function": "main", "class": "OC\\AppFramework\\App", "type": "::", "args": [ "OCA\\Deck\\Controller\\AttachmentApiController", "create", { "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer" }, { "apiVersion": "1.0", "boardId": "22", "stackId": "264", "cardId": "*** sensitive parameters replaced ***", "_route": "deck.attachment_api.create" } ] }, { "file": "/var/www/html/lib/base.php", "line": 1003, "function": "match", "class": "OC\\Route\\Router", "type": "->", "args": [ "/apps/deck/api/v1.0/boards/22/stacks/264/cards/17222/attachments" ] }, { "file": "/var/www/html/index.php", "line": 24, "function": "handleRequest", "class": "OC", "type": "::", "args": [] } ], "File": "/var/www/html/lib/private/Files/Node/Folder.php", "Line": 172, "CustomMessage": "Exception thrown: OCP\\Files\\NotPermittedException" } } ```
Author
Owner

The NotPermittedException could be caused by attempting to create two files in parallel with the same name. The Deck application doesn't attempt to put the files into any subdirectory or make them unique other than by doing an initial check for existence then adding, or incrementing a (1) suffix. This doesn't work when two files with the same name are being added at the same time.

Need to either find a way to dictate what the uploaded filename would be, or use a single instance of an upload attachment actor to avoid these clashes.

The `NotPermittedException` could be caused by attempting to create two files in parallel with the same name. The Deck application doesn't attempt to put the files into any subdirectory or make them unique other than by doing an initial check for existence then adding, or incrementing a `(1)` suffix. This doesn't work when two files with the same name are being added at the same time. Need to either find a way to dictate what the uploaded filename would be, or use a single instance of an upload attachment actor to avoid these clashes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kemitix/trello-to-deck#9
No description provided.