Ssh is discnnected by user with Gitea internal error #7890

Closed
opened 2025-11-02 07:40:29 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wusikijeronii on GitHub (Sep 23, 2021).

Gitea Version

1.5.3

Git Version

No response

Operating System

Docker image

How are you running Gitea?

I use docker image

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

When I connect via ssh I get the error:

Authenticated to homedatasrv.ru ([95.165.107.160]:22) using "publickey".
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: filesystem full
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: client_input_hostkeys: received ED25519 key SHA256:lkpgXgWnsOANHbb/jPypV+aRw1YBI7kfG4N6e+fAmRo
debug3: client_input_hostkeys: received RSA key SHA256:Lb6011ey6pYX2uwAfZHPfZcpdQCdSQrlbnOu8ikY7Os
debug3: client_input_hostkeys: received ECDSA key SHA256:i3C8vM0q6kp4TWXUqUd9JzPCUID3y9HXmuvmKtILdJ4
debug3: client_input_hostkeys: received DSA key SHA256:5oJs67LF4981LltdjjXQTrwI7Od6qrdd2WnzJbqkW+E
debug3: client_input_hostkeys: ssh-dss key not permitted by HostkeyAlgorithms
debug1: client_input_hostkeys: searching /home/aleksey/.ssh/known_hosts for homedatasrv.ru / (none)
debug3: hostkeys_foreach: reading file "/home/aleksey/.ssh/known_hosts"
debug3: hostkeys_find: found ssh-ed25519 key at /home/aleksey/.ssh/known_hosts:7
debug3: hostkeys_find: found ssh-rsa key at /home/aleksey/.ssh/known_hosts:8
debug3: hostkeys_find: found ecdsa-sha2-nistp256 key at /home/aleksey/.ssh/known_hosts:9
debug1: client_input_hostkeys: searching /home/aleksey/.ssh/known_hosts2 for homedatasrv.ru / (none)
debug1: client_input_hostkeys: hostkeys file /home/aleksey/.ssh/known_hosts2 does not exist
debug3: client_input_hostkeys: 3 server keys: 0 new, 3 retained, 0 incomplete match. 0 to remove
debug1: client_input_hostkeys: no new or deprecated keys from server
debug3: receive packet: type 4
debug1: Remote: /data/git/.ssh/authorized_keys:2: key options: command user-rc
debug3: receive packet: type 4
debug1: Remote: /data/git/.ssh/authorized_keys:2: key options: command user-rc
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: set_sock_tos: set socket 3 IP_TOS 0x48
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug3: send packet: type 98
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug3: receive packet: type 100
debug2: channel_input_status_confirm: type 100 id 0
PTY allocation request failed on channel 0
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
debug2: channel 0: rcvd ext data 22
debug2: channel 0: rcvd ext data 22

Gitea: Internal error
Gitea: Internal error
debug2: channel 0: written 44 to efd 6
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1)

debug3: send packet: type 1
Connection to homedatasrv.ru closed.
Transferred: sent 2488, received 3076 bytes, in 0.3 seconds
Bytes per second: sent 9530.7, received 11783.2
debug1: Exit status 1

Gitea log:

gitea | Accepted publickey for git from 172.16.0.29 port 18156 ssh2: ED25519 SHA256:JWL4pxjv2NJ6DgI3LZz2AzVu+TvbK7b9vF8OcfCvZtE
gitea | Received disconnect from 172.16.0.29 port 18156:11: disconnected by user
gitea | Disconnected from user git 172.16.0.29 port 18156

I tried to use RSA and ed25519. I tried:

  • Update the '.ssh/authorized_keys' file with Gitea SSH keys.
  • Update the '.ssh/authorized_principals' file with Gitea SSH principals.

I also tried to make same actions on https://try.gitea.io/. I've created a new account and added ssh key in user settings. Cloning was successful.

I've seen some similar issues since 2017 but I didn't saw any solution.

Ssh works fine with other resources (GitLab, Linux server, etc)

About permissions. I set git as a user and chmod 777 to ssh folder but when I restart docker-compose ssh get next permissions:

root@homesrv1:~/gitea/data/ssh# ls -l
итого 32
-rw------- 1 root root 1381 сен 21 20:01 ssh_host_dsa_key
-rw------- 1 root root  607 сен 21 20:01 ssh_host_dsa_key.pub
-rw------- 1 root root  513 сен 21 20:01 ssh_host_ecdsa_key
-rw------- 1 root root  179 сен 21 20:01 ssh_host_ecdsa_key.pub
-rw------- 1 root root  411 сен 21 20:01 ssh_host_ed25519_key
-rw------- 1 root root   99 сен 21 20:01 ssh_host_ed25519_key.pub
-rw------- 1 root root 1823 сен 21 20:01 ssh_host_rsa_key
-rw------- 1 root root  399 сен 21 20:01 ssh_host_rsa_key.pub

I've changed permissions by docker exec but it didn't help

