hugolabe / Wike

Wikipedia Reader for the GNOME Desktop
https://hugolabe.github.io/Wike/
GNU General Public License v3.0
231 stars 32 forks source link

Can't browse page, it's empty #136

Open BarbzYHOOL opened 1 year ago

BarbzYHOOL commented 1 year ago

image It's totally empty for me

Installed through flatpak on pop os 22.04

camelCaseNick commented 1 year ago
hugolabe commented 1 year ago

Difficult to know what is happening without having more information.

It works fine for me on PopOS 20.04.

PopOS

BarbzYHOOL commented 1 year ago
(process:2): Gtk-WARNING **: 01:23:09.738: Locale not supported by C library.
    Using the fallback 'C' locale.
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.

i see no page, its always grey

camelCaseNick commented 1 year ago
BarbzYHOOL commented 1 year ago

That command doesn't work. When I type something in the search bar, i get the suggestions and in the terminal it gives

flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
flatpak-spawn: Invalid byte sequence in conversion input

my locale:

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

flatpak conf (same for both commands)

languages: *unset* (default: en)
extra-languages: *unset*
camelCaseNick commented 1 year ago

I suspect your issue to be some variant of flatpak/flatpak#3712.

Would you be so kind to add French then using flatpak config --set extra-languages fr_FR.UTF-8, after which the output of flatpak config for you should read

languages: *unset* (default: en;fr)
extra-languages: fr_FR.UTF-8

If it does indeed, you should be able to update your locale extensions using flatpak update. Unless I'm mistaken, that should make Wike work for you.

BarbzYHOOL commented 1 year ago

Hmm ok i started doing it but then it wanted to update all my flatpaks

I want my flatpaks to be in english by default

Should I change the command? or do i still need to run that command because I have the french locale installed?

camelCaseNick commented 1 year ago

You can run flatpak run --command=locale com.github.hugolabe.Wike to see if it matches locale. It should.

It should not change your default language, but just make the French locale available to be used for the parts locale reports to be used with fr_FR. If there is a problem with it, there also the option of flatpak config --unset extra-languages.

Maybe flatpak update --subpath=en,fr org.gnome.Platform.Locale//44; flatpak update --subpath=en,fr com.github.hugolabe.Wike is all you need, to just update the locale extensions of interest to Wike.

BarbzYHOOL commented 1 year ago
flatpak run --command=locale com.github.hugolabe.Wike                                                                                     23:36:55
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

then i ran flatpak update --subpath=en,fr org.gnome.Platform.Locale//44; flatpak update --subpath=en,fr com.github.hugolabe.Wike

then again:

flatpak run --command=locale com.github.hugolabe.Wike                                                                               25.5s|23:38:12
bwrap: Can't mkdir parents for /app/share/runtime/locale: Read-only file system

not sure what to do, it seems pretty alien to me

Now I cannot run "wike" at all, it doesn't even appear in menus

Please, tell me what to do :P

camelCaseNick commented 1 year ago

You can reinstall Wike via flatpak uninstall --keep-ref com.github.hugolabe.Wike; flatpak install com.github.hugolabe.Wike. That will not actually remove the files for it from your drive (due to --keep-ref) but merely mark them as not installed, and instantly reinstall them but only using your default locales. It will also not touch your config and cache files.

camelCaseNick commented 1 year ago

I just realised where it went wrong. Sorry for the misdirection. You'd need to go with

  1. flatpak config --set extra-languages fr_FR.UTF-8 – this will make flatpak require the French locale to be installed additionally to your default locale en_US.UTF-8
  2. flatpak update com.github.hugolabe.Wike – this will ask flatpak to only update Wike, so that you do not need to download the French locale data for every installed package
  3. open Wike – here it would be interesting to see, whether it works now, and whether it is still English, indeed, as I'd expect
  4. flatpak config --unset extra-languages – this will remove the requirement for the French locale, reverting to your current state

