How to fix Flameshot crashes related to locale

TL;DR: If you’re mixing any kind of formats with your units, make sure you uncomment them in addition to your main locale in your /etc/locale.gen then run sudo locale-gen.

So for a bit, flameshot has crashed on me consistently whenever I’d select part of the screen then try to save it, open the clip in another program or upload it online. Looked in my logs and saw this:

Nov 19 23:29:04 systemd[3732]: Started flameshot.
Nov 19 23:29:04 dbus-daemon[3763]: [session uid=1000 pid=3763] Activating service name='org.dharkael.Flameshot' requested by ':1.8046' (uid=1000 pid=216341 comm="/usr/local/bin/flameshot gui ")
Nov 19 23:29:04 flameshot[216344]: Icon theme "gnome" not found.
Nov 19 23:29:04 flameshot[216344]: Icon theme "ubuntu-mono-dark" not found.
Nov 19 23:29:04 flameshot[216344]: Icon theme "Mint-X" not found.
Nov 19 23:29:04 flameshot[216344]: Icon theme "elementary" not found.
Nov 19 23:29:04 flameshot[216344]: Icon theme "gnome" not found.
Nov 19 23:29:04 dbus-daemon[3763]: [session uid=1000 pid=3763] Successfully activated service 'org.dharkael.Flameshot'
Nov 19 23:29:04 systemd[3732]: app-flameshot-49ffb1f50fef4f1e8cc50c613d1d794f.scope: Succeeded.
Nov 19 23:29:06 flameshot[216344]: QPainter::begin: Paint device returned engine == 0, type: 2
Nov 19 23:29:06 flameshot[216344]: QPainter::setRenderHint: Painter must be active to set rendering hints
Nov 19 23:29:06 flameshot[216344]: QPainter::setCompositionMode: Painter not active
Nov 19 23:29:06 flameshot[216344]: QPainter::translate: Painter not active
Nov 19 23:29:06 flameshot[216344]: QPainter::setPen: Painter not active
Nov 19 23:29:06 flameshot[216344]: QPainter::setBrush: Painter not active
Nov 19 23:29:06 flameshot[216344]: QPainter::setBrush: Painter not active
Nov 19 23:29:07 flameshot[216344]: libpng warning: iCCP: known incorrect sRGB profile
Nov 19 23:29:07 flameshot[216344]: libpng warning: iCCP: known incorrect sRGB profile
Nov 19 23:29:07 flameshot[216344]: libpng warning: iCCP: known incorrect sRGB profile
Nov 19 23:29:08 org.dharkael.Flameshot[216344]: terminate called after throwing an instance of 'std::runtime_error'
Nov 19 23:29:08 org.dharkael.Flameshot[216344]:   what():  locale::facet::_S_create_c_locale name not valid

So I figured my locale got screwed up. Made sure en_US.UTF-8 UTF-8 was uncommented in my /etc/locale.gen and ran sudo locale-gen but I still had crashes. Then I tried export LC_ALL="en_US.UTF-8", no luck.

Then I read this issue on the Flameshot github and realized that I set my time format in KDE to en_GB since I want the proper 24h clock.

So I also uncommented en_GB.UTF-8 UTF-8 in /etc/locale.gen then ran sudo locale-gen again and viola my problem was solved.

4 Likes

?

5 Likes

Yes! A viola just like the one pictured popped out of my tower. How did you know?

3 Likes

voilà

or voi·la

[ vwah-lah; French vwa-la ]SHOW IPA

interjection

(used to express success or satisfaction):Voilà, my new winter outfit!

viola

1

[ vee-oh-luh ]SHOW IPA

noun

a four-stringed musical instrument of the violin family, slightly larger than the violin; a tenor or alto violin.

a labial organ stop of eight-foot or four-foot pitch, giving tones of a penetrating stringlike quality.

:sweat_smile:

1 Like

yes yes, it was a typo

1 Like

Oh - the horror! Imagine that on a text-based forum for a text-based distro! :rofl:

3 Likes