johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
5.26k stars 256 forks source link

IO Error opening EPub files #1243

Closed pablojvarela closed 4 months ago

pablojvarela commented 5 months ago

When opening any EPub file, I get an IO Error on the Foliate UI, due to missing AppArmor profiles.

➜  ~ foliate "/home/pablo/Zotero/storage/L8362ZDH/Percival and Gregory - 2020 - Architecture patterns with Python enabling test-d.epub" 

** (com.github.johnfactotum.Foliate:43952): WARNING **: 12:36:48.245: Could not open /sys/class/dmi/id/chassis_type: Failed to open file “/sys/class/dmi/id/chassis_type”: Permission denied

** (com.github.johnfactotum.Foliate:43952): WARNING **: 12:36:48.245: Could not open /sys/firmware/acpi/pm_profile: Failed to open file “/sys/firmware/acpi/pm_profile”: Permission denied

(process:44102): GLib-GIO-WARNING **: 12:36:48.331: GDBus.Error:org.freedesktop.portal.Error.NotAllowed: This call is not available inside the sandbox

(com.github.johnfactotum.Foliate:43952): Gtk-WARNING **: 12:36:48.426: No IM module matching GTK_IM_MODULE=ibus found

** (process:44106): WARNING **: 12:36:48.606: Could not open /sys/class/dmi/id/chassis_type: Failed to open file “/sys/class/dmi/id/chassis_type”: Permission denied

** (process:44106): WARNING **: 12:36:48.606: Could not open /sys/firmware/acpi/pm_profile: Failed to open file “/sys/firmware/acpi/pm_profile”: Permission denied

** (process:44106): WARNING **: 12:36:48.606: Failed to get atspi registered event listeners: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy 
prevents this sender from sending this message to this recipient; type="method_call", sender=":1.267" (uid=1000 pid=44106 comm="/usr/lib/x86_64-linux-gnu/webkitgtk-6.0/WebKitWebP" label="snap.foliate.foliate (enforce)")
interface="org.a11y.atspi.Registry" member="GetRegisteredEvents" error name="(unset)" requested_reply="0" destination=":1.227" (uid=1000 pid=41217 comm="/usr/libexec/at-spi2-registryd --use-gnome-session" label="unconfined")

(com.github.johnfactotum.Foliate:43952): Gjs-CRITICAL **: 12:36:54.171: JS ERROR: TypeError: this[#data] is undefined
vfunc_unroot@resource:///com/github/johnfactotum/Foliate/book-viewer.js:991:9
connectWindowRemoved@resource:///com/github/johnfactotum/Foliate/app.js:355:16
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

I'm runinng XFCE on Linux 6.2.0-39-generic #40~22.04.1-Ubuntu x86_64 GNU/Linux. Installed Foliate through Ubuntu Snap Store.

johnfactotum commented 5 months ago

Possibly a duplicate of #1153.

soumyaDghosh commented 3 months ago

@johnfactotum Need you here, https://forum.snapcraft.io/t/request-to-auto-connect-to-removable-media-plug-for-foliate-snap/39334

Please give opinion there for the publisher vetting.

johnfactotum commented 3 months ago

Hmm. So apparently I don't even have an account on the Snapcraft forum, which means it would be easy for someone to impersonate me there... but I think Snapcraft is one of the authorized applications connected to my GitHub account, so it should be easy to verify that the Snap is indeed published by upstream.

My question remains, though, that is, ideally it should be using portals to open the files, rather than requiring full access.

soumyaDghosh commented 3 months ago

Hmm. So apparently I don't even have an account on the Snapcraft forum, which means it would be easy for someone to impersonate me there... but I think Snapcraft is one of the authorized applications connected to my GitHub account, so it should be easy to verify that the Snap is indeed published by upstream.

I would still request you to create an account in the forum.

My question remains, though, that is, ideally it should be using portals to open the files, rather than requiring full access.

It should be using portals, so, it's. It's using portals. But often the users open the files directly by right clicking on it from a file manager. In that case, portals will not be able to help.

johnfactotum commented 3 months ago

The document portal should also be used when opening from the file manager, not just the file picker. In Flatpak this can be done with the --file-forwarding option or the more advanced flatpak document-export command.