floccus icon indicating copy to clipboard operation
floccus copied to clipboard

E019: HTTP status 423. Failed PUT request.

Open wildcart opened this issue 6 years ago • 12 comments

Describe the bug floccus 'in' Firefox fails to sync my bookmarks when restricting floccus to sync a specific "server folder" (/work in this case) in the floccus configuration. If I clear the "server folder" floccus syncs the bookmarks as expected. The client side error I get is the similar to the error reported in #699 except that I am getting an HTTP 423 instead of HTTP 403 (see below).

I first noticed this behaviour late last week, I think (not sure which version of floccus I was using at this time). Before this floccus successfully sync bookmarks with my nextcloud for about a year and a half.

In vivaldi, floccus 4.3.0 successfully syncs my bookmarks when the "server folder" is set. I've already deleted the floccus configuration in Firefox, deleted all bookmarks both server side and client side but it doesn't make a difference. I've also created a new nextcloud user and created a new floccus configuration for this user without success.

To Reproduce

  1. Create a "nextcloud folder" account in floccus
  2. Setup a "server folder" to restrict which bookmarks are synced
  3. Click "sync now"

Expected behavior The sync finishes successfully

Observed behavior The sync fails with "E019: HTTP status 423. Failed PUT request. Check your server configuration and log."

floccus debug log

2020-10-28T19:57:11.948Z Starting sync process for account <account>
2020-10-28T19:57:12.148Z onSyncStart: begin
2020-10-28T19:57:12.148Z https://<domain>/<nc-path>remote.php/webdav/.floccus-L3dvcms=.lock
2020-10-28T19:57:13.058Z https://<domain>/<nc-path>remote.php/webdav/.floccus-L3dvcms=.lock
2020-10-28T19:57:13.483Z Syncing failed with E019: HTTP status 423. Failed PUT request. Check your server configuration and log.

Server log This is only an excerpt from the full log removing the "Trace" information

..."app":"no app in context","method":"GET","url":"/<nc-path>/remote.php/webdav/.floccus-L3dvcms=.lock","message":{"Exception":"OC\\Authentication\\Exceptions\\InvalidTokenException","Message":"Token does not exist"...

..."app":"no app in context","method":"GET","url":"/<nc-path>/remote.php/webdav/.floccus-L3dvcms=.lock","message":"Deprecated event type for {\"[object] (OCP\\SabrePluginEvent)\"...

..."app":"webdav","method":"GET","url":"/<nc-path>/remote.php/webdav/.floccus-L3dvcms=.lock","message":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"File with name .floccus-L3dvcms=.lock could not be located"...

..."app":"no app in context","method":"GET","url":"/<nc-path>/remote.php/webdav/.floccus-L3dvcms=.lock","message":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"bookmarks.web_view.index\" as such route does not exist."...

Desktop (please complete the following information):

  • OS: openSUSE Leap 15.2
  • Browser Firefox
  • Browser Version 78.4.0esr
  • Floccus version: 4.4.3
  • Floccus sync method: nextcloud folders Server (please complete the following information):
  • OS: Hosted
  • Nextcloud version: 20.0.1 (also tested with 18.0.4 before upgrading)
  • Bookmarks app version: 4.0.3 (also tried with 3.0.4 before nextcloud upgrade)

wildcart avatar Oct 28 '20 20:10 wildcart

Have you tried this fix? https://github.com/marcelklehr/floccus/issues/699#issuecomment-714595080

marcelklehr avatar Oct 28 '20 20:10 marcelklehr

I was using username/password authentication until I re-created the floccus configuration and it stopped working sometime last week (or so). That's probably why I skipped the comment you're referencing.

I'll try "enable File System Access on the Token" later today and let you know. Is this a nextcloud setting?

wildcart avatar Oct 29 '20 11:10 wildcart

If you're not using nextcloud flow for authenticating floccus, then this won't fix things for you, I'm afraid. If you do, you should be able to select the apps for which you want to grant access to floccus. In that dialog, select bookmarks and files.

marcelklehr avatar Oct 29 '20 12:10 marcelklehr

i cant seem to get mine working again, tried w/ app password and real password: image

image

errolsancaktar avatar Oct 29 '20 17:10 errolsancaktar

I initially configured floccus to connect to my nexctcloud using username and password and used the 'nextcloud flow' when I re-created the floccus configuration, both are not working if a "server folder" is specified in the configuration. If I clear this field both authentication methods work fine.

I've verified that "Allow filesystem access" is enabled for floccus but it doesn't fix the problem. image

wildcart avatar Oct 29 '20 18:10 wildcart

HTTP 423 means the file is locked for some reason. Do you have any file locking apps installed?

marcelklehr avatar Oct 29 '20 19:10 marcelklehr

Not that I know, at least none of the plugin/app names suggest this feature.

Do you have any idea why this only happens if I specify a "server folder" in the floccus configuration? Is there anything else that I can provide to help you figure out what's going on?

wildcart avatar Oct 29 '20 19:10 wildcart

It seems that the locking functionality as it is implemented now was a bad idea, I'll remove it with the next patch, which should solve this issue as well.

marcelklehr avatar Nov 03 '20 20:11 marcelklehr

Patch is out for firefox.

marcelklehr avatar Nov 04 '20 14:11 marcelklehr

I'm not sure if this is a good place to contribute my two cents, but perhaps it helps. I was getting HTTP 423 codes as well and Floccus 4.8.2 was hanging indefinitely while trying to sync with Nextcloud 21 and later 22. While peeking at the SQL tables I noticed that the column oc_bookmarks_root_folders.locked was set to 0 for all users except the one encountering problems, for whom the value was 1. My fix was update oc_bookmarks_root_folders set locked = 0, after which syncing resumed normally.

So I guess that's how the Nextcloud Bookmarks app implements locking. And probably at some point something unusual happened, perhaps the user closed the browser during the sync, which left the lock on.

On a related note, I feel that syncing became slow because the user's 2,300 bookmarks (already a considerable amount) got blown up to over 18,000 due to duplication. I believe that when Floccus is installed using the same Nextcloud account on two browsers with existing bookmarks, and when those bookmark sets contain some identical hierarchies like A/B/C/, then C begins to multiply server-side. In my case the user had 2,300 entries in the oc_bookmarks table, but over 18,000 entries in the oc_bookmarks_tree table. I will try to fiddle with this and file a proper issue.

That was three hours well spent. :-)

CatalinFrancu avatar Oct 07 '21 22:10 CatalinFrancu

My fix was update oc_bookmarks_root_folders set locked = 0, after which syncing resumed normally.

Floccus should override the lock after waiting half an hour for it. :/

I will try to fiddle with this and file a proper issue.

That would be great! Thanks

marcelklehr avatar Oct 08 '21 10:10 marcelklehr

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 20 '23 15:03 github-actions[bot]