Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH server: overflow reading version string #6882

Closed
1 task done
wideweide opened this issue Mar 31, 2022 · 11 comments
Closed
1 task done

SSH server: overflow reading version string #6882

wideweide opened this issue Mar 31, 2022 · 11 comments
Labels
💊 bug Something isn't working
Milestone

Comments

@wideweide
Copy link

wideweide commented Mar 31, 2022

Gogs version

0.12.6

Git version

  • Server: git version 2.19.1.windows.1
  • Client: git version 2.28.0.windows.1

Operating system

windows 10

Database

MySQL 5.6

Describe the bug

Start gogs, SSH pull and synchronization codes are normal, but they are abnormal after a few days of use, restart gogs will be ok。
the error info:
client:
Gogs: Internal error
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

Server:

xorm.log:  Table user has column login_type but struct has not related field
gogs.log
2022/03/31 00:10:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 00:10:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 00:30:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 00:30:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 00:30:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 00:34:26 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 02:15:37 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 02:55:21 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 03:44:51 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 03:44:52 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 03:56:13 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 03:56:34 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/03/31 03:56:48 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/03/31 03:56:59 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/03/31 03:57:11 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/03/31 03:57:26 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 03:57:38 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/03/31 04:59:19 [ WARN] SSH: Handshaking was terminated: EOF
2022/03/31 08:03:26 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:10:45 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:11:07 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:11:58 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:16:43 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:23:26 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:30:45 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:31:07 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:36:44 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:43:26 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:44:08 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:44:08 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:44:12 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:49:42 [ERROR] [gogs.io/gogs/internal/ssh/ssh.go:114 func1()] SSH: Wait: exit status 1
2022/03/31 08:50:13 [ INFO] Gogs 0.12.6

To reproduce

Maybe update from Gogs version 0.11.53.0603 to 0.12.4 then 0.12.6

Expected behavior

can be used well forever ...

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@wideweide wideweide added the 💊 bug Something isn't working label Mar 31, 2022
@unknwon unknwon added status: needs reproduce Wait, how did that happen? 🙇‍♂️ help wanted Need your help labels Mar 31, 2022
@wideweide
Copy link
Author

I am not sure how to reproduce ...
Now I try to upgrade git from 2.19.1 to 2.35.1.2 ..

@unknwon
Copy link
Member

unknwon commented Mar 31, 2022

My best guess is that... it's just the implementation of the builtin SSH needs an overhaul... 🤦‍♂️

@unknwon unknwon changed the title overflow reading version string SSH server: overflow reading version string Mar 31, 2022
@wideweide
Copy link
Author

upgrade git to 2.35.1,then restart gogs
after 22 hours, the error produced...
Temporarily use the task scheduler timer restart it

@unknwon
Copy link
Member

unknwon commented Apr 1, 2022

I just did a naive mod update in #6884, which sometimes fix the issue, but it only lands on 0.13.0+dev though. If you're going to try out 0.13, watch out the changelog: https://github.com/gogs/gogs/blob/main/CHANGELOG.md#0130dev-main

@wideweide
Copy link
Author

git clone git@github.com:gogs/gogs.git
go build # win10,85M
copy to winserver 2016,replace old version
can not start,console info:
2022/04/01 12:07:30 [FATAL] [...o/gogs/internal/route/install.go:75 GlobalInit()] Failed to initialize ORM engine: open database: failed to connect to host=127.0.0.1 user=usera database=gogs: failed to receive message (unknown message type: J)

I use mysql5.6

Is there something wrong in my build ?

@unknwon
Copy link
Member

unknwon commented Apr 1, 2022

If you're going to try out 0.13, watch out the changelog: https://github.com/gogs/gogs/blob/main/CHANGELOG.md#0130dev-main

:) in particular, the Removed section.

@wideweide
Copy link
Author

If you're going to try out 0.13, watch out the changelog: https://github.com/gogs/gogs/blob/main/CHANGELOG.md#0130dev-main

:) in particular, the Removed section.

thanks ,I got it

Next just wait for the verification

@wideweide
Copy link
Author

It seems work well, there is some error info also

2022/04/04 02:21:29 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 02:22:45 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 02:24:00 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 02:38:50 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured]
2022/04/04 02:46:36 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured, ssh: password auth not configured, ssh: password auth not configured]
2022/04/04 03:32:21 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured]
2022/04/04 04:37:09 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/04 04:37:09 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/04 04:37:09 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 04:37:09 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/04 04:37:09 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/04 04:37:09 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 08:26:49 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 11:40:53 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 11:42:17 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 11:43:40 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 11:45:05 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 12:56:50 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 15:26:13 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 16:10:06 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:174 func1()] SearchPublicKeyByContent: public key does not exist [id: 0]
2022/04/04 16:10:06 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:174 func1()] SearchPublicKeyByContent: public key does not exist [id: 0]
2022/04/04 18:32:31 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 18:36:56 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: disconnect, reason 11: Client disconnecting normally
2022/04/04 21:23:38 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/04 22:37:33 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: disconnect, reason 11: Normal Shutdown, Thank you for playing
2022/04/04 23:54:27 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 02:10:17 [ WARN] SSH: Handshaking was terminated: EOF

2022/04/05 02:37:10 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 04:06:13 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 04:28:02 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured, ssh: password auth not configured, ssh: password auth not configured]
2022/04/05 05:12:33 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 07:33:17 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 07:34:35 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 07:35:52 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 07:37:10 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 08:09:49 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 08:44:44 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/05 08:44:44 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/05 08:44:44 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 08:44:44 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/05 08:44:44 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: ssh: overflow reading version string
2022/04/05 08:44:45 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 09:29:31 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 10:56:00 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 12:06:37 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 16:23:12 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 20:32:49 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:174 func1()] SearchPublicKeyByContent: public key does not exist [id: 0]
2022/04/05 20:32:49 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:174 func1()] SearchPublicKeyByContent: public key does not exist [id: 0]
2022/04/05 21:21:27 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/05 21:21:29 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 01:37:35 [ WARN] SSH: Handshaking was terminated: EOF

2022/04/06 01:42:04 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 01:43:15 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 02:39:05 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 02:40:26 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 02:41:48 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 02:43:10 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 02:44:53 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 04:31:13 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured]
2022/04/06 04:48:57 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 05:05:50 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 06:27:03 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 06:35:46 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 06:37:11 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 06:38:33 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 06:39:51 [ WARN] SSH: Handshaking was terminated: EOF
2022/04/06 07:32:57 [ WARN] SSH: Handshaking was terminated: EOF


@unknwon
Copy link
Member

unknwon commented Apr 6, 2022

Nice! Looks like this did the trick (again).

As for the EOFs, looks like someone or program is "attacking" to your server(?) based on:

2022/04/06 04:31:13 [ERROR] [...urce/go/gogs/internal/ssh/ssh.go:151 func1()] SSH: Error on handshaking: [ssh: password auth not configured]

@unknwon unknwon removed status: needs reproduce Wait, how did that happen? 🙇‍♂️ help wanted Need your help labels Apr 6, 2022
@unknwon unknwon added this to the 0.12.7 milestone Apr 6, 2022
@unknwon
Copy link
Member

unknwon commented Apr 6, 2022

Going to back port this to 0.12.7.

@unknwon unknwon closed this as completed Apr 6, 2022
@unknwon
Copy link
Member

unknwon commented May 5, 2022

The 0.12.7 has been released that includes the patch of the reported issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy