-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Unable to delete files on Fedora 28 (gvfs-trash is deprecated) #17452
Comments
Thanks for opening a new issue - is |
Yes, |
Hmmm, not sure why it's not working then - any difference if you specifically set an |
It changes nothing 🤔
|
And if you just use
Also, are you getting the exact same error message you mentioned ("When trying, the following message appears: Is gvfs-trash installed?") after you set the |
The I didn't solve the problem yet, but I am closing this since it is not related to Atom. Sorry for trouble! |
Yeah, that's the default error message. Unfortunately, Electron's moveToTrash method doesn't say why it failed, just that it did. We've found that the most common reason is that |
@Devligue This is a legit bug. The tldr answer is that
How this should probably be fixed... Atom does not have a fallback mechanism like offering the ability to permanently remove a file instead. This would address bring atom in line with gnome's graceful behaviour. The attached image show how Gnome Files (aka Nautilus) prompt the user to permanently delete the file (when trash not supported) Impact: Users with multiple disks and partitions Fedora/Redhat/etc: Impacted due to default partition scheme that separates Ubuntu: Less likely due to partition layout ( Conditions where users will be impacted:
Notes/Testing the Root Cause Note: Though I am confident that my analysis is decent enough, much of the code I was referencing was unfamiliar/new to me. Initially I encountered this issue when I put files in a certain location like the reporter above. I created a delete-me file test as suggested above in the relevant directory,
That's unexpected. The API documentation for g_file_trash lacks some level of specificity.
One might assume (as I did): Given a path, if the user has permission to modify/delete the file, then GIO's g_file_trash API should succeed at removing the file in some manner. Perhaps, if trash functionality is not available, then there might be a fallback mechanism. In the case of Glib appears to implement GIO local file access using glocalfile.c. The trash algorithm looks like this:
At the end of the function we find
I confirmed my understanding by creating a top level trash folder and using gio trash command.
Files located on the same partition as your home directory can always be moved to your user trash folder. On my operating system, the paths
But when mounting disks (external or internal) using fstab or mount commands (as opposed to session-based mounting) issues can arise. I tested a FAT file system with umask=0000 and uid/gid set to root.
You can see gio trash going through the motions. The operations succeeds but the command still reports an error.
GLib/Gio will not write to a trash directory with incorrect permissions/ownership. (Security?) Without unix permissions, trash will always fail on these mount points. Modifying fstab to appear similar to options used during session mounts (UID/GID set to user vs root, umask is set appropriately). Conveniently the source code has a comment that seems to strongly imply this is a known/expected.
Most of this was unnecessary, but I figured I'd show my work. |
I got the same problem on feodra 29 on a fresh install can we reopen this bug ? |
@Devligue can reopen this |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
I may have no additional information about the issue, but I am sure @cutephoton provided enough insight. There are also other people who have similar unsolved problems. I am reopening this. |
I got no problem with the flatpak version by the way |
I reproduced on the latest version still. shrug I don't see how flatpak and rpm/deb would differ. It only fails when the preconditions listed above are met -- a partition where you don't have permission to create a trash folder under your user ID. |
With flatpak i got no error but it don't get delete sorry about this misinformation. I try to disable selinux it don't change. |
No. Not selinux. It has to do with how trash folders work. My rather verbose explanation gets in to the nitty gritty for where atom's behavior is deficient. The short answer is that atom only asks to move files to trash and does not delete files. If a trash folder cannot be created (multiple causes all related to permissions) than it fails. Atom should inquire with user if they should permanently delete the files instead of failing. |
As @yodatak also mentioned that Fedora 29 fresh install has this problem since logout and login or or
|
Gio operates the same way. I used the Gio command line to manually step through this... |
running fedora 29, i have installed atom from packages, since recently I faced the same error as described here.
I think this bug deserves an action in order to improve the package installation, or the runtime, to detect gio/gvfs and make this work out of the box. This really is an ugly bug for the end user experience. |
Is there any workaround to delete files with Atom on Fedora 29? |
This is not working on fedora 29, even with gio installed and ELECTRON_TRASH variable set to gio. |
There are no workarounds. |
Works on my Fedora 29 -- had to restart terminal and restart atom from that terminal. |
BTW for anyone on Fedora who wants an easy "fix": The flatpak version of Atom works fine… 😃 |
Installing the flatpak version worked for me as well (Fedora 29). It is a solution, although installing via flatpak means giving up CLI tools. |
I would direct people to actually read the bug report before commenting. Somebody please lock down this issue. |
You can expose them, so they spawn outside of the flatpak. See https://github.com/rugk/atom-flatpak-wrapper/. Anyway, this is getting off-topic. @cutephoton See no reason for a lock here. The issue is not really fixed or so… or Fedora has to fix it (then one needs to notify them), whatever… |
There are already better workarounds which do not permanently delete files. |
@cldtech and @Arcesilas your comments were deleted as a violation of the Atom Code of Conduct as they were insulting or derogatory. |
Atom is using an electron API to move items to the trash, this API used to default to We're planning to upgrade to Electron v3 very soon (WIP PR), so this issue will get resolved quite soon. |
Prerequisites
Description
My issue is the same as in #15949 except it is not fixed.
I am unable to delete file (or directory). When trying, the following message appears:
Is gvfs-trash installed?
Steps to Reproduce
Expected behavior: Deleting file should delete file
Actual behavior: The file is not deleted
Reproduces how often: Every time
Versions
Additional Information
The
gio trash
is supposedly implemented since electron 1.7.2 and for some folks out there this problem was fixed withAtom 1.25
(which included upgrade toElectron 1.7.11
) but apparently I am on even newer Atom version, with even newer Electron and it still happens.EDIT1
More insight on the problem provided by @cutephoton:
EDIT2
More insight, to not get confused as of the nature of the bug, and how to reproduce it (by @cutephoton as well):
The text was updated successfully, but these errors were encountered: