Caprine: "Error: EPERM: operation not permitted, chown" with Caprine 2.37.0 from Snap on Ubuntu

Created on 22 Aug 2019  Â·  18Comments  Â·  Source: sindresorhus/caprine

A JavaScript error occurred in the main process
Uncaught Exception:
Error: EPERM: operation not permitted, chown '/home/tim/snap/caprine/28/.config/Caprine/config.json.3051011808'
    at Object.chownSync (fs.js:1104:3)
    at Function.writeFileSync [as sync] (/snap/caprine/28/resources/app.asar/node_modules/conf/node_modules/write-file-atomic/index.js:196:27)
    at ElectronStore.set store [as store] (/snap/caprine/28/resources/app.asar/node_modules/conf/index.js:277:19)
    at ElectronStore.set (/snap/caprine/28/resources/app.asar/node_modules/conf/index.js:152:14)
    at updateVibrancySetting (/snap/caprine/28/resources/app.asar/dist-js/config.js:155:15)
    at migrate (/snap/caprine/28/resources/app.asar/dist-js/config.js:165:5)
    at Object.<anonymous> (/snap/caprine/28/resources/app.asar/dist-js/config.js:168:1)
    at Module._compile (internal/modules/cjs/loader.js:786:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
    at Module.load (internal/modules/cjs/loader.js:645:32)

Looks like https://github.com/sindresorhus/caprine/issues/1032 is back. 2.36.0 is not affected so the workaround is 'snap revert caprine'

Most helpful comment

Yeah this looks fixed since v2.38.0, cheers @sindresorhus!

All 18 comments

The same for me

This is unfortunately blocked by https://github.com/npm/write-file-atomic/pull/51. This is really Snap's fault as they don't support a common method (chown).

Same here. For anyone that cannot revert to the previous version like me can use the AppImage until the problem is fixed.

Same issue on Solus via Snap.

same

Hey guys, I've just solved it
I've downloaded the latest version (2.37)
and the trick was to REMOVE the config.json file :)
rm ~/.config/Caprine/config.json
OR
chgrp $USER ~/.config/Caprine/config.json

@Remyks snap version of Caprine strores its files in ~/snap/caprine/current/.config/Caprine, not in ~/.config/Caprine/. I tried your solution by removing the file from the directory in ~/snap, but it didn't solved the problem - it recreates the file and causes EPERM error anyway. Are you sure it solves the problem? Am I doing something wrong?

I don't know, for me it worked, I installed it on archlinux with an AUR helper (yay), I downloaded the pkgbuild and updated it (to download the latest version, the pgkbuild file was outdated)
I removed the file (but saw that the group's file was "1001", so I changed it too, and it worked)

I don't know if you're doing wrong..
Try to directly change owner, and group of the file recursively (there should be a -R option with chown and chgrp) ?

That sounds like you're not using a snap package at all @Remyks — this is specifically an issue with the snap package.

Hmm .. do not know, but the issue is EXACTLY the same, I've just done : "sudo chgrp 1001 .config/Caprine/config.json" and this is what I get :

A JavaScript error occurred in the main process
Uncaught Exception:
Error: EPERM: operation not permitted, chown '/home/skymer/.config/Caprine/config.json.2941600533'
at Object.chownSync (fs.js:1104:3)
at Function.writeFileSync [as sync] (/usr/lib/caprine/node_modules/conf/node_modules/write-file-atomic/index.js:196:27)
at ElectronStore.set store [as store] (/usr/lib/caprine/node_modules/conf/index.js:277:19)
at ElectronStore.set (/usr/lib/caprine/node_modules/conf/index.js:152:14)
at updateVibrancySetting (/usr/lib/caprine/dist-js/config.js:155:15)
at migrate (/usr/lib/caprine/dist-js/config.js:165:5)
at Object. (/usr/lib/caprine/dist-js/config.js:168:1)
at Module._compile (internal/modules/cjs/loader.js:786:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:798:10)
at Module.load (internal/modules/cjs/loader.js:645:32)

What is the output if you do "ls -l" on the config file ?

PS : My bad, I didn't read the title "From snap on ubuntu"

Maybe, could you try chmod a+r Caprine/config.json (don't know the exact path of config.json, but you have just to replace it) ?

snap revert caprine to the version 2.36 solves the problem only partially. When you suspend your device, Caprine 2.36 crashes.

(caprine:32364): Gtk-WARNING **: 14:34:42.449: Could not load a pixbuf from icon theme. This may indicate that pixbuf loaders or the mime database could not be found. ** Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /snap/caprine/27/gnome-platform/usr/share/icons/Humanity/status/16/image-missing.svg: Unable to load image-loading module: /snap/caprine/28/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /snap/caprine/28/gnome-platform/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: cannot open shared object file: No such file or directory (gdk-pixbuf-error-quark, 5) Aborted (core dumped)

@skiwichu I have this problem without suspending the device. To me it looks like a separate from this one. I've reported it as https://github.com/sindresorhus/caprine/issues/1071.

Download the snap locally and then snap install filename - - dangerous
maybe it will help

@atais weird. I will test it.

The latest version has a workaround for the Snap issue: https://github.com/sindresorhus/caprine/releases/tag/v2.38.0 Can people try it out and report back?

At first sight, it looks like it's working.

Yeah this looks fixed since v2.38.0, cheers @sindresorhus!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChristianKlee picture ChristianKlee  Â·  4Comments

vogu66 picture vogu66  Â·  3Comments

skymakai picture skymakai  Â·  3Comments

petersng picture petersng  Â·  3Comments

kingmustard picture kingmustard  Â·  3Comments