foliate icon indicating copy to clipboard operation
foliate copied to clipboard

Foliate stopped working on Ubuntu 22.04

Open tomicakorac opened this issue 2 years ago • 33 comments

Describe the bug The Foliate application stops responding, and becomes unusable after a couple seconds.

To Reproduce Steps to reproduce the behavior:

  1. Open Foliate
  2. Open any ebook (tried with numerous files of .epub format)
  3. Attempt to use any piece of user interface
  4. Foliate does not respond - does nothing

Expected behavior User interface should respond as expected to the user interaction. For example, when I click on the right side, pages should turn forward, left side pages should turn back, moving page slider should move book pages appropriately, clicking content headings should jump to corresponding section etc.

Version:

  • Foliate version: 2.6.3, 2.6.4
  • OS/Distribution and version: Ubuntu 22.04
  • Desktop environment: GNOME Shell 40.alpha, GNOME Shell 40.beta
  • Installation method: Ubuntu PPT / apt, snap

Additional context Foliate was working just fine before, but I am not sure exactly at which point it started malfunctioning. I'm suspecting this happened after upgrading from Ubuntu 21.10 to 22.04.

tomicakorac avatar Mar 24 '22 09:03 tomicakorac

I have same problem after upgrade to 22.04.

amirHHP avatar Apr 02 '22 13:04 amirHHP

Just stumbled upon this. Trying to start from command line outputs

Gtk-Message: 15:42:24.916: Failed to load module "canberra-gtk-module"Gtk-Message: 15:42:24.918: Failed to load module "canberra-gtk-module"

** (com.github.johnfactotum.Foliate:12663): WARNING **: 15:42:25.023: 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:12663): WARNING **: 15:42:25.023: Could not open /sys/firmware/acpi/pm_profile: Failed to open file “/sys/firmware/acpi/pm_profile”: Permission denied

** (com.github.johnfactotum.Foliate:12663): ERROR **: 15:42:25.027: Unable to fork a new child process: Failed to execute child process “/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitNetworkProcess” (No such file or directory)