Originally created by @wusikijeronii on GitHub (Sep 23, 2021). ### Gitea Version 1.5.3 ### Git Version _No response_ ### Operating System Docker image ### How are you running Gitea? I use docker image ### Database PostgreSQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description When I connect via ssh I get the error: ``` Authenticated to homedatasrv.ru ([95.165.107.160]:22) using "publickey". debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug3: send packet: type 90 debug1: Requesting no-more-sessions@openssh.com debug3: send packet: type 80 debug1: Entering interactive session. debug1: pledge: filesystem full debug3: receive packet: type 80 debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug3: client_input_hostkeys: received ED25519 key SHA256:lkpgXgWnsOANHbb/jPypV+aRw1YBI7kfG4N6e+fAmRo debug3: client_input_hostkeys: received RSA key SHA256:Lb6011ey6pYX2uwAfZHPfZcpdQCdSQrlbnOu8ikY7Os debug3: client_input_hostkeys: received ECDSA key SHA256:i3C8vM0q6kp4TWXUqUd9JzPCUID3y9HXmuvmKtILdJ4 debug3: client_input_hostkeys: received DSA key SHA256:5oJs67LF4981LltdjjXQTrwI7Od6qrdd2WnzJbqkW+E debug3: client_input_hostkeys: ssh-dss key not permitted by HostkeyAlgorithms debug1: client_input_hostkeys: searching /home/aleksey/.ssh/known_hosts for homedatasrv.ru / (none) debug3: hostkeys_foreach: reading file "/home/aleksey/.ssh/known_hosts" debug3: hostkeys_find: found ssh-ed25519 key at /home/aleksey/.ssh/known_hosts:7 debug3: hostkeys_find: found ssh-rsa key at /home/aleksey/.ssh/known_hosts:8 debug3: hostkeys_find: found ecdsa-sha2-nistp256 key at /home/aleksey/.ssh/known_hosts:9 debug1: client_input_hostkeys: searching /home/aleksey/.ssh/known_hosts2 for homedatasrv.ru / (none) debug1: client_input_hostkeys: hostkeys file /home/aleksey/.ssh/known_hosts2 does not exist debug3: client_input_hostkeys: 3 server keys: 0 new, 3 retained, 0 incomplete match. 0 to remove debug1: client_input_hostkeys: no new or deprecated keys from server debug3: receive packet: type 4 debug1: Remote: /data/git/.ssh/authorized_keys:2: key options: command user-rc debug3: receive packet: type 4 debug1: Remote: /data/git/.ssh/authorized_keys:2: key options: command user-rc debug3: receive packet: type 91 debug2: channel_input_open_confirmation: channel 0: callback start debug2: fd 3 setting TCP_NODELAY debug3: set_sock_tos: set socket 3 IP_TOS 0x48 debug2: client_session2_setup: id 0 debug2: channel 0: request pty-req confirm 1 debug3: send packet: type 98 debug2: channel 0: request shell confirm 1 debug3: send packet: type 98 debug2: channel_input_open_confirmation: channel 0: callback done debug2: channel 0: open confirm rwindow 0 rmax 32768 debug3: receive packet: type 100 debug2: channel_input_status_confirm: type 100 id 0 PTY allocation request failed on channel 0 debug2: channel 0: rcvd adjust 2097152 debug3: receive packet: type 99 debug2: channel_input_status_confirm: type 99 id 0 debug2: shell request accepted on channel 0 debug2: channel 0: rcvd ext data 22 debug2: channel 0: rcvd ext data 22 Gitea: Internal error Gitea: Internal error debug2: channel 0: written 44 to efd 6 debug3: receive packet: type 96 debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write]) debug2: channel 0: output drain -> closed debug3: receive packet: type 98 debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug3: receive packet: type 98 debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0 debug2: channel 0: rcvd eow debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write]) debug2: channel 0: input open -> closed debug3: receive packet: type 97 debug2: channel 0: rcvd close debug3: channel 0: will not send data after close debug2: channel 0: almost dead debug2: channel 0: gc: notify user debug2: channel 0: gc: user detached debug2: channel 0: send close debug3: send packet: type 97 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: client-session, nchannels 1 debug3: channel 0: status: The following connections are open: #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1) debug3: send packet: type 1 Connection to homedatasrv.ru closed. Transferred: sent 2488, received 3076 bytes, in 0.3 seconds Bytes per second: sent 9530.7, received 11783.2 debug1: Exit status 1 ``` Gitea log: > gitea | Accepted publickey for git from 172.16.0.29 port 18156 ssh2: ED25519 SHA256:JWL4pxjv2NJ6DgI3LZz2AzVu+TvbK7b9vF8OcfCvZtE gitea | Received disconnect from 172.16.0.29 port 18156:11: disconnected by user gitea | Disconnected from user git 172.16.0.29 port 18156 I tried to use RSA and ed25519. I tried: * Update the '.ssh/authorized_keys' file with Gitea SSH keys. * Update the '.ssh/authorized_principals' file with Gitea SSH principals. I also tried to make same actions on https://try.gitea.io/. I've created a new account and added ssh key in user settings. Cloning was successful. I've seen some similar issues since 2017 but I didn't saw any solution. Ssh works fine with other resources (GitLab, Linux server, etc) About permissions. I set git as a user and chmod 777 to ssh folder but when I restart docker-compose ssh get next permissions: ```shell root@homesrv1:~/gitea/data/ssh# ls -l итого 32 -rw------- 1 root root 1381 сен 21 20:01 ssh_host_dsa_key -rw------- 1 root root 607 сен 21 20:01 ssh_host_dsa_key.pub -rw------- 1 root root 513 сен 21 20:01 ssh_host_ecdsa_key -rw------- 1 root root 179 сен 21 20:01 ssh_host_ecdsa_key.pub -rw------- 1 root root 411 сен 21 20:01 ssh_host_ed25519_key -rw------- 1 root root 99 сен 21 20:01 ssh_host_ed25519_key.pub -rw------- 1 root root 1823 сен 21 20:01 ssh_host_rsa_key -rw------- 1 root root 399 сен 21 20:01 ssh_host_rsa_key.pub ``` I've changed permissions by docker exec but it didn't help
Author
Owner

@wusikijeronii commented on GitHub (Sep 23, 2021):

I've read the docker manual again. Wrong line in config:

LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/

@wusikijeronii commented on GitHub (Sep 23, 2021): I've read the docker manual again. Wrong line in config: > LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7890