Kallithea issues archive

Issue #369: SSH push fails when LANG and LC_* is sent

Reported by: Benny Prange
State: closed
Created on: 2020-04-21 06:41
Updated on: 2020-06-05 07:43

Description

Hi everyone,

when I am trying to push my commits to the mercurial repository, I get the error message “ssh abort: no suitable response from remote hg!”. This is fixed when I edit my local “/etc/ssh/ssh_conf” and remove the line “SendEnv LANG LC_*”.

I am using Ubuntu 16.04 LTS and hg 5.3.2, the server is running Kallithea 0.5.2 on Debian Buster.

The server's “/etc/ssh/sshd_config” contains the line “AcceptEnv LANG LC_*”. Therefore my guess is that Kallithea is responsible for sending the error message.

Attachments

Comments

Comment by Mads Kiilerich, on 2020-04-22 17:55

Try to look at the end of your .ini file and try to set [ssh_serve:logger_root] level = DEBUG and see what that reports on the client side - especially at the very end (if anything).

It might be related to https://kallithea-scm.org/repos/kallithea/changeset/b5b91e854308 - what ssh_locale do you have in your .ini? Should we perhaps overrule some additional LC_* ?

What do you get when you ssh without kallithea in autorized_keys when running

ssh user@server 'python -c "import os;print(os.environ)"'

Comment by André Klitzing, on 2020-04-23 10:55

We don’t get any special debug output if we switch to level=DEBUG.

ssh_locale = en_GB.UTF-8

{'LANG': 'en_GB.UTF-8', 'SHELL': '/bin/bash', 'XDG_RUNTIME_DIR': '/run/user/1062201243', 'LANGUAGE': 'en_GB:en', 'MAIL': '/var/mail/USERNAME', 'SHLVL': '0', 'SSH_CLIENT': '192.168.100.9 59694 22', 'XDG_SESSION_TYPE': 'tty', 'PWD': '/home/company.local/USERNAME', 'LOGNAME': 'USERNAME', 'USER': 'USERNAME', 'PATH': '/usr/local/bin:/usr/bin:/bin:/usr/games', 'HOME': '/home/company.local/USERNAME', 'SSH_CONNECTION': '192.168.100.9 59694 10.210.248.30 22', 'XDG_SESSION_ID': '30573', 'XDG_SESSION_CLASS': 'user', '_': '/usr/bin/python'}

Comment by André Klitzing, on 2020-04-23 10:56

ssh -vv

debug1: Sending environment. debug1: Sending env LANG = de_DE.UTF-8 debug1: Sending env LC_CTYPE = de_DE.UTF-8 debug1: Sending command: hg -R Group/Reponame serve --stdio

Comment by Mads Kiilerich, on 2020-04-23 12:07

What do you get if you make a plain non-hg ssh matching the authorizedkeys?

If you set ssh_enabled=false, do you get SSH access is disabled.?

Does it make a difference if you in kallithea/bin/kallithea_cli_ssh.py set LC_CTYPE as it sets LC_ALL?

Comment by Mads Kiilerich, on 2020-04-23 13:39

Perhaps first of all: try to add `import sys;sys.stderr.write('hello\n')` right after the #! line in kallithea-cli and see if that shows up when ssh’ing.

If not, experiment with editing authorizedkeys to see if it is possible to launch other (python) commands.

If it shows up, try to add it elsewhere to see how far Kallithea gets started before the sudden death.