[1]    12663 trace trap (core dumped)  foliate```

Streppel avatar Apr 05 '22 18:04 Streppel

Same problem on Ubuntu 20.04

** (com.github.johnfactotum.Foliate:1173356): ERROR **: 20:03:01.073: Unable to fork a new child process: Failed to execute child process “/usr/lib/x86_64-linux-gnu/webkit2gtk-4.0/WebKitNetworkProcess” (No such file or directory)

Lagrang avatar Apr 06 '22 17:04 Lagrang

I cannot reproduce the issue in Xubuntu 22.04 (fully updated as of 7th April) with the PPA version of Foliate. It runs and opens books just fine.

archisman-panigrahi avatar Apr 07 '22 09:04 archisman-panigrahi

Same here. There is a workaround. When you login, choose 'Ubuntu on xorg' instead of 'Ubuntu', and you will get a functional Foliate.

bpint avatar Apr 08 '22 02:04 bpint

Hm, that is really strange. I am in fact using Ubuntu on Xorg, and I am still experiencing the same issue - Foliate is practically unusable.

tomicakorac avatar Apr 08 '22 08:04 tomicakorac

No tricks work for me because it crashes on load, every time. No error message. Just starts to load and then never does.

lorezcrash avatar Apr 08 '22 14:04 lorezcrash

Similar problem, Debian 11, glibc 2.72, installed from .deb package.

Interestingly, the same version of foliate, but flatpak (installed via bauh], works just fine. Which isn't a solution, but perhaps a short-term workaround for some other folks.

uriel1998 avatar Apr 13 '22 13:04 uriel1998

@uriel1998 If you're seeing "Empty Response", that's #878. The Flatpak version is still using the GNOME 41 runtime so it probably has glib < 2.72.

johnfactotum avatar Apr 13 '22 14:04 johnfactotum

So is there any hope that this gets fixed now? Or that we at least get a response from the maintainer?

tomicakorac avatar Apr 21 '22 09:04 tomicakorac

Cannot reproduce on Ubuntu MATE 22.04. Is this issue GNOME specific?

archisman-panigrahi avatar Apr 22 '22 07:04 archisman-panigrahi

Yes, this is specific to GNOME.

tomicakorac avatar Apr 22 '22 10:04 tomicakorac

I'm pretty sure I am running into the same underlying error. I have been running a Ubuntu apt install of Foliate (2.6.4-1 stable PPA) on Ubuntu Cinammon 22.04 with no issues for weeks. It died on me this morning as described in the top level bug report, i.e. window frame is displayed but it hangs. Re-running from the terminal I get the following error message: $ foliate

(WebKitWebProcess:2): Gdk-ERROR **: 09:36:32.022: The program 'WebKitWebProcess' received an X Window System error. This probably reflects a bug in the program. The error was 'BadValue (integer parameter out of range for operation)'. (Details: serial 205 error_code 2 request_code 151 (GLX) minor_code 34) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the GDK_SYNCHRONIZE environment variable to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)

The same thing continues to happen after removing Foliate and reinstalling (2.6.4-4~202205071246~ubuntu22.04.1) from the Daily PPA.

!!!==> The problem was probably triggered by the apt update that ran between yesterday and today. I suspect the nvidia driver upgrade, but anyway here is the full record:

Foliate killing upgrade

metawindow avatar May 18 '22 14:05 metawindow

@apandada1 since you are marked as the Ubuntu package maintainer, is there a chance you look into this issue any time soon?

@johnfactotum if we do not get any responce from @apandada1, what other options do we have to have this fixed? Foliate is basically unusable for over half a year now.

tomicakorac avatar May 26 '22 05:05 tomicakorac

@tomicakorac I don't know how to fix the bug, but does deleting mime.cache help, as in #878 ? Also, can you check if Atril can open epubs in Ubuntu 22.04? Someone found that it is also affected by the same bug, in Arch Linux.

Moreover, last time I checked in a VM, Foliate was working in MATE and XFCE.

archisman-panigrahi avatar May 26 '22 06:05 archisman-panigrahi

Thank you @apandada1.

Deleting ~/.local/share/mime/mime.cache did not change anything, the issues remain.

I've never used Atril, so can't know for sure. On the first glance, it looks like Atril works just fine, no issues. On the other hand, Atril is a completely different product and is not related to Foliate. Its user preferences are very limited compared to Foliate, and Atril can not replace Foliate for me.

MATE and XFCE don't have anything to do with this bug, this is specific to GNOME Shell version 40, as indicated in the initial bug report, and confirmed by several users in this thread.

Judging from the direction this discussion is going in, I am very sorry to conclude that Foliate on Ubuntu is a dead project now. What a shame.

tomicakorac avatar May 26 '22 06:05 tomicakorac

Broken in Fedora 36 as well. rpm build. Flatpak works.

gitkeerthi avatar May 26 '22 15:05 gitkeerthi

Google founds a lot of cases with the same error "run@resource:///org/gnome/gjs/modules/script/package.js:206:19" after upgrade to Gnome shell 40 There also is a guide to port extensions - https://gjs.guide/extensions/upgrading/gnome-shell-40.html , maybe it can help?

Nicolaith avatar Jun 16 '22 09:06 Nicolaith

Just now I've realised something that might be useful: As described above, Foliate does not accept user commands (or doesn't accept them accurately), but as soon as you change focus from Foliate to anything outside of Foliate (e.g. switch to another app window, or open Gnome menu, or open Activities menu, anything really that is outside of Foliate), Foliate will actually execute the last commands.

tomicakorac avatar Jul 05 '22 02:07 tomicakorac

Additional potentially useful detail: This issue consistently exists on regular users' accounts (both admin and user levels), but does not exist on the root account. When I run `sudo com.github.johnfactotum.Foliate' the app instance does not experience any problems. I can't conclude what may be the reason.

tomicakorac avatar Jul 18 '22 08:07 tomicakorac

