memories icon indicating copy to clipboard operation
memories copied to clipboard

Error when archiving files from face cluster

Open illnesse opened this issue 3 years ago • 1 comments

I selected a dozen images from a face cluster and clicked archive, error below pops up. Works on second try w/o error I'm using redis for locking, not sure why that file would be locked though.

{
   "reqId":"OfKANzaKJeIha72hLKQn",
   "level":3,
   "time":"2022-10-26T15:58:01+00:00",
   "remoteAddr":"192.168.2.204",
   "user":"root",
   "app":"index",
   "method":"PATCH",
   "url":"/apps/memories/api/archive/4497062",
   "message":"\"NAS/.archive/testdir/Archiv\" is locked, existing lock on file: 4 shared locks",
   "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
   "version":"25.0.0.18",
   "exception":{
      "Exception":"OCP\\Lock\\LockedException",
      "Message":"\"NAS/.archive/testdir/Archiv\" is locked, existing lock on file: 4 shared locks",
      "Code":0,
      "Trace":[
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":1170,
            "function":"changeLock",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/View.php",
            "line":270,
            "function":"basicOperation",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php",
            "line":164,
            "function":"mkdir",
            "class":"OC\\Files\\View",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/apps/memories/lib/Controller/ApiController.php",
            "line":566,
            "function":"newFolder",
            "class":"OC\\Files\\Node\\Folder",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line":225,
            "function":"archive",
            "class":"OCA\\Memories\\Controller\\ApiController",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
            "line":133,
            "function":"executeController",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/AppFramework/App.php",
            "line":172,
            "function":"dispatch",
            "class":"OC\\AppFramework\\Http\\Dispatcher",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/lib/private/Route/Router.php",
            "line":298,
            "function":"main",
            "class":"OC\\AppFramework\\App",
            "type":"::"
         },
         {
            "file":"/var/www/nextcloud/lib/base.php",
            "line":1047,
            "function":"match",
            "class":"OC\\Route\\Router",
            "type":"->"
         },
         {
            "file":"/var/www/nextcloud/index.php",
            "line":36,
            "function":"handleRequest",
            "class":"OC",
            "type":"::"
         }
      ],
      "File":"/var/www/nextcloud/lib/private/Files/View.php",
      "Line":2012,
      "Previous":{
         "Exception":"OCP\\Lock\\LockedException",
         "Message":"\"files/31f663ee5d002317cdf6d0b882eb47da\" is locked, existing lock on file: 4 shared locks",
         "Code":0,
         "Trace":[
            {
               "file":"/var/www/nextcloud/lib/private/Files/Storage/Common.php",
               "line":827,
               "function":"changeLock",
               "class":"OC\\Lock\\MemcacheLockingProvider",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/Files/View.php",
               "line":2006,
               "function":"changeLock",
               "class":"OC\\Files\\Storage\\Common",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/Files/View.php",
               "line":1170,
               "function":"changeLock",
               "class":"OC\\Files\\View",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/Files/View.php",
               "line":270,
               "function":"basicOperation",
               "class":"OC\\Files\\View",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php",
               "line":164,
               "function":"mkdir",
               "class":"OC\\Files\\View",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/apps/memories/lib/Controller/ApiController.php",
               "line":566,
               "function":"newFolder",
               "class":"OC\\Files\\Node\\Folder",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":225,
               "function":"archive",
               "class":"OCA\\Memories\\Controller\\ApiController",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
               "line":133,
               "function":"executeController",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/AppFramework/App.php",
               "line":172,
               "function":"dispatch",
               "class":"OC\\AppFramework\\Http\\Dispatcher",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/lib/private/Route/Router.php",
               "line":298,
               "function":"main",
               "class":"OC\\AppFramework\\App",
               "type":"::"
            },
            {
               "file":"/var/www/nextcloud/lib/base.php",
               "line":1047,
               "function":"match",
               "class":"OC\\Route\\Router",
               "type":"->"
            },
            {
               "file":"/var/www/nextcloud/index.php",
               "line":36,
               "function":"handleRequest",
               "class":"OC",
               "type":"::"
            }
         ],
         "File":"/var/www/nextcloud/lib/private/Lock/MemcacheLockingProvider.php",
         "Line":109
      },
      "CustomMessage":"--"
   }
}

illnesse avatar Oct 26 '22 16:10 illnesse

I saw this a couple of times too. Not sure what's going on here.

pulsejet avatar Oct 26 '22 17:10 pulsejet

I'm having the same issue but when archiving from the folders view or the timeline (I guess anywhere).

llucax avatar Mar 18 '23 20:03 llucax

As a workaround, I can move images to the .archive folder from the Files app without any issues, it is just annoying that I can use the much more convenient (one click) shortcut in the Memories app.

llucax avatar Mar 18 '23 20:03 llucax

Did you try rebooting the server?

pulsejet avatar Mar 18 '23 20:03 pulsejet

Hi @pulsejet! No, I didn't. Why doing that should help?

In any case, I tried again and now I'm not getting those errors. At first I thought it was when moving multiple files, but I just tried that again with a few files and it worked too. It is very strange, and since it's not deterministic, I guess it might be a race. My server is sporadically under high load, which I guess could trigger races more easily.

llucax avatar Mar 18 '23 21:03 llucax

Locking gets tricky under load. Are you using Redis?

pulsejet avatar Mar 18 '23 21:03 pulsejet

Yes.

llucax avatar Mar 18 '23 22:03 llucax

Wouldn't want to revive a dead thread, but I also get issues about shared locks and it also says that .archive folder cannot be updated

ZeroKun265 avatar Nov 13 '23 16:11 ZeroKun265

@ZeroKun265 the fix isn't released yet, it's still on master.

pulsejet avatar Nov 13 '23 16:11 pulsejet

Wow that was quick Thanks

ZeroKun265 avatar Nov 13 '23 16:11 ZeroKun265