Gitlab S SH: не удалось получить имя пользователя: внутренняя ошибка API (500) - PullRequest
1 голос
/ 11 января 2020

Я установил GitLab из Arch Linux хранилище и добавил ключ S SH для пользователя, как описано здесь и ArchWiki . Сначала GitLab не добавил ключ к /var/lib/gitlab/.ssh/authorized_keys (домашний каталог пользователя gitlab). Разработчики пакетов забыли изменить параметр authorized_keys_file в gitlab.yml. Я исправил это. Теперь, когда я пытаюсь подключиться, я получаю следующее:

$ ssh -vT gitlab@localhost
OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/user1/.ssh/id_rsa type 0
debug1: identity file /home/user1/.ssh/id_rsa-cert type -1
debug1: identity file /home/user1/.ssh/id_dsa type -1
debug1: identity file /home/user1/.ssh/id_dsa-cert type -1
debug1: identity file /home/user1/.ssh/id_ecdsa type -1
debug1: identity file /home/user1/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user1/.ssh/id_ed25519 type -1
debug1: identity file /home/user1/.ssh/id_ed25519-cert type -1
debug1: identity file /home/user1/.ssh/id_xmss type -1
debug1: identity file /home/user1/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.1
debug1: match: OpenSSH_8.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'gitlab'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:Z2mmD/K3tW9k25gNrpTgUefT94vbNXaUDcmWfd6o7v0
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/user1/.ssh/known_hosts:11
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/user1/.ssh/id_rsa RSA SHA256:Orfy0Kb/fAtiHmKVQJSovjHOg5b2TDSvQQ/dVh97RWQ
debug1: Will attempt key: /home/user1/.ssh/id_dsa
debug1: Will attempt key: /home/user1/.ssh/id_ecdsa
debug1: Will attempt key: /home/user1/.ssh/id_ed25519
debug1: Will attempt key: /home/user1/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/user1/.ssh/id_rsa RSA SHA256:Orfy0Kb/fAtiHmKVQJSovjHOg5b2TDSvQQ/dVh97RWQ
debug1: Server accepts key: /home/user1/.ssh/id_rsa RSA SHA256:Orfy0Kb/fAtiHmKVQJSovjHOg5b2TDSvQQ/dVh97RWQ
debug1: Authentication succeeded (publickey).
Authenticated to localhost ([::1]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: /var/lib/gitlab/.ssh/authorized_keys:1: key options: command user-rc
debug1: Remote: /var/lib/gitlab/.ssh/authorized_keys:1: key options: command user-rc
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Remote: X11 forwarding disabled by key options.
X11 forwarding request failed on channel 0
remote:
remote: ========================================================================
remote:
remote: Failed to get username: Internal API error (500)
remote:
remote: ========================================================================
remote:
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3176, received 3248 bytes, in 0.2 seconds
Bytes per second: sent 12932.5, received 13225.7
debug1: Exit status 1
# /var/log/gitlab/production.log:
ArgumentError (wrong number of arguments (given 3, expected 1..2)):

lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:13:in `call'
lib/gitlab/middleware/correlation_id.rb:16:in `block in call'
lib/gitlab/middleware/correlation_id.rb:15:in `call'
lib/gitlab/middleware/multipart.rb:117:in `call'
lib/gitlab/middleware/read_only/controller.rb:48:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/request_context.rb:32:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

Выглядит как ошибка, но я не нахожу ничего связанного с Google.

gitlab 12.6.2-3, git 2.24.1-4, gitlab-gitaly 1.78.0-2, gitlab-shell 2:10.3.0-2, ruby 2.7.0-1, openssh 8.1p1-2

...