Some more details that I hope can help fix this. After discovering that the problem doesn't occur when Foliate is run as Root, I ran the app from the terminal as both non-root and root, using --verbose flag. The log shows that as root, this section gets run:

rendition-ready
run_javascript: setStyle({"fontFamily":"Serif","fontSize":16,"fontWeight":400,"fontStyle":"normal","fontStretch":"normal","spacing":1.5,"margin":40,"maxWidth":1400,"usePublisherFont":false,"justify":true,"hyphenate":...
run_javascript: setupRendition()
run_javascript: display('epubcfi(/6/36!/4/2/18/14/2/2/2/1:0)')
layout
book-displayed
relocated
epubcfi(/6/36!/4/2/18/14/2/2/2/1:0)

As mentioned before, for non-root users this section does not get run until Foliate loses and regains focus.

tomicakorac avatar Jul 18 '22 12:07 tomicakorac

This is the warning after which Foliate becomes unrespnosive:

(com.github.johnfactotum.Foliate:15965): Gjs-WARNING **: 11:51:16.013: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
   main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
   run@resource:///org/gnome/gjs/modules/script/package.js:206:19
   @/usr/bin/com.github.johnfactotum.Foliate:9:17

tomicakorac avatar Jul 20 '22 08:07 tomicakorac

Attaching logs for comparison:

tomicakorac avatar Jul 23 '22 06:07 tomicakorac

Finally, it works again since I deleted the file ~/.local/share/mime/mime.cache

Nicolaith avatar Aug 02 '22 09:08 Nicolaith

@Nicolaith I'm very happy to hear there's hope. I've deleted that file and still no joy :( Should I re-create mime.cache after it's deleted?

tomicakorac avatar Aug 02 '22 09:08 tomicakorac

I just did a fresh Jammy install and ran into Foliate errors including the ones mentioned in this thread. Then I remembered: The first time I installed Jammy (on another computer) several months ago, the first thing I did was to check whether Wayland was causing the trouble, so I rebooted to Jammy using the Ubuntu on Xorg option. There were no problems on Xorg. What was odd, though, was that when I rebooted into Jammy with wayland, Foliate was absolutely fine.

So today, I did the same thing:

  1. Rebooted using the "Ubuntu on Xorg" option before entering log-in details (a little wheel bottom right)
  2. Tested Foliate
  3. Rebooted making sure to change back to standard "Ubuntu" Foliate was fine. Hopes this helps somebody.

kaia009 avatar Aug 13 '22 13:08 kaia009

@kaia009 your steps don't work for me. I actually don't run Wayland at all, I've been on Xorg all the time, and I'm still experiencing the same issue.

On my system I have several desktop environments installed: Gnome, Old Gnome (Compiz), Old Gnome (Metacity), Gnome on XServer, Ubuntu (Wayland), Ubuntu on Xorg. I've tried each and every one of them, and the same issue persists everywhere.

Further more, I've created a completely new user, just to test Foliate, tried logging in new user with all of the above environments, just to ensure the bugs aren't caused by my primary account user settings. Again, all issues persisted. I'm hopeless.

I do have a question though, @kaia009. Why did you reboot your computer when changing desktop environments? Is this step necessary? Wasn't it enough to log out and choose a new desktop environment on log in?

tomicakorac avatar Aug 13 '22 14:08 tomicakorac

Very sorry to hear of your plight. You're probably right about the rebooting, though. It would probably have been enough to just log out.

kaia009 avatar Aug 13 '22 17:08 kaia009

Same on Pop!_OS 22.04. Debian package version hangs and never loads a book. The Flatpak version works but throws errors about "Failed to load module canberra-gtk" and so forth.

jhncondix avatar Aug 22 '22 05:08 jhncondix

GNOME Shell got updated on my machine today to the version 43.beta, and the situation got even worse. Even more issues are manifesting. How on Earth is it possible that this problem is still not receiving any attention @johnfactotum? Foliate in inoperable on the single most used Linux distribution for over half a year, surely this should ring all the emergency bells.

tomicakorac avatar Aug 26 '22 16:08 tomicakorac