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

Edit with temporary file upload on save does not work with missing directory permissions #8757

Closed
cyberduck opened this issue Apr 22, 2015 · 8 comments

Comments

@cyberduck
Copy link
Collaborator

@cyberduck cyberduck commented Apr 22, 2015

3ade434 created the issue

Over SFTP, if I edit a file that I have write permission on, but do not have write permission on the file's directory, when I try to save, I get an upload failed message, "Permission denied. Please contact your web hosting service provider for assistance." I sometimes get the message when just opening the file.

As well, saving or opening the file changes the owner of the file to me.

This behavior suggests that Cyberduck is removing the file and uploading a new one, instead of editing the existing file.

Log drawer for opening and saving a file:

263 OPENDIR
264 READDIR
265 READDIR
266 CLOSE
267 OPEN
268 READ
269 READ
270 CLOSE
271 OPENDIR
272 READDIR
273 READDIR
274 CLOSE
275 OPEN
@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 22, 2015

@dkocher commented

This most possibly caused by the use of a temporary file to replace the edited file after upload only when the transfer is complete. Refer to Disable upload of temporary file on save.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 22, 2015

3ade434 commented

Changing the hidden configuration option did fix it for me.

However, I'm sure other people will have this problem and won't be able to find the solution. I was only able to figure out what was happening because I had the ability to adjust the directory permissions and see the effect. Why does it ever upload a temp file on save? If there is a need for it, perhaps it should try to upload the temp file and if it doesn't work, revert to the other behavior. I think leaving things as-is will frustrate users.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 23, 2015

@dkocher commented

Replying to [comment:4 lkmorlan]:

Changing the hidden configuration option did fix it for me.
Thanks for the confirmation.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 23, 2015

@dkocher commented

We have this enabled by default as a safeguard procedure for data loss when editing a file and the upload on save would be incomplete because of an I/O failure.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 23, 2015

3ade434 commented

I understand.

I notice that even when I was not able to save the file, I could still upload a file of the same name and tell it to overwrite the existing file. So that must not use the temp file. I don't know the details of how to protocol works, but it seems to me that uploading and saving should work the same way.

Another idea: What if you tried to make the temp file in /tmp? Most users have write access to that.

Using rsync might be a good idea for updating files.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Apr 23, 2015

@dkocher commented

Replying to [comment:8 lkmorlan]:

I understand.

I notice that even when I was not able to save the file, I could still upload a file of the same name and tell it to overwrite the existing file. So that must not use the temp file. I don't know the details of how to protocol works, but it seems to me that uploading and saving should work the same way.

The use of a temporary filename for uploads is not enabled by default. Refer to Transfers → General → Uploads → Upload with temporary filename.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Aug 26, 2015

@dkocher commented

#8982 closed as duplicate.

Loading

@cyberduck
Copy link
Collaborator Author

@cyberduck cyberduck commented Jan 21, 2016

@dkocher commented

In 19085. The setting in Transfers → General → Uploads → Upload with temporary filename is disabled by default and now used for uploads from editors as well.

Loading

@cyberduck cyberduck closed this Jan 21, 2016
@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants