![]() |
[How to do instruction] Error when login as pi - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9) +--- Thread: [How to do instruction] Error when login as pi (/showthread.php?tid=3230) |
Error when login as pi - UpsiUps - 12-07-2020 Hi, when you currently login outside of GB into the pi account you will get an error like this: -bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8) to get rid of this error do the following steps: sudo vi /etc/locale.gen Search your locale setting ( e.g. de_DE.UTF-8) and un-comment that line (delete the '#' ) and save the file ( you could keep en_GB.UTF-8) then let your locales generate by : sudo locale-gen you will see something like: Generating locales (this might take a while)... de_DE.UTF-8... done en_GB.UTF-8... done Generation complete. RE: Error when login as pi - Tim Curtis - 12-07-2020 I'm located in US and thus outside of GB. How can I reproduce this ? RE: Error when login as pi - UpsiUps - 12-07-2020 (12-07-2020, 01:46 PM)Tim Curtis Wrote: I'm located in US and thus outside of GB. just login as user pi through ssh and you will normal get this error. Especially when you have setup LC_ALL or LC_CTYPE in your remote environment. ssh is passing that environment partial to the client ( moode) Or you try to set us_US.UTF-8 or something like us_..... as LANG in your profile ( .bashrc ) As the locale files are growing more and more, the standard setup of RPi has not all locale included. So in case you are not out of the country of RPi you need to setup and create your own locale. Hope that helps ? RE: Error when login as pi - Tim Curtis - 12-07-2020 I've never seen this on stock moOde and I don't recall any trouble reports of anything like this. RE: Error when login as pi - TheOldPresbyope - 12-07-2020 The OP asserts Quote:just login as user pi through ssh and you will normal get this error. Especially when you have setup LC_ALL or LC_CTYPE in your remote environment. ssh is passing that environment partial to the client ( moode) Actually, the ssh man page says (Linux Mint and RaspiOS, both based ultimately on Debian): Code: ssh will normally set the following environment variables: and on the moOde player, the sshd_config man page says Code: PermitUserEnvironment Examining the /etc/ssh/sshd_conf file on the moOde player, I see the option in question is commented out Code: #PermitUserEnvironment no hence, sshd chooses "no" by default. I conclude the OP has been changing settings. ===== As a check, first a look at my stock moOde player: Code: pi@moode3a:~ $ locale While for my Linux Mint box Code: kreed@xenon:~$ locale As expected from my reading of the man pages, and as Tim said, I don't see the issue when I ssh to a stock moOde player from the Linux Mint box. ====== Certainly one can get into interesting situations with locale settings. My thought is, wait for the problem actually to arise and then try the OP's solution. Regards, Kent RE: Error when login as pi - UpsiUps - 12-08-2020 I don't have ssh environment setup on my moode players. So e.g. the LANG is not set from ssh. I also tried to setup LANG on my host before ssh'ed to the Moode RPI: there LANG was again en_GB.UTF-8, so the ssh environment is not used without a special setup in .ssh/config or /etc/ssh/sshd_conf. I have not changed that setting yet, but will to prevent password challanges.(diffrent story) As I am using zsh, I am no expert of bash. In zsh, there are some global configuration files like /etc/zshenv where you normaly setup such Lxx environment. Maybe that is the same case for bash. A second guess is, as I change my keyboard layout in moode to DE, Moode/Phyton maybe is changing some locales. Anyhow, my intend was: if somebody has this error, when she is using ssh to connect, ,she could easy follow my instruction to create the required locale. After that setup, the error is gone. (in the moode image, only en_GB.UTF-8 exists) No blames, no fingerpointing; just a thread I thought that will fit under FAQ and guides I don't want to remind you about the mars rover that crashed during landing as the software out of GB was using metric , while US has used inch - some locales really make the diffrence : ![]() RE: Error when login as pi - the_bertrum - 12-08-2020 I tried setting the keyboard to DE on my player, I see no errors about locale. It would be great to track down what's setting this in your system. RE: Error when login as pi - UpsiUps - 12-08-2020 (12-08-2020, 10:00 AM)the_bertrum Wrote: I tried setting the keyboard to DE on my player, I see no errors about locale. It would be great to track down what's setting this in your system. Hmm, I grep'ed all bash files in /etc and ~/ and have not received any hint on locale or setting LC_ALL PAM is reading and setting /etc/default/locale Code: cat /etc/default/locale what explains , why en_GB.UTF-8 is the standard. This is also created by /usr/bin/raspi-config - do_change_locale() As the error was posted by bash, I assume BASH is the source. I cant verify, but /usr/share/bash-completetion/completions/localectl will change locale. If this completion is read by bash at the beginning is not something I know ( remember I am using zsh) I only can say theerror was always right after the connection to my moode-hw's with ssh. "Was" as this is a) fixed with the generation of the locale and b) no longer relevant for my usage as I installed and switched to my lovely homeshell zsh ![]() RE: Error when login as pi - UpsiUps - 12-10-2020 Beside what I have written, there is another default in the OS: the file /etc/ssh/sshd_configj contains as standard # Allow client to pass locale environment variables AcceptEnv LANG LC_* Now saying that , you normally must use 'SetEnv' to set these vars in the ssh_config - which is also a standard in /etc/ssh/ssh_config So that could be also the source of the error Intersting: if you have enabled PAM in sshd_config ( by UsePAM yes - which is standard) and you have also PermitUserEnvironment no then ssh will not read /etc/environment BUT PAM will do so ![]() ( PAM will also allow passwords even when you only allow PublicKey Authentication in sshd_config ) Both are standards in PAM on every system RE: Error when login as pi - TheOldPresbyope - 12-10-2020 The wonderful thing about Linux is that there is more than one way to do anything and they are often conflicting/contradictory ways ![]() We know moOde is built on stock Raspberry Pi OS Lite and inherits from it such things as the GB locale (cuz, you know. the RPF is in England and proud of it)---not to mention the ssh/d, PAM, and other configurations. So far, the few of us who have responded here have been able to replicate your logon experience nor have users mentioned it on the forum before but, sure enough, I searched the InterWeb and my first hit was a blog entry from 6 years ago Fixing Your Locale on Raspberry Pi. I'm content to let the first post in this thread be the guide for folks who sail into this particular rock. Regards, Kent |