(At least, I'm sure, it will not render Wike unable to start. :stuck_out_tongue: :sweat_smile:)

camelCaseNick commented 1 year ago

@BarbzYHOOL Did you test the above steps? Is this still relevant?

BarbzYHOOL commented 1 year ago

It didn't work

╰─# flatpak update com.github.hugolabe.Wike                        9.9s|00:30:29
Looking for updates…

        ID                          Branch   Op  Remote   Download
 1. [✓] org.gnome.Platform.Locale   44       u   flathub   17,7 kB / 340,5 MB
 2. [✓] org.gnome.Platform          44       u   flathub  192,5 MB / 326,0 MB

Updates complete.

╰─# wike                                                       1m 18.8s|00:31:59
Command 'wike' not found, but can be installed with:
sudo snap install wike
BarbzYHOOL commented 1 year ago

You can reinstall Wike via flatpak uninstall --keep-ref com.github.hugolabe.Wike; flatpak install com.github.hugolabe.Wike. That will not actually remove the files for it from your drive (due to --keep-ref) but merely mark them as not installed, and instantly reinstall them but only using your default locales. It will also not touch your config and cache files.

i did not do this though, should I ?

camelCaseNick commented 1 year ago

i did not do this though, should I ?

You reported that flatpak run com.github.hugolabe.Wike did not start anymore, due to a mistake in steps in told you to test. So if Wike still does not even start, yes. They are meant to get you back to the previous state – the one from which you reported this issue.

It didn't work

To run Wike, please use flatpak run com.github.hugolabe.Wike. Here, wike won't work.

BarbzYHOOL commented 1 year ago

╰─# flatpak run com.github.hugolabe.Wike 0.1s|23:41:48 bwrap: Can't mkdir parents for /app/share/runtime/locale: Read-only file system error: ldconfig failed, exit status 256

So then I uninstalled and reinstalled, still same issue as originally

Then, I did that:

sudo flatpak config --set extra-languages fr_FR.UTF-8 flatpak update com.github.hugolabe.Wike Looking for updates… Nothing to do.

Same result, it's empty and here is what it says in the console:

(process:2): Gtk-WARNING **: 00:53:39.208: Locale not supported by C library.
    Using the fallback 'C' locale.
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
camelCaseNick commented 1 year ago

@BarbzYHOOL Could you test it with flatpak update org.gnome.Platform.Locale//44 as well when the extra language is set?

camelCaseNick commented 1 year ago

Looking for updates… Nothing to do.

Wait. That's odd. What does flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale says?

BarbzYHOOL commented 1 year ago

Looking for updates… Nothing to do.

Wait. That's odd. What does flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale says?

flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale                                                           00:35:05
total 0
drwxr-xr-x 1 JOE JOE  8 Jul  8 00:49 .
drwxr-xr-x 1 JOE JOE 12 Jan  1  1970 ..
-rw-r--r-- 1 JOE JOE  0 Jul  8 00:49 .ref
--------------------------------------------
camelCaseNick commented 1 year ago

Did you make sure flatpak config returns languages: *unset* (default: de;fr)?

I am confused, because flatpak update com.github.hugolabe.Wike should let you update com.github.hugolabe.Wike.Locale stable branch and org.gnome.Platform.Locale branch 44. And flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale reports the installed languages (except en as that is the default locale) and thus you should have a directory with the name fr.

BarbzYHOOL commented 1 year ago

i can't rerun the 15 commands you told me after each reply lol sorry

╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak config  --set extra-languages fr_FR.UTF-8              0.2s|00:03:23
error: Flatpak system operation Configure not allowed for user
--------------------------------------------------------------------------------
╭─ ✘ [~| 60|🖿 45|🗐 15|rw]
╰─1 sudo flatpak config  --set extra-languages fr_FR.UTF-8         1.9s|00:04:02
[sudo] password for im_getting_tired: 
Sorry, try again.
[sudo] password for im_getting_tired: 
--------------------------------------------------------------------------------
╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak config                                                42.9s|00:04:48
languages: *unset* (default: en;fr)
extra-languages: fr_FR.UTF-8
--------------------------------------------------------------------------------
╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale
total 0
drwxr-xr-x 1 im_getting_tired im_getting_tired  8 Jul  8 00:49 .
drwxr-xr-x 1 im_getting_tired im_getting_tired 12 Jan  1  1970 ..
-rw-r--r-- 1 im_getting_tired im_getting_tired  0 Jul  8 00:49 .ref
--------------------------------------------------------------------------------
╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak update com.github.hugolabe.Wike                        0.2s|00:05:19
Looking for updates…
Nothing to do.
--------------------------------------------------------------------------------
╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak update org.gnome.Platform.Locale//44                   1.9s|00:06:04
Looking for updates…
Nothing to do.
--------------------------------------------------------------------------------
╭─[~| 60|🖿 45|🗐 15|rw]
╰─# flatpak run --command=ls com.github.hugolabe.Wike -la /app/share/runtime/locale
total 0
drwxr-xr-x 1 im_getting_tired im_getting_tired  8 Jul  8 00:49 .
drwxr-xr-x 1 im_getting_tired im_getting_tired 12 Jan  1  1970 ..
-rw-r--r-- 1 im_getting_tired im_getting_tired  0 Jul  8 00:49 .ref

then i remove this cause it doesn't work flatpak config --unset extra-languages

camelCaseNick commented 1 year ago

i can't rerun the 15 commands you told me after each reply lol sorry

I'm sorry about that. I'll try to find out what's causing this not installing. I did not expect this to be this convoluted and take that long.

camelCaseNick commented 11 months ago

After thinking a bit about it. Maybe, to prove that it is indeed due to missing French locale extensions, instead of installing them, one could force another locale onto it.

To launch it without any reference to fr_FR, you'd need to run flatpak run --env=LC_NUMERIC=en_US.UTF-8 --env=LC_TIME=en_US.UTF-8 --env=LC_MONETARY=en_US.UTF-8 --env=LC_PAPER=en_US.UTF-8 --env=LC_NAME=en_US.UTF-8 --env=LC_ADDRESS=en_US.UTF-8 --env=LC_TELEPHONE=en_US.UTF-8 --env=LC_MEASUREMENT=en_US.UTF-8 --env=LC_IDENTIFICATION=en_US.UTF-8 com.github.hugolabe.Wike.

If that doesn't help, I'm really out of ideas of how to even test the hypothesis that the problem is due to the locale. (and also out of different hypotheses …)

BarbzYHOOL commented 11 months ago

that works, so what is the next step?

BarbzYHOOL commented 11 months ago

?

camelCaseNick commented 11 months ago
  1. To work around this problem, you can set those environment variables permanently for within the sandbox for Wike: flatpak override --env=LC_NUMERIC=en_US.UTF-8 --env=LC_TIME=en_US.UTF-8 --env=LC_MONETARY=en_US.UTF-8 --env=LC_PAPER=en_US.UTF-8 --env=LC_NAME=en_US.UTF-8 --env=LC_ADDRESS=en_US.UTF-8 --env=LC_TELEPHONE=en_US.UTF-8 --env=LC_MEASUREMENT=en_US.UTF-8 --env=LC_IDENTIFICATION=en_US.UTF-8 com.github.hugolabe.Wike. The default values can be restored with flatpak override --reset com.github.hugolabe.Wike.
  2. But that doesn't get to the root of this. The issue here now really looks like to be related to flatpak/flatpak#3712. Which version of Flatpak (flatpak --version) do you have installed? Most importantly, is it 1.12 or higher? And which version of glib (dpkg -s libglib2.0-bin | grep '^Version:') is on your system? If those are new enough to include the fix for that issue with Flatpak, I think, this should be reported there.
BarbzYHOOL commented 11 months ago

Flatpak 1.14.4 Version: 2.72.4-0ubuntu2.2

so what do i do?

camelCaseNick commented 11 months ago

Oh, another stupid question, I got while answering ẁhat to do next, is: Does localectl list-locales report

C.UTF-8
en_US.UTF-8
fr_FR.UTF-8

for you?

camelCaseNick commented 11 months ago

If it does. (or at least it includes fr and en) You open an issue at flatpak with the relevant info. It could look like this:


not all languages recognised with mixed locale and thus not used for Locale extensions

I am using

on Pop_OS! 22.04 with a mixed locale:

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=fr_FR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=fr_FR.UTF-8
LC_NAME=fr_FR.UTF-8
LC_ADDRESS=fr_FR.UTF-8
LC_TELEPHONE=fr_FR.UTF-8
LC_MEASUREMENT=fr_FR.UTF-8
LC_IDENTIFICATION=fr_FR.UTF-8
LC_ALL=

and localectl list-locales

C.UTF-8
en_US.UTF-8
fr_FR.UTF-8

flatpak config and flatpak --user config don't report the fr:

languages: *unset* (default: en)
extra-languages: *unset*

It should already include flatpak/flatpak#4411, yet French is not selected as a locale for me.

This let to hugolabe/Wike#136 where the WebKit view does not work with its process crashing, similarly to flatpak/flatpak#3712:

(process:2): Gtk-WARNING **: 01:23:09.738: Locale not supported by C library.
    Using the fallback 'C' locale.
flatpak-spawn: Invalid byte sequence in conversion input
Try "flatpak-spawn --help" for more information.
BarbzYHOOL commented 11 months ago

so meanwhile, i should just edit the desktop launcher and add the custom command, right?

camelCaseNick commented 11 months ago

No, I wouldn't do that. Technically, that can solve your issue, but those .desktop files are managed by flatpak, aren't they?

I mentioned flatpak override. While sandbox arguments added to flatpak run are only used once to execute the application, flatpak override stores your sandbox alteration preferences.

Thus, flatpak override […] com.github.hugolabe.Wike will make those environment variables permanent until you restore the default with flatpak override --reset com.github.hugolabe.Wike.

BarbzYHOOL commented 11 months ago

so i'd run sudo flatpak override --env=LC_ALL=en_US.UTF-8 com.github.hugolabe.Wike (with or without sudo?) then later on (or never) i'd reset if flatpak fixes the issue, right?

camelCaseNick commented 11 months ago

Yes, exactly. (regarding to sudo or not to sudo: If you run it as yourself, it is stored only for you, if you run it as root, you get it for every user of your system. For a single-user setup, it does not matter.)