vladimiry / ElectronMail

Unofficial ProtonMail Desktop App
GNU General Public License v3.0
1.51k stars 99 forks source link

Error: EPERM: operation not permitted, chown #345

Closed Kyther closed 4 years ago

Kyther commented 4 years ago

This happened just after the snap update yesterday and persists. Electron-Mail popped up an error dialog and I finally force-closed it by killing the process because it kept erroring out. When I tried to restart, I kept getting this error (run in the terminal below for full details):

(node:5986) DeprecationWarning: file property is deprecated and will be removed in v5. [Error: EPERM: operation not permitted, chown '/home/kyther/snap/electron-mail/28/.config/electron-mail/config.json.3298222418'] { errno: -1, code: 'EPERM', syscall: 'chown', path: '/home/kyther/snap/electron-mail/28/.config/electron-mail/config.json.3298222418' } Gtk-Message: 20:47:01.577: GtkDialog mapped without a transient parent. This is discouraged.

At this point my only option is to end the process, as it never pops up the window.

If I run the command by launching with a gui, I get a popup with this:

Unhandled Promise Rejection Error: EPERM: operation not permitted, chown '/home/kyther/snap/electron-mail/28/.config/electron-mail/config.json.1979993125'

My only options are to click "OK" or "Copy Error" - in both cases the dialog vanishes (but leaves a handful of lightweight processes running), and in the second it copies that to the clipboard, obviously.

Every time I attempt launching, it generates another copy of config.json with a seemingly random string of digits after it - and they do not go away when the process is killed. I had a collection of them in my settings folder from trying to start it up. And despite the error telling me to make myself the owner of them, I already am the owner of them. So I have no idea what the error is all about.

Am completely unable to open and use electron-mail due to this, but no idea what the cause is or what I can do to correct it. Am unable to use any other version of this but the snap, unfortunately.

vladimiry commented 4 years ago

Looking into it. The issue seems to be Snap-specific and apparently triggered by removing the following options block https://github.com/vladimiry/ElectronMail/commit/d598edd47c6e8ae5ca3b18aaf2d2173546e8e59c#diff-424bc1869391cb884dc47623c3d96f750bdadc9596cf3f95959a217687b9eb88L158-L159.

it generates another copy of config.json with a seemingly random string of digits after it

This is expected behavior, named atomic file write (writes file to tmp file first and then renames it to the original destination, needed since write operation is not atomic but rename is).

The workaround is to use any other package type, like flatpak. I think the fix will come soon.

joshirio commented 4 years ago

In the meantime, I reverted the release on snap store back to 4.8.0

Please update (downgrade) with sudo snap refresh

vladimiry commented 4 years ago

@Kyther can you (and anyone interested) test the build uploaded here? I just tested this build on my VM-based Ubuntu system and it doesn't suffer from the origin issue (the 4.9.0 did and so I added "bug" label).

You can install it by running snap install --dangerous electron-mail-4.9.1-linux-amd64.snap (remove the installed version first, ie snap remove electron-mail).

joshirio commented 4 years ago

BTW Ubuntu is also affected, so not only other distros.

joshirio commented 4 years ago

@Kyther can you (and anyone interested) test the build uploaded here? I just tested this build on my VM-based Ubuntu system and it doesn't suffer from the origin issue (the 4.9.0 did and so I added "bug" label).

You can install it by running snap install --dangerous electron-mail-4.9.1-linux-amd64.snap (remove the installed version first, ie snap remove electron-mail).

I can confirm this new build is working fine.

vladimiry commented 4 years ago

Thanks. Publishing 4.9.1 release soon then.

vladimiry commented 4 years ago

Fixed in just released v4.9.1. @Kyther thanks for detailed issue.