Closed einarjh closed 2 years ago
@einarjh
I dont know what is causing this, I was able to encounter the error using the same setup as you posted. But it was not reproducible, sometimes it worked and sometimes it didn't. Sometimes removing and reinstalling solved it after changing the locale but there wasn't any pattern.
I think it allway's works when installing as --system, please give it a try:
uninstall what you have now, select "all":
flatpak uninstall com.prusa3d.PrusaSlicer
then reinstall using --system
flatpak install --system com.prusa3d.PrusaSlicer
I still went ahead and updated the runtime and enabled the option not to separate the locale.
you can also try the beta channel for the upcoming 2.4.0
flatpak install --system https://flathub.org/beta-repo/appstream/com.prusa3d.PrusaSlicer.flatpakref
Ill leave this ticket open as it needs further investigation.
for some reason I cannot create this error anymore ..
That's really strange, because the issue is still fully present here, and I have never ever gotten it to work without overriding locale settings.
einar@random:~$ flatpak uninstall com.prusa3d.PrusaSlicer
ID Branch Op
1. [-] com.prusa3d.PrusaSlicer stable r
2. [-] com.prusa3d.PrusaSlicer.Locale stable r
Uninstall complete.
einar@random:~$ flatpak install com.prusa3d.PrusaSlicer
Looking for matches…
F: An error was encountered searching remote ‘gnome’ for ‘com.prusa3d.PrusaSlicer’: Unable to load summary from remote gnome: Error resolving “sdk.gnome.org”: Name or service not known
Remotes found with refs similar to ‘com.prusa3d.PrusaSlicer’:
1) ‘flathub’ (system)
2) ‘flathub’ (user)
Which do you want to use (0 to abort)? [0-2]: 1
Required runtime for com.prusa3d.PrusaSlicer/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/21.08) found in remote flathub
Do you want to install it? [Y/n]:
com.prusa3d.PrusaSlicer permissions:
ipc network x11 devices dri file access [1]
dbus access [2] bus ownership [3] system dbus access [4]
[1] /media, /run/media, home
[2] com.prusa3d.prusaslicer.InstanceCheck.*, org.freedesktop.Flatpak
[3] com.prusa3d.prusaslicer.*
[4] org.freedesktop.UDisks2
ID Branch Op Remote Download
1. [✓] org.freedesktop.Platform.GL.default 21.08 i flathub 128,2 MB / 128,6 MB
2. [✓] org.freedesktop.Platform.GL.nvidia-470-74 1.4 i flathub 222,5 MB / 222,6 MB
3. [✓] org.freedesktop.Platform.Locale 21.08 i flathub 17,7 kB / 324,9 MB
4. [✓] org.freedesktop.Platform.VAAPI.Intel 21.08 i flathub 11,6 MB / 11,6 MB
5. [✓] org.freedesktop.Platform.openh264 2.0 i flathub 1,5 MB / 1,5 MB
6. [✓] org.freedesktop.Platform 21.08 i flathub 153,7 MB / 198,6 MB
7. [✓] com.prusa3d.PrusaSlicer stable i flathub 58,9 MB / 68,6 MB
Installation complete.
einar@random:~$ flatpak run com.prusa3d.PrusaSlicer
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
(This is testing on a different system than the original submission, but it's still Fedora and still the same settings. I have the same issue on three separate machines)
@einarjh can you test it like this and report back:
flatpak run --env=LC_ADDRESS=C --env=LC_COLLATE=C --env=LC_MONETARY=C --env=LC_MEASUREMENT=C --env=LC_NAME=C --env=LC_NUMERIC=C --env=LC_TELEPHONE=C com.prusa3d.PrusaSlicer
Tested now, with it installed as system, same error message as before.
BUT. On a whim, I tried with only --env=LANG=C
, and then it started right up. Also starts perfectly with LANG=enUS.UTF-8 and other `en` variants.
@einarjh
thanks, yes I know that works .. but it disables auto detection for languages that are supported by PrusaSlicer.
can we try one more thing?
flatpak run --env=LC_CTYPE=C --env=LC_NUMERIC=C --env=LC_TIME=C --env=LC_COLLATE=C --env=LC_MONETARY=C --env=LC_MESSAGES=C --env=LC_PAPER=C --env=LC_NAME=C --env=LC_ADDRESS=C --env=LC_TELEPHONE=C --env=LC_MEASUREMENT=C --env=LC_IDENTIFICATION=C com.prusa3d.PrusaSlicer
this will set all to C except the language.. Let me know if that works
@einarjh
these are supported by Prusa and I have a feeling something goes wrong when setting formats to an language that is not supported.
I could just set the default and disable auto-detection but id like to leave that working and report upstream.
ok, yes that works :-) I was able to reproduce !!!
That last one worked as well. I suspect that a simple LC_ALL=C
should do the same thing, then (that leaves LANG as the only non-C option set in locale
)
I'm not so sure about that theory, in my testing de_DE is still failing, and that is listed as a supported language.
The .AppImage that Prusa supplies is working without issue, but Flatpak is so much nicer :)
LC_ALL=C will override LANG which is needed to support auto detection. I will commit my changes, if this issue still remains after the update please let me know.
Thanks again for you're help and report.
but you might be right with LC_ALL=C
this is what I found:
On GNU systems, LC_ALL=C and LC_ALL=POSIX (or LC_MESSAGES=C|POSIX) override $LANGUAGE, while LC_ALL=anything-else wouldn't.
@bubnikv @lukasmatena
if setting the formats to an unsupported language by PrusaSlicer in the system settings app. PrusaSlicer will not start up barfing something like:
flatpak run --user com.prusa3d.PrusaSlicer
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
I currently worked around this issue by setting all formats to =C
as environment variable except for LANG.
But perhaps you know where I can peek in to in the PrusaSlicer code so this doesn't happen? Or maybe you doing something special in the AppImage and can point me in the right direction?
Is this considered an upstream bug? I assume there is something wrong happening in GUI_App::load_language or CLI::run
Thanks.
Sorry, I don't have any insight for the inner workings of PrusaSlicer. But thanks for the help so far, I assume the workaround will be pushed to flathub soon?
@einarjh yes, it should be available soon
Indeed, setting the flatpak language to "en;nb" as both --system and --user and then running a flatpak update seems to have fixed the issue. Another clue is that nb_NO and nb_NO.UTF-8 now shows up as supported locales within the sandbox:
einar@random:~$ flatpak run --command=bash com.prusa3d.PrusaSlicer
einar@random:~$ locale -a
C
C.utf8
POSIX
en_AG
en_AU
en_AU.utf8
en_BW
en_BW.utf8
en_CA
en_CA.utf8
en_DK
en_DK.utf8
en_GB
en_GB.utf8
en_HK
en_HK.utf8
en_IE
en_IE.utf8
en_IE@euro
en_IL
en_IN
en_NG
en_NZ
en_NZ.utf8
en_PH
en_PH.utf8
en_SC.utf8
en_SG
en_SG.utf8
en_US
en_US.utf8
en_ZA
en_ZA.utf8
en_ZM
en_ZW
en_ZW.utf8
nb_NO
nb_NO.utf8
So definitely an upstream bug, and I feel that setting the locales within GNOME settings should also update the language definitions for flatpak.
Yep, at least we now know where it is from. Ill leave this workaround in place until flatpak has this solved
I have to revert the workaround ... it won't startup without using the terminal
@einarjh just so you are aware. This issue has been fixed in the just released flatpak version 1.12.0.
In the release notes it states: Install translations for all languages in the locale, not just the ones in LC_MESSAGES.
Alas, that doesn't seem to be the case, I just tested the latest Flatpak release on the upcoming Fedora 35, and the issue remains unresolved:
einar@trillian:~$ flatpak --version
Flatpak 1.12.1
einar@trillian:~$ flatpak run com.prusa3d.PrusaSlicer
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
@einarjh This worked for me on Fedora 35 :
Run:
flatpak update --appstream && flatpak update
tested changing the locale and formats .. The above fixed it.
I don't know why this is happening ..
Sorry, I still can't seem to get it to run. Ran the commands you posted, with the same conditions as in the original bug report, and it still results in the same error.
Seems the most reliable workaround right now is still to set the language setting in the flatpak config.
➜ ~ flatpak run com.prusa3d.PrusaSlicer
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
The following error happens when i try to run it on fedora 35 too...
➜ ~ flatpak run com.prusa3d.PrusaSlicer An error occured while setting up locale. You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands. PrusaSlicer will now terminate. locale::facet::_S_create_c_locale name not valid
The following error happens when i try to run it on fedorra 35 too...
Please run flatpak update --appstream && flatpak update
What locale are you using?
Please run
flatpak update --appstream && flatpak update
What locale are you using?
➜ ~ flatpak update --appstream && flatpak update
Updating appstream data for remote fedora
Updating appstream data for remote flathub
Looking for updates…
Info: org.freedesktop.Platform.GL.default//19.08 is end-of-life, with reason:
The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version
Nothing to do.
➜ ~ cat /etc/locale.conf
LANG="en_US.UTF-8"
it is not starting after flatpak update --appstream && flatpak update
...
Please run
flatpak update --appstream && flatpak update
What locale are you using?➜ ~ flatpak update --appstream && flatpak update Updating appstream data for remote fedora Updating appstream data for remote flathub Looking for updates… Info: org.freedesktop.Platform.GL.default//19.08 is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version Nothing to do. ➜ ~ cat /etc/locale.conf LANG="en_US.UTF-8"
it is not starting after
flatpak update --appstream && flatpak update
...
I need more information, please post the output of locale
command. What's interesting for me is do you have mixed locales?
If that is the case, it usually works reinstalling if the some format locale was changed after the install.
You mind trying the beta (upcoming 2.4) ?
flatpak remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
I might force en_US.UTF-8 locale using env variable in the flatpak container until upstream (Prusa3d) has a fix, please also report you're issue here in this ticket: https://github.com/prusa3d/PrusaSlicer/issues/2365
I need more information, please post the output of
locale
command. What's interesting for me is do you have mixed locales? If that is the case, it usually works reinstalling if the some format locale was changed after the install.
➜ ~ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
that's what I thought .. if you run flatpak run --command=bash com.prusa3d.PrusaSlicer
then inside the container: locale -a
what do you get?
You mind trying the beta (upcoming 2.4) ?
flatpak remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
Gives the same error:
➜ ~ flatpak remote-list
Name Options
fedora system,oci
flathub system
flathub-beta system
➜ ~ flatpak run com.prusa3d.PrusaSlicer/x86_64/beta
[2021-11-05 13:04:00.635803] [0x00007f11d57209c0] [trace] Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
that's what I thought .. if you run
flatpak run --command=bash com.prusa3d.PrusaSlicer
then inside the container:locale -a
what do you get?➜ ~ flatpak run --command=bash com.prusa3d.PrusaSlicer [📦 com.prusa3d.PrusaSlicer ~]$ locale -a C C.utf8 en_AG en_AU en_AU.utf8 en_BW en_BW.utf8 en_CA en_CA.utf8 en_DK en_DK.utf8 en_GB en_GB.utf8 en_HK en_HK.utf8 en_IE en_IE@euro en_IE.utf8 en_IL en_IN en_NG en_NZ en_NZ.utf8 en_PH en_PH.utf8 en_SC.utf8 en_SG en_SG.utf8 en_US en_US.utf8 en_ZA en_ZA.utf8 en_ZM en_ZW en_ZW.utf8 POSIX
➜ ~ flatpak run --command=bash com.prusa3d.PrusaSlicer [📦 com.prusa3d.PrusaSlicer ~]$ locale -a C C.utf8 en_AG en_AU en_AU.utf8 en_BW en_BW.utf8 en_CA en_CA.utf8 en_DK en_DK.utf8 en_GB en_GB.utf8 en_HK en_HK.utf8 en_IE en_IE@euro en_IE.utf8 en_IL en_IN en_NG en_NZ en_NZ.utf8 en_PH en_PH.utf8 en_SC.utf8 en_SG en_SG.utf8 en_US en_US.utf8 en_ZA en_ZA.utf8 en_ZM en_ZW en_ZW.utf8 POSIX
as you can see, the reason why PrusaSlicer won't start is because the German locale is missing in the container. It seems to be passed by the OS but its missing in the container.
Why this doesn't get resolved by reinstalling or executing flatpak update --appstream && flatpak update
.. no clue yet, it works for me ..
As a note, I was only able to reproduce this issue when installing PrusaSlicer first and changing the format locale after the install by something else using gnome settings ..
Anyway, I believe the locale detection code in the startup for PrusaSlicer needs to be adjusted on mixed locale and allow the app to start in any case. The bad is, it won't show anything to the user after executing the desktop file so the user knows nothing.
Maybe as a plus show a the configuration screen to configure the app language. (that screen does exist) I also looked in the code myself and I am still trying to figure it out.
As a workaround there seems to be two things you can do, which also helped others:
Prusa3D and myself need more input and help on solving this mystery.
FYI: @bubnikv @lukasmatena
@einarjh @peterge1998 I am poking in the dark here a bit, would be great if you could help me here. I started a test build here :
https://github.com/flathub/com.prusa3d.PrusaSlicer/pull/31
maybe when done you could help and try it out with me .. ?
maybe when done you could help and try it out with me .. ?
I ran:
➜ ~ flatpak install --user https://dl.flathub.org/build-repo/64093/com.prusa3d.PrusaSlicer.flatpakref
and:
➜ ~ flatpak list | grep Prusa
PrusaSlicer com.prusa3d.PrusaSlicer 2.4.0-beta1 test prusaslicer-origin user
but still:
➜ ~ flatpak run com.prusa3d.PrusaSlicer
[2021-11-06 11:03:36.155456] [0x00007f51d72f19c0] [trace] Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
You need to run as so:
flatpak run com.prusa3d.PrusaSlicer//test
Update:
Oh I see you only have that one.
You need to run as so:
flatpak run com.prusa3d.PrusaSlicer//test
Update:
Oh I see you only have that one.
➜ ~ flatpak run com.prusa3d.PrusaSlicer//test
[2021-11-06 13:06:57.455948] [0x00007f1dc372b9c0] [trace] Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
@xarbit Any news when 2.4.0 will be pushed live on flathub?
@peterge1998
2.4.0 beta is already on flathub, as soon as the alphas started I pushed them to flathuib. If you want to give PrusaSlicer 2.4.0 Beta a shot you can do that by just enabling the flathub beta channel.
I will push 2.4.0 to the release channel on flathub as soon as Prusa releases the software as stable. As you can see, we are at beta 1:
@peterge1998 @einarjh @bubnikv
I created a little workaround for this issue with the mixed locale. It will be for the upcoming 2.4.x released flatpak. Ill be merging the code soon but I wanted to know if any of you can help out and test it before? Its considered a workaround and its a simple entrypoint script that basically detects a crash, reads the info and then it will just force LC_ALL=en_US.UTF-8 and boots up without notice. While I was on this I also implemented a little bit of Dark Mode support :-) .. Please check it out and let me know if it works good enough or if it needs more attention. The code is here: https://github.com/flathub/com.prusa3d.PrusaSlicer/pull/33
Thanks !
@peterge1998 @einarjh @bubnikv
I created a little workaround for this issue with the mixed locale. It will be for the upcoming 2.4.x released flatpak. Ill be merging the code soon but I wanted to know if any of you can help out and test it before? Its considered a workaround and its a simple entrypoint script that basically detects a crash, reads the info and then it will just force LC_ALL=en_US.UTF-8 and boots up without notice. While I was on this I also implemented a little bit of Dark Mode support :-) .. Please check it out and let me know if it works good enough or if it needs more attention. The code is here: #33
Thanks !
➜ ~ flatpak install --user https://dl.flathub.org/build-repo/66610/com.prusa3d.PrusaSlicer.flatpakref
com.prusa3d.PrusaSlicer permissions:
ipc network x11 devices dri
file access [1] dbus access [2] bus ownership [3] system dbus access [4]
[1] /media, /run/media, home
[2] com.prusa3d.prusaslicer.InstanceCheck.*, org.freedesktop.Flatpak
[3] com.prusa3d.prusaslicer.*
[4] org.freedesktop.UDisks2
ID Branch Op Remote Download
1. [✓] com.prusa3d.PrusaSlicer.Locale test i prusaslicer-origin 220,1 kB / 3,4 MB
2. [✓] com.prusa3d.PrusaSlicer test i prusaslicer-origin 44,1 MB / 45,6 MB
Installation complete.
➜ ~ flatpak run com.prusa3d.PrusaSlicer
[2021-11-28 21:52:24.327581] [0x00007f7ffeff79c0] [trace] Initializing StaticPrintConfigs
An error occured while setting up locale.
You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands.
PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
@peterge1998 .. thanks for testing. As a note this workaround is currently only activated when using the desktop files. running from Command-line will not work unless you run it as the following :-) :
flatpak run --command=entrypoint com.prusa3d.PrusaSlicer
flatpak run --command=entrypoint com.prusa3d.PrusaSlicer
Sry, did not know this. Anyway, 2.4.0 runs fine on my setup :) Thanks for adressing this problem!
fixed with workaround for 2.4.0, closing
https://github.com/flathub/com.prusa3d.PrusaSlicer/pull/33 is now merged in the beta channel/branch on flathub and will work when running flatpak run com.prusa3d.PrusaSlicer
, I mean without using --command=entrypoint
.
you can get the official flathub beta channel by installing this repo:
flatpak remote-add flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
would be great to know if it works for you. The dark variant theme looks great :-)
It's not working for me (version 2.4.2 from flathub):
[xyz@xyz ~]$ flatpak run com.prusa3d.PrusaSlicer
Message: 13:46:07: Starting PrusaSlicer flatpak with entrypoint script
/app/bin/entrypoint: line 12: warning: setlocale: LC_ALL: cannot change locale (en_DE.UTF-8) Message: 13:46:07: WARN: Executing prusa-slicer with locale workaround en_DE.UTF-8 [xyz@xyz ~]$ [2022-08-11 13:46:07.632571] [0x00007fd7b1b519c0] [trace] Initializing StaticPrintConfigs An error occured while setting up locale. You may need to reconfigure the missing locales, likely by running the "locale-gen" and "dpkg-reconfigure locales" commands. PrusaSlicer will now terminate.
locale::facet::_S_create_c_locale name not valid
@Bricksonecan you give me more information about your setup and what you are doing here? Trying to understand the [patson@patson-ms7b86 ~] session ..
@xarbit Thanks for the reply. The patson part should've been xyz as well as in the beginning. Just forgot to edit it. I am new to posting on github ¯_(ツ)_/¯
I am running EndeavourOS (Plasma, Wayland) and installed Prusa Slicer as a flatpak. Then I used flatpak run com.prusa3d.PrusaSlicer to run it. Everything below that is the output I got in the terminal. (Above and below Message: 13:46:07: Starting PrusaSlicer flatpak with entrypoint script there were dotted lines that messed up the formatting. So I removed them)
Prusa Slicer was only working for me (arch repo, AUR or flathub) if my formats settings for region, numbers, time, currency and measurements were the same (e.g. en_US.UTF-8). But I wanted a mix between Englisch (system language) and German (rest). After some more research it looked like it's a Plasma problem that's only affecting some programs (FreeCAD and Blender for example made no problems).
Using locale-gen as the error message suggested said that it generated locales de_DE.UTF-8 and en_US.UTF-8. Just what I needed. But it still didn't work. I then checked my /etc/locales.gen and saw that both locales were uncommented at the end (under "# Locales generated by Calamares"), but not when they were listed first further up in the list. So I uncommented both of them further up as well and ran locale-gen again, which now generated both of them twice. Doesn't make any sense to me, but now Prusa Slicer is actually working.
Prusa Slicer won't launch when Norwegian measurement locales are set:
Steps to reproduce:
Using Fedora Workstation 34 with GNOME Shell, set the environment to:
I saw in a previous bug report that the issue was resolved by setting all locales to US English and then back again to the desired locale (in that ticket it was de_DE), but this does not work for nb_NO (and doesn't seem to work for de_DE either).
com.prusa3d.PrusaSlicer.Locale is already installed:
Running the flatpak with LC_ALL=en_US.UTF-8 works, but this is a hassle, and is not something a regular user should have to deal with.