Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalogs broken due to Cross-Origin control error on Ubuntu 22.04 (PPA install) #918

Closed
solarchemist opened this issue Jul 15, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@solarchemist
Copy link

solarchemist commented Jul 15, 2022

Installed Foliate v2.6.4 (latest release) from ppa:apandada1/foliate on freshly provisioned Ubuntu server 22.04 with lightdm/i3wm and glib2 v2.72.1-1.

Open the catalogs tab - none of the catalogs renders (except for Gutenberg, which renders titles but not cover graphic).
Foliate_001

In the terminal output, this error message:

CONSOLE SECURITY ERROR Cross-origin redirection to https://standardebooks.org/feeds/opds/all denied by Cross-Origin Resource Sharing policy: Origin null is not allowed by Access-Control-Allow-Origin. Status code: 301
CONSOLE JS ERROR Fetch API cannot load https://standardebooks.org/opds/all due to access control checks.

(com.github.johnfactotum.Foliate:4401): Gjs-WARNING **: 20:00:11.841: JS ERROR: Error: TypeError: Load failed
_handleAction@resource:///com/github/johnfactotum/Foliate/js/opds.js:485:50
OpdsClient/<@resource:///com/github/johnfactotum/Foliate/js/opds.js:470:18
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

Attempted to add my own OPDS server, but program never challenges me with password.
The catalog is created anyway, then fails in the same manner as the pre-existing ones.

This behaviour is in contrast to my otherwise identically configured Foliate v2.6.4 instance with normally working catalogs, except it's still on Ubuntu 18.04 (glib2 v2.56.4).

In summary, something seems broken with Foliate from PPA install on Ubuntu server 22.04 with i3wm.

Switching to Flatpak does resolve this issue, but is not workable for me because I can't figure out how to find my catalogs/, books/ and library/ folders (found at ~/.local/share/com.github.johnfactotum.Foliate/ when installed from PPA).

Perhaps someone could advice on either how to fix the PPA install, or else where to find the library/catalogs when installed from Flatpak?

Edit: The folder does not exist until either a book/catalog has been added by the user (the default catalogs are obviously defined somewhere else), which is why it was hard to find :-) In any case, it's located at ~/.var/app/com.github.johnfactotum.Foliate/data/com.github.johnfactotum.Foliate/.

Version:

  • Foliate version: 2.6.4
  • OS/Distribution and version: Ubuntu 22.04
  • Desktop environment: lightdm with i3wm (no desktop environment)
  • Installation method: PPA
@solarchemist solarchemist added the bug Something isn't working label Jul 15, 2022
@archisman-panigrahi
Copy link
Contributor

Somehow, it works for me in Linux Mint 21 MATE (beta) edition (the same underlying Ubuntu version, 22.04).
I too am using the PPA.

image

Can you try deleting the cache and config files of Foliate and check if the issue persists?

@solarchemist
Copy link
Author

Thanks for the quick response @apandada1!

I have been testing a little (wiping cache like you suggested, also reinstalling afresh, etc.) and think I can provide some more observations, but I have found no fix so far. I have made some comparisons to my other computer running Ubuntu Bionic with a pre-existing fully working install of Foliate v2.6.4 from the PPA.

Uninstalled Foliate, wiped cache and library like this:

sudo apt purge foliate
rm -rf ~/.cache/com.github.johnfactotum.Foliate
rm -rf ~/.local/share/com.github.johnfactotum.Foliate

and we can confirm all Foliate files are gone with locate (from the plocate package):

locate Foliate

Has Foliate saved our Calibre password to the secret store?

The password to my Calibre library is indeed stored in the secret store (can be seen using seahorse, for example),
despite this message occassionally showing up in the log:

** (process:2): WARNING **: Error writing credentials to socket: Error sending message: Broken pipe

(which made me suspect the part of Foliate that uses WebKit2 to store the password might be failing, but it's not the culprit as far as I can tell).

There is a small, probably cosmetic, difference in how the password entry appears in seahorse on Ubuntu Bionic vs Jammy: whereas the entry has the description "WebKitGTK password" on bionic, this field is blank on jammy (in both cases the type is "network password").

Could the problem be caused by package version differences?

That is, did something change between Bionic and Jammy?

Likely not, as @apandada1 has it running without issues on an Ubuntu Jammy-based system, furthermore Jammy has been around for months now, and no one else has reported this issue with Foliate.

Still, I made a point of making sure that Foliate's runtime dependencies (as far as I can tell) were installed and their version on Jammy and Bionic, respectively:

  • gpg v2.2.27 vs gpg v2.2.4
  • seahorse v41.0-2 vs seahorse v3.20.0-5
  • webkit2gtk v2.36.3 vs webkit2gtk v2.32.4
  • gjs v1.72.0-3 vs gjs v1.52.5

But the fact that Foliate PPA works on Bionic but no longer does on Jammy (despite both computers being configured the same, i3wm etc.) suggests that something must have changed.
We have just not been able to identify what, yet.

Nvidia driver? Not this time.

Several Foliate issues (e.g., #707, #322, #504) mentioned problems related to outdated Nvidia drivers.
So I upgraded Nvidia driver from v470 to v510 and rebooted, but saw no difference in Foliate's behaviour.

My best guess (not a programmer)

Could this catalog error in PPA be related to the failure to retain library credentials in Flatpak (#877)?
I'm intrigued by this, because I observed exactly the same behaviour on Jammy with the Flatpak installation.

So perhaps the Flatpak does not suffer this catalog error because its own bundled WebKit works differently, but then (for some reason) fails to populate the user's secret store (I checked - Flatpak Foliate never creates an entry, whereas PPA Foliate did) and the result being a working catalog but with amnesa, so to speak.

Like I said, I'm not a programmer, but I always provision my machines with Ansible, so I have a pretty good control over my systems' configuration and decent reproducibility. I hope these observations make sense to others interested in this issue.

@johnfactotum
Copy link
Owner

glib2 v2.72.1-1
[...]
This behaviour is in contrast to my otherwise identically configured Foliate v2.6.4 instance with normally working catalogs, except it's still on Ubuntu 18.04 (glib2 v2.56.4).

Probably the same as or related to #878.

If not, feel free to comment or open a new issue.

@johnfactotum johnfactotum closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants