8000 [rclone v1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 · Issue #7103 · rclone/rclone · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[rclone v1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 #7103

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

Closed
mpsd opened this issue Jul 1, 2023 · 53 comments · Fixed by #7108
Closed

[rclone v1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 #7103

mpsd opened this issue Jul 1, 2023 · 53 comments · Fixed by #7108

Comments

@mpsd
Copy link
mpsd commented Jul 1, 2023

Thank you for developing rclone!

What is the problem you are having with rclone?

After upgrading from version 1.62.2 to 1.63.0 the use of Nextcloud remote dumps with
2023/07/01 12:43:26 Failed to create file system for "***my-remotename***": chunked upload with nextcloud must use /dav/files/USER endpoint not /webdav

I use already that hinted endpoint (/dav/files/USER), have tried to delete and add the remote via rclone config again and from scratch and got the same error.

My rclone config entry is
Editing existing "my-remotename" remote with options:

  • type: webdav
  • url: https://my webservice url/remote.php/dav/files/my-username/Directory
  • vendor: nextcloud
  • pass: *** ENCRYPTED ***
  • user: my-username

What is your rclone version (output from rclone version)

rclone v1.63.0

  • os/version: debian 11.7 (64 bit)
  • os/kernel: 6.1.0-0.deb11.7-amd64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.20.5
  • go/linking: static
  • go/tags: none

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

Debian Linux 11.7

Which cloud storage system are you using? (e.g. Google Drive)

Nextcloud v27 (worked with v1.62.2 / doesn't work with 1.63.0)

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

All rclone commands like ls or copyetc.

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

rclone -vv ls "***my-remotename***":
2023/07/01 12:56:23 DEBUG : rclone: Version "v1.63.0" starting with parameters ["rclone" "-vv" "ls" "***my-remotename***:"]
2023/07/01 12:56:23 DEBUG : Creating backend with remote "***my-remotename***:"
2023/07/01 12:56:23 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/01 12:56:23 DEBUG : found headers:
2023/07/01 12:56:23 Failed to create file system for "***my-remotename***:": chunked upload with nextcloud must use /dav/files/USER endpoint not /webdav

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.
@mpsd mpsd changed the title remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 [1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 Jul 1, 2023
@mpsd mpsd changed the title [1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 [rclone v1.63.0] remote Nextcloud not working after upgrade from 1.62.2 to 1.63.0 Jul 1, 2023
@darthShadow
Copy link
Member

This looks like a bug in the regex by not allowing any directory after the username:

var validateNextCloudChunkedURL = regexp.MustCompile(`^.*/dav/files/[^/]+/?$`)

Can you try the following:

  • Change the url to https://my webservice url/remote.php/dav/files/my-username
  • Change the remote in the commands to ***my-remotename***:Directory

That should probably work.

@mpsd
Copy link
Author
mpsd commented Jul 1, 2023

Thanks for the quick reply.

Yes, by using the endpoint without a remote directory in the service-URL it works (as you described above).

Since I'm using rclone as part of multiple usecases (incl. restic backup) I have the respective remotes configured with the directory in the URL...

Is the fix above considered to be a short term workaround and will the regex be fixed to allow for directories in the URL again in one of the next rclone updates? (would save me from updating all the configs on several machines ;-)

@darthShadow
Copy link
Member

I don't use WebDAV or NextCloud personally so I am not sure whether that regex is an accident or is as expected.

@devnoname120 / @ncw will know better.

@ncw
Copy link
Member
ncw commented Jul 1, 2023

I tried relaxing the regexp checking the URL - please give this a go @mpsd

v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked on branch fix-7103-nextcloud-chunked (uploaded in 15-30 mins)

@devnoname120 @tcoupin you both had a hand in the development of the nextcloud chunking - does this seem sensible?

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 1, 2023

@ncw I haven't checked yet the possible ramifications in the current implementation of allowing to specify a directory in the WebDAV url.

Questions:

  1. Does WebDAV actually support more finer-grained permissions than the user-level?
    1.1. If not, is there a strong point to support and maintain this use case?
    1.2. Should we instead consider having some kind of subview remote type at the rclone level instead?

  2. How does rclone approach this in other remotes? E.g. FTP, SCP, etc.

@mpsd
Copy link
Author
mpsd commented Jul 1, 2023

@ncw I tested the v1.64.0 beta form your links above and confirm: It is working as it has worked up to 1.62.2 (with a Directory given in the webdav URL). So this would fix my initial bug.

@devnoname120 my use cases are less driven by permission considerations but more of "can't delete other data than in my current use case" by simply not seeing this data from the other use cases (or in other words: I can't accidently wipe all data below root directory since I have not mapped root). I would prefer to continue to have this "line of defense" in the one time setting up the remote config but to have it in mind in every time I write or adjust a shell script or a one time shell command.

Thank you again for looking into this and helping me.

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 1, 2023

@mpsd Do you use rclone mount? If this is the case you can just directly specify the path with rclone mount remote:path/to/files X:.

If you use direct commands such as rclone copy, then I would advise against using this as a "line of defense" because the way that rclone interprets path operators .. and . may well change in the future.

Overall, unless there is a WebDAV-specific behavior with subpaths (such as authentication, etc.) then I don't think that it should be in the scope of backends to handle this properly. Depending on what we choose though, we may want to at least throw a warning explaining the reason why the URL is rejected.

What do you think?

@ncw
Copy link
Member
ncw commented Jul 1, 2023

I tested the v1.64.0 beta form your links above and confirm: It is working as it has worked up to 1.62.2 (with a Directory given in the webdav URL). So this would fix my initial bug.

Great.

Are you happy with this fix 705572d @devnoname120 ?

I've seen this usage before with webdav that people put subdirectories on the URL.

@devnoname120 wrote

Questions:

  1. Does WebDAV actually support more finer-grained permissions than the user-level?

It does I believe but rclone doesn't know about them.

1.1. If not, is there a strong point to support and maintain this use case?

Users are using it, so we should try not to break backwards compatibility!

1.2. Should we instead consider having some kind of subview remote type at the rclone level instead?

Yes, see the alias backend.

  1. How does rclone approach this in other remotes? E.g. FTP, SCP, etc.

The ftp and sftp backends don't allow this as they are configured with a host name rather than a URL. However the http backend does. A lot of the other backends allow this by setting the root_folder_id to a folder of the users choice also (eg drive).

If you use direct commands such as rclone copy, then I would advise against using this as a "line of defense" because the way that rclone interprets path operators .. and . may well change in the future.

Rclone is reasonably careful not to let .. escape up out of the configured remote. There was an issue about that some time ago that I remember fixing!

Overall, unless there is a WebDAV-specific behavior with subpaths (such as authentication, etc.) then I don't think that it should be in the scope of backends to handle this properly. Depending on what we choose though, we may want to at least throw a warning explaining the reason why the URL is rejected.

What do you think?

I think that if it works OK we should allow it as it is currently in use and we try very hard not to break backwards compat!

@devnoname120
Copy link
Contributor

@ncw Do chunked uploads still complete successfully when a path is specified in the WebDAV URL?

@ncw
Copy link
Member
ncw commented Jul 2, 2023

@mpsd can you try a chunked upload easily?

@mpsd
8000
Copy link
Author
mpsd commented Jul 2, 2023

Hi both, yes I can confirm, having a chunked remote based on a nextcloud with dirpath in the URL works with 1.64 beta with fix 7103.

Tested it with chunk size 2M on against Nextcloud v27 and works with both: using my-nextcloud-remote with and without additional dirpath.

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 2, 2023

@mpsd Did you use a chunker remote on top of the nextcloud remote? Or did you try to send a large file just with the nextcloud remote alone which triggered a transparent internal chunking + merge?

@mpsd
Copy link
Author
mpsd commented Jul 2, 2023

@devnoname120 I used chunker on top, wasn't sure which filesize would trigger the internal chunking + merge. Happy to repeat for this internal chunking with a big file. Pls let me know.

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 2, 2023

@mpsd

  1. Make sure that the Option vendor setting of your nextcloud remote is correctly set to Nextcloud.
  2. Edit the advanced config to change nextcloud_chunk_size to 10M.
  3. Upload a big file (e.g. 1 GB) using rclone -vvv copy mybigfile.mp4 super-nextcloud:/ (don't use the chunker remote at all).
  4. Paste the output here.

Thanks

@mpsd
Copy link
Author
mpsd commented Jul 2, 2023

@devnoname120 Here we go - internal chunking + merge does NOT work with url incl. dirpath / works with url without dirpath. Remote nextcloud configured as give per your advice (chunk_size: 10M). Both debug messages here:

1.64 beta with dirpath in nextcloud remote - NOT SUCESSFUL

2023/07/02 15:02:05 DEBUG : rclone: Version "v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked" starting with parameters ["rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64/rclone" "-vvv" "copy" "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64/rclone" "my-remote:"]
2023/07/02 15:02:05 DEBUG : Creating backend with remote "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64/rclone"
2023/07/02 15:02:05 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/02 15:02:05 DEBUG : fs cache: adding new entry for parent of "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64/rclone", "/tmp/rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64"
2023/07/02 15:02:05 DEBUG : Creating backend with remote "my-remote:"
2023/07/02 15:02:05 DEBUG : found headers:
2023/07/02 15:02:05 NOTICE: Chunks temporary upload directory: https://my-webdomain/remote.php/dav/uploads/my-username/rclone-w-path/
2023/07/02 15:02:06 DEBUG : rclone: Need to transfer - File not found at Destination
2023/07/02 15:02:06 DEBUG : rclone: Update will use the chunked upload strategy
2023/07/02 15:02:06 ERROR : rclone: Failed to copy: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 ERROR : Attempt 1/3 failed with 1 errors and: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 DEBUG : rclone: Need to transfer - File not found at Destination
2023/07/02 15:02:06 DEBUG : rclone: Update will use the chunked upload strategy
2023/07/02 15:02:06 ERROR : rclone: Failed to copy: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 ERROR : Attempt 2/3 failed with 1 errors and: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 DEBUG : rclone: Need to transfer - File not found at Destination
2023/07/02 15:02:06 DEBUG : rclone: Update will use the chunked upload strategy
2023/07/02 15:02:06 ERROR : rclone: Failed to copy: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 ERROR : Attempt 3/3 failed with 1 errors and: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict
2023/07/02 15:02:06 INFO :
Transferred: 0 B / 0 B, -, 0 B/s, ETA -
Errors: 1 (retrying may help)
Elapsed time: 0.7s

2023/07/02 15:02:06 DEBUG : 7 go routines active
2023/07/02 15:02:06 Failed to copy: chunked upload couldn't purge upload directory: Sabre\DAV\Exception\Conflict: 409 Conflict

1.64 beta without dirpath in nextcloud remote - SUCESSFUL

2023/07/02 15:05:27 DEBUG : rclone: Version "v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked" starting with parameters ["rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64/rclone" "-vvv" "copy" "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip" "my-remote:/rclone-w-path/"]
2023/07/02 15:05:27 DEBUG : Creating backend with remote "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip"
2023/07/02 15:05:27 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/02 15:05:27 DEBUG : fs cache: adding new entry for parent of "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip", "/tmp"
2023/07/02 15:05:27 DEBUG : Creating backend with remote "my-remote:/rclone-w-path/"
2023/07/02 15:05:27 DEBUG : found headers:
2023/07/02 15:05:27 NOTICE: Chunks temporary upload directory: https://my-webdomain/remote.php/dav/uploads/my-username/
2023/07/02 15:05:27 DEBUG : fs cache: renaming cache item "my-remote:/rclone-w-path/" to be canonical "my-remote:rclone-w-path"
2023/07/02 15:05:27 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Need to transfer - File not found at Destination
2023/07/02 15:05:27 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Update will use the chunked upload strategy
2023/07/02 15:05:33 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: sha1 = afb7d8f00072c57db577d0a423ae9535d9d90d18 OK
2023/07/02 15:05:33 INFO : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Copied (new)
2023/07/02 15:05:33 INFO :
Transferred: 17.138 MiB / 17.138 MiB, 100%, 2.856 MiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 6.6s

2023/07/02 15:05:33 DEBUG : 7 go routines active

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 2, 2023

@mpsd Hmmm I see. Looks like we need to remove the additional path when building the temporary chunks upload directory.

@mpsd
Copy link
Author
mpsd commented Jul 2, 2023

@devnoname120 just cross-tested with v1.62.2 which works with a dirpath in nextcloud url - maybe this is helpful:

2023/07/02 15:29:56 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone-v1.62.2-linux-amd64/rclone" "-vvv" "copy" "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip" "my-remotename:"]
2023/07/02 15:29:56 DEBUG : Creating backend with remote "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip"
2023/07/02 15:29:56 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/02 15:29:56 DEBUG : fs cache: adding new entry for parent of "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip", "/tmp"
2023/07/02 15:29:56 DEBUG : Creating backend with remote "my-remotename:"
2023/07/02 15:29:56 DEBUG : found headers:
2023/07/02 15:29:56 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Need to transfer - File not found at Destination
2023/07/02 15:30:01 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: sha1 = afb7d8f00072c57db577d0a423ae9535d9d90d18 OK
2023/07/02 15:30:01 INFO : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Copied (new)
2023/07/02 15:30:01 INFO :
Transferred: 17.138 MiB / 17.138 MiB, 100%, 3.199 MiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 5.7s

2023/07/02 15:30:01 DEBUG : 5 go routines active

devnoname120 added a commit to devnoname120/rclone that referenced this issue Jul 2, 2023
…error

Fix rclone#7103

Before this change the RegExp validating the endpoint URL was a bit
too strict allowing only /dav/files/USER due to chunking limitations.

This patch adds back support for /dav/files/USER/dir/subdir etc.

Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>
@devnoname120
Copy link
Contributor
devnoname120 commented Jul 2, 2023

@mpsd Could you try this? #7108

Here is a download link to the compiled executable for linux/amd64:
rclone-bc0042e0e414ccc6f00b79b20111293312b44b5b-linux-amd64.zip

@mpsd
Copy link
Author
mpsd commented Jul 2, 2023

@devnoname120 perfect! works! Tested with chunked upload (filesize > 10M) and without (filesize < 10M). Both worked successful.

Here is for completeness the debug output for the filesize > 10M:
2023/07/02 18:54:51 DEBUG : rclone: Version "v1.64.0-DEV" starting with parameters ["./rclone" "-vvv" "copy" "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip" "my-remotename:"]
2023/07/02 18:54:51 DEBUG : Creating backend with remote "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip"
2023/07/02 18:54:51 DEBUG : Using config file from "/root/.config/rclone/rclone.conf"
2023/07/02 18:54:51 DEBUG : fs cache: adding new entry for parent of "rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip", "/tmp"
2023/07/02 18:54:51 DEBUG : Creating backend with remote "my-remotename:"
2023/07/02 18:54:51 DEBUG : found headers:
2023/07/02 18:54:51 NOTICE: Chunks temporary upload directory: https://my-domainname/remote.php/dav/uploads/my-username/
2023/07/02 18:54:51 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Need to transfer - File not found at Destination
2023/07/02 18:54:51 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Update will use the chunked upload strategy
2023/07/02 18:54:57 DEBUG : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: sha1 = afb7d8f00072c57db577d0a423ae9535d9d90d18 OK
2023/07/02 18:54:57 INFO : rclone-v1.64.0-beta.7121.705572d40.fix-7103-nextcloud-chunked-linux-amd64.zip: Copied (new)
2023/07/02 18:54:57 INFO :
Transferred: 17.138 MiB / 17.138 MiB, 100%, 2.856 MiB/s, ETA 0s
Transferred: 1 / 1, 100%
Elapsed time: 6.3s

2023/07/02 18:54:57 DEBUG : 7 go routines active

@ncw ncw closed this as completed in #7108 Jul 5, 2023
ncw added a commit that referenced this issue Jul 5, 2023
…error

Fix #7103

Before this change the RegExp validating the endpoint URL was a bit
too strict allowing only /dav/files/USER due to chunking limitations.

This patch adds back support for /dav/files/USER/dir/subdir etc.

Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>
@ncw
Copy link
Member
ncw commented Jul 5, 2023

I've merged this to master now which means it will be in the latest beta in 15-30 minutes and released in v1.63.1

@mpsd If you could do one more test on the beta v1.64.0-beta.7129.b4c7b240d when it is uploaded that would be very helpful.

I'll merge this to the stable branch when it looks ok to you.

@darix
Copy link
Contributor
6D40 darix commented Jul 7, 2023

because I want the minimal patches to fix our opensuse package.

i mean in doubt I will do git diff v1.63.0..HEAD > fix-nextcloud-chunked.patch and edit out the version bump. but not sure if you would classify all changes in master as stable already.

@darix
Copy link
Contributor
darix commented Jul 7, 2023

This is now a snapshot package based on the master branch

rclone version
rclone v1.63.0+git17.528e22f13

This config was working until 1.63.0. I notice the URL differs from mpsd's config dump. but tbh if this would require migration in the url field then the error message is not very helpful and should guide the user to a proper solution.

Something along the lines:

Please check the url field in your config for the #{sectionname}. It points to the old format of '/remote.php/webdav` and should be '/remote.php/dav/files/#{username}/`

The current error makes it look like a code bug.

rclone config show nc
[nc]
type = webdav
url = https://myhostname/remote.php/webdav/
vendor = nextcloud
user = darix
pass = *** ENCRYPTED ***
rclone -vvv copy somefile nc:/Transfer/
2023/07/07 13:31:45 DEBUG : rclone: Version "v1.63.0+git17.528e22f13" starting with parameters ["rclone" "-vvv" "copy" "somefile" "nc:/Transfer/"]
2023/07/07 13:31:45 DEBUG : Creating backend with remote "somefile"
2023/07/07 13:31:45 DEBUG : Using config file from "${HOME}/.config/rclone/rclone.conf"
2023/07/07 13:31:45 DEBUG : fs cache: adding new entry for parent of "somefile", "${HOME}/Downloads"
2023/07/07 13:31:45 DEBUG : Creating backend with remote "nc:/Transfer/"
2023/07/07 13:31:45 DEBUG : found headers: 
2023/07/07 13:31:45 Failed to create file system for "nc:/Transfer/": the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav

With the change to the url field in the config the current code works. but as i said some more guidance for the user might be good.

@darix
Copy link
Contributor
darix commented Jul 7, 2023

I went with

"the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USERNAME endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME"

Fix on the way to the distribution https://build.opensuse.org/request/show/1097518

@ncw
Copy link
Member
ncw commented Jul 8, 2023

Note that the v1.63-stable branch contains the patches which will go into v1.63.1

I will release v1.63.1 very soon

@devnoname120
Copy link
Contributor

@darix Could you upstream your patch? By creating a pull request there. 🙂

@darix
Copy link
Contributor
darix commented Jul 9, 2023

done²

@Dual-0
Copy link
Dual-0 commented Jul 21, 2023

I use rclone to access a shared nextcloud folder via webdav. This is not working with 1.63.1.

error: Failed to create file system for "nextcloud:": the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME

config:

[nextcloud]
type = webdav
url = https://cloud.domain.tld/public.php/webdav
vendor = nextcloud
user = xxxx
pass = xxxx
nextcloud_chunk_size = 128Mi

rclone version:

rclone v1.63.1
- os/version: ubuntu 22.04 (64 bit)
- os/kernel: 6.1.11-meson64 (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.20.6
- go/linking: static

@darix
Copy link
Contributor
darix commented Jul 21, 2023

as the error message tells you ... your URL needs to not end in /webdav. With this in mind look at your config.

@Dual-0
Copy link
Dual-0 commented Jul 21, 2023

as described in nextcloud docs to accessing public shares over WebDAV the URL must be https://example.com/nextcloud/public.php/webdav

@darix
Copy link
Contributor
darix commented Jul 21, 2023

then you need to set the chunksize to 0. according to the comments the /webdav endpoint does not implement chunking.

@Drakonas
Copy link

as described in nextcloud docs to accessing public shares over WebDAV the URL must be https://example.com/nextcloud/public.php/webdav

You're misreading the docs. That is talking about accessing Public shares. As in publicly shared files from Nextcloud's share feature.

Look further down on that page:
accessing-files-using-winscp (with webdav)

It needs to be https://**mydomain.com**/remote.php/dav/files/**my-username**

@Drakonas
Copy link
Drakonas commented Jul 31, 2023

On another note, I'm still having trouble with Nextcloud with the current beta.

Edit: apparently this is currently due to the Music app holding a lock on folders preventing deletion. Disable/remove the Music app for the time being.

From the local machine before move:

user@debian:/mnt/extHDD/Backups/XB$ rclone lsd nextcloud:/XB
2023/07/31 14:44:45 NOTICE: Chunks temporary upload directory: https://mydomain.com/remote.php/dav/uploads/my-username/
          -1 2023-07-31 14:16:05        -1 Backups
          -1 2023-07-31 13:25:31        -1 MO2
          -1 2023-07-31 14:16:05        -1 Skyrim`
user@debian:/mnt/extHDD/Backups/XB$ rclone move nextcloud:/XB/Backups nextcloud:/XB/Skyrim
2023/07/31 14:50:59 NOTICE: Chunks temporary upload directory: https://mydomain.com/remote.php/dav/uploads/my-username/
2023/07/31 14:50:59 NOTICE: Chunks temporary upload directory: https://mydomain.com/remote.php/dav/uploads/my-username/
user@debian:/mnt/extHDD/Backups/XB$ rclone lsd nextcloud:/XB
2023/07/31 14:51:03 NOTICE: Chunks temporary upload directory: https://mydomain.com/remote.php/dav/uploads/my-username/
          -1 2023-07-31 14:16:05        -1 Backups
          -1 2023-07-31 13:25:31        -1 MO2
          -1 2023-07-31 14:16:05        -1 Skyrim

As you can see... it didn't move the folder. The files are also untouched on the backend. Let's try moving them on the backend:

root@nas-server[/mnt/blah/nextcloud/my-username/files/XB]# ls -l
total 114
drwxrwx---+ 2 nextcld  nextcld  8 Jul 31 11:16 Backups
drwxrwx---+ 5 nextcld  nextcld  5 Jul 31 10:24 MO2
drwxrwx---+ 2 nextcld  nextcld  2 Jul 31 11:16 Skyrim
root@nas-server[/mnt/blah/nextcloud/my-username/files/XB]# mv Backups Skyrim
root@nas-server[/mnt/blah/nextcloud/my-username/files/XB]# ls -l
total 65
drwxrwx---+ 5 nextcld  nextcld  5 Jul 31 10:24 MO2
drwxrwx---+ 3 nextcld  nextcld  3 Jul 31 11:45 Skyrim
root@nas-server[/mnt/blah/nextcloud/my-username/files/XB]# ls -l Skyrim
total 49
drwxrwx---+ 2 nextcld  nextcld  8 Jul 31 11:16 Backups

Alright, they moved successfully and kept permissions. Let's try checking the directory contents using webdav from the local machine again:

user@debian:/mnt/extHDD/Backups/XB$ rclone lsd nextcloud:/XB
2023/07/31 14:51:03 NOTICE: Chunks temporary upload directory: https://mydomain.com/remote.php/dav/uploads/my-username/
          -1 2023-07-31 14:16:05        -1 Backups
          -1 2023-07-31 13:25:31        -1 MO2
          -1 2023-07-31 14:16:05        -1 Skyrim

rclone still sees the directory as unchanged.

I am able to upload new files just fine. Moving files inside the remote seems to not affect anything.

This error was in the Nextcloud logs:

Sabre\DAV\Exception\BadRequest: Expected filesize of 4293918720 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 886562816 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.

Attempting to delete from Nextcloud fails.

TypeError: OC\Files\Cache\QuerySearchHelper::getCachesAndMountPointsForSearch(): Argument #1 ($root) must be of type OC\Files\Node\Root, OC\Files\Node\LazyRoot given, called in /snap/nextcloud/35878/htdocs/lib/private/Files/Node/Folder.php on line 237

Edit: apparently this is currently due to the Music app holding a lock on folders preventing deletion. Disable/remove the Music app for the time being.

@devnoname120
Copy link
Contributor
devnoname120 commented Jul 31, 2023

@Drakonas You are not supposed to manually mess up with the filesystem where NextCloud stores the user files. If you do that, then the filesystem cache of NextCloud doesn't match the actual filesystem.

See here for a fix: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#file-operations

With regard to the rclone move command at the start, could you retry it but with a sane filesystem cache? Your previous experiments may have left it in a bad state.

@Drakonas
Copy link
Drakonas commented Jul 31, 2023

@Drakonas You are not supposed to manually mess up with the filesystem where NextCloud stores the user files. If you do that, then the filesystem cache of NextCloud doesn't match the actual filesystem.

See here for a fix: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html#file-operations

With regard to the rclone move command at the start, could you retry it but with a sane filesystem cache? Your previous experiments may have left it in a bad state.

I see. Understood. I wondered if that was the case. That is unfortunate. I'll make sure to do all operations over webdav then.

I also figured out the issue... Apparently the Music app currently prevents folders from being deleted due to a bug.

Also, can confirm... after doing files:scan and files:cleanup, move commands work fine with the latest beta. It found 0 errors, proably because I moved the data back to match what was in the cache before continuing. Apologies for the false alarm.

onny added a commit to onny/nixpkgs that referenced this issue Aug 1, 2023
Starting with Rclone v1.63, which is used in the Nextcloud tests for
synchronization, the client relies on the correct WebDAV endpoint url,
see rclone/rclone#7103
@inDane
Copy link
inDane commented Oct 12, 2023

this is still a thing, right? rclone 1.64
./rclone sync --webdav-url=https://my-nxcl.com/public.php/webdav/ --webdav-user=abc --webdav-vendor=nextcloud --webdav-pass="$(rclone obscure 'test1231!')" --progress :webdav: ./test/

2023/10/12 14:36:12 Failed to create file system for ":webdav:": the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME

But when i use webdav-vendor=owncloud it works, yet, the webdav is actually a nextcloud v25.

in rclone 1.53.3 (ubuntu repo) it does still work with webdav-vendor=nextcloud.

Am i missing something?

@devnoname120
Copy link
Contributor

@inDane Is your URL a public share? The /webdav endpoint is supposed to be for public shares.

@ncw In general we may want to just disable chunked uploads if the URL isn't what we want + writing warning in the console instead of throwing an error entirely. What do you think?

@inDane
Copy link
inDane commented Oct 13, 2023

@devnoname120 yes, it is a public share!

@ncw
Copy link
Member
ncw commented Oct 13, 2023

@devnoname120

In general we may want to just disable chunked uploads if the URL isn't what we want + writing warning in the console instead of throwing an error entirely. What do you think?

That sounds like a good plan to me.

@GottZ
Copy link
GottZ commented Oct 19, 2023

@darix wrote:

then you need to set the chunksize to 0. according to the comments the /webdav endpoint does not implement chunking.

please add that to the docs over at https://rclone.org/webdav/ or even better, make it a default if it's using /webdav..

this new self-terminating "feature" is literally breaking existing rclone configurations world wide that relied on read-only or small file usage, so yes.. it would be wise, if it would not terminate by default.

in my case, I actually can't access /dav/files/USERNAME over at https://drive.shadow.tech/ and also can't do a thing about it.

defaults should always reflect a functional state or at least notify about required changes.

I'm running this successfully now:

# rclone config redacted shadowdrive
[shadowdrive]
type = webdav
url = https://drive.shadow.tech/remote.php/webdav
vendor = nextcloud
user = XXX
pass = XXX
nextcloud_chunk_size = 0

@devnoname120
Copy link
Contributor
devnoname120 commented Oct 20, 2023 via email

@markusHaferkamp
Copy link
markusHaferkamp commented Jul 30, 2024

I feel like I'm encountering a related error on restic v1.67 -- I recently migrated from v1.60 after my cloud provider updated their Nextcloud version, and now my config has become non-functional. I did have to change the URL from the previous remote.php/webdav/ to the new format.

rclone -vv ls my-remotename is working just fine.

Directly mounting through rclone (for restic, in the form of restic --repo rclone:my_remotename:path/to/folder) fails with this thread's popular error:

Failed to create file system for "my_remotename:path/to/folder": the remote url looks incorrect. Note that nextcloud chunked uploads require you to use the /dav/files/USER endpoint instead of /webdav. Please check 'rclone config show remotename' to verify that the url field ends in /dav/files/USERNAME

This error persists with both rclone.conf workarounds nextcloud_chunk_size = 0 as well as vendor = owncloud.

I'd love any advice on workarounds on how to directly mount folders; searching the forums has only led me here.


rclone.conf

[my_remotename]
type = webdav
url = https://cloud.provider.tld/remote.php/dav/files/my_username
vendor = nextcloud
user = my_username
pass = ...

rclone v1.67.0

  • os/version: ubuntu 23.10 (64 bit)
  • os/kernel: 6.5.0-44-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.22.4
  • go/linking: static
  • go/tags: none

@ncw
Copy link
Member
ncw commented Jul 30, 2024

@markusHaferkamp put nextcloud_chunk_size = 0 in your config - that should definitely fix it.

Note that you misspelled it as nexctcloud_chunk_size = 0 above.

@markusHaferkamp
Copy link
markusHaferkamp commented Jul 30, 2024

Thank you! That was sadly a typo I made when creating the GitHub post, the error persists even with the correctly-typed nextcloud_chunk_size = 0.

Cf.
[my-hostname]
type = webdav
url = https://cloud.provider.tld/remote.php/dav/files/my_username
vendor = nextcloud
user = my_username
pass = *** ENCRYPTED ***
nextcloud_chunk_size = 0

@ncw
Copy link
Member
ncw commented Jul 30, 2024

@markusHaferkamp when I try your config with rclone v1.67.0 I get this

2024/07/30 11:51:29 NOTICE: Chunked uploads are disabled because nextcloud_chunk_size is set to 0

This means the code that makes the error was never called and that is the only place it is called.

If you aren't seeing that then there is something wrong, like you aren't running the version of rclone you think you are or you are using the wrong config or something like that.

@markusHaferkamp
Copy link
markusHaferkamp commented Jul 30, 2024

@ncw Well, amn't I the idiot! You're right: Restic runs with root privileges, and has its own rclone.conf. Miraculously, both "old URL + chunks disabled" and "new URL" works now as intended!

restic backup is now slow as molasses, but I'm assuming that's restic's fault rather than rclone's.

edit.
Nope, that's actually on either rclone or my provider's side. rclone -vv ls my_hostname only works every 25 seconds for a few bytes. Guess it's finally time to make a call. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants
0