Skip to content
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

mount: make rename fall back to copy then delete (was unable to move files in mounted hubic) #1965

Closed
thammi opened this issue Jan 7, 2018 · 7 comments

Comments

@thammi
Copy link

thammi commented Jan 7, 2018

I mounted a hubic remote target and tried to move a file:

$ mv blub bla
mv: cannot move 'blub' to 'bla': Input/output error

My rclone command (rclone mount -vv hubic_open:default ~/mnt/) displayed the following error:

2018/01/07 20:06:10 DEBUG : /: Lookup: name="bla"
2018/01/07 20:06:10 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2018/01/07 20:06:10 DEBUG : /: Lookup: name="blub"
2018/01/07 20:06:10 DEBUG : /: >Lookup: node=blub, err=<nil>
2018/01/07 20:06:10 DEBUG : blub: Attr: 
2018/01/07 20:06:10 DEBUG : blub: >Attr: a=valid=1m0s ino=0 size=4 mode=-rw-r--r--, err=<nil>
2018/01/07 20:06:10 DEBUG : /: Lookup: name="bla"
2018/01/07 20:06:10 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2018/01/07 20:06:10 DEBUG : /: Lookup: name="bla"
2018/01/07 20:06:10 DEBUG : /: >Lookup: node=<nil>, err=no such file or directory
2018/01/07 20:06:10 DEBUG : /: Rename: oldName="blub", newName="bla", newDir=/
2018/01/07 20:06:10 ERROR : blub: Dir.Rename error: Fs "Hubic Swift container default" can't rename files (no Move)
2018/01/07 20:06:10 DEBUG : /: >Rename: err=Fs "Hubic Swift container default" can't rename files (no Move)

I am using rclone v1.37 on Debian 9.2 amd64. This limitation is not mentioned in the online documentation. Renaming inside mounts works using Dropbox.

Having this feature on hubic would be very useful to me. I am actually trying to rename inside an encrypted storage based on the hubic target, so renaming using the webinterface is very hard.

@ncw ncw added this to the v1.40 milestone Jan 7, 2018
@ncw
Copy link
Member

ncw commented Jan 7, 2018

openstack swift and hence hubic doesn't actually have a server side move.

It does have a server side copy though. If you use rclone move to move things it will do a server side copy followed by a delete.

It looks like I thought of implementing this in rclone mount but didn't yet.

I'll re-purpose this ticket to implement that.

In the mean time you can use rclone move to do it which isn't quite as convenient - sorry!

@ncw ncw changed the title Unable to move files in mounted hubic mount: make rename fall back to copy then delete (was unable to move files in mounted hubic) Jan 7, 2018
@thammi
Copy link
Author

thammi commented Jan 10, 2018

I tried using rclone move but ran into #515.

@ncw
Copy link
Member

ncw commented Jan 10, 2018

I tried using rclone move but ran into #515.

That is unfortunate :-( I'd love to get some help with that or this issue if you've got the time!

@seonghobae
Copy link

I hope this someday. I'm using the Rstudio server on the mounted Swift device, but Rstudio cannot save the working image, that works with the rename.

@ncw ncw modified the milestones: v1.40, v1.41 Mar 19, 2018
@ncw ncw modified the milestones: v1.41, v1.42 Apr 28, 2018
@ncw ncw added the IMPORTANT label May 17, 2018
@ncw ncw modified the milestones: v1.42, v1.43 Jun 17, 2018
@ncw ncw modified the milestones: v1.43, v1.44 Sep 2, 2018
ncw added a commit that referenced this issue Sep 20, 2018
Before this change remotes without server side Move (eg swift, s3,
gcs) would not be able to rename files.

After it means nearly all remotes will be able to rename files on
rclone mount with the notable exceptions of b2 and yandex.

This changes checks to see if the remote can do Move or Copy then
calls `operations.Move` to do the actual move.  This will do a server
side Move or Copy but won't download and re-upload the file.

It also checks to see if the destination exists first which avoids
conflicts or duplicates.

Fixes #1965
Fixes #2569
@ncw
Copy link
Member

ncw commented Sep 20, 2018

I have attempted to fix this here

https://beta.rclone.org/branch/v1.43-096-ga9fc86f5-fix-2569-mount-move-beta/ (uploaded in 15-30 mins)

Feedback welcome :-)

@cheesefinger
Copy link

I have attempted to fix this here

https://beta.rclone.org/branch/v1.43-096-ga9fc86f5-fix-2569-mount-move-beta/ (uploaded in 15-30 mins)

Feedback welcome :-)

This is working for me. Thanks.

@ncw ncw closed this as completed in 59e14c2 Sep 29, 2018
@ncw
Copy link
Member

ncw commented Sep 29, 2018

I've merged this fix to master now, it will be in the latest beta in 15-30 mins an in v1.44.

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

No branches or pull requests

4 participants