gogs: Cannot start builtin SSH server

  • Gogs version (or commit ref): 0.11.66
  • Git version: 2.18.0
  • Operating system: linux manjaro
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist (usually found in log/gogs.log): 2018/09/23 16:20:54 [TRACE] Log Mode: File (Trace) 2018/09/23 16:20:54 [ INFO] Gogs 0.11.66.0916 2018/09/23 16:20:54 [ INFO] Cache Service Enabled 2018/09/23 16:20:54 [ INFO] Session Service Enabled 2018/09/23 16:20:54 [ INFO] Git Version: 2.18.0

Description

panic: SSH: Fail to parse private key

goroutine 1 [running]:
github.com/gogs/gogs/pkg/ssh.Listen(0xc000481661, 0x7, 0xbd4, 0xc000080360, 0x6, 0x6)
	/home/wyx/go/src/github.com/gogs/gogs/pkg/ssh/ssh.go:182 +0x3a9
github.com/gogs/gogs/routes.GlobalInit()
	/home/wyx/go/src/github.com/gogs/gogs/routes/install.go:93 +0x233
github.com/gogs/gogs/cmd.runWeb(0xc0003012c0, 0x0, 0xc0003012c0)
	/home/wyx/go/src/github.com/gogs/gogs/cmd/web.go:171 +0x6b
github.com/gogs/gogs/vendor/github.com/urfave/cli.HandleAction(0xe51700, 0xfe8cf8, 0xc0003012c0, 0xc0000b2a00, 0x0)
	/home/wyx/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/app.go:483 +0xad
github.com/gogs/gogs/vendor/github.com/urfave/cli.Command.Run(0xf9886d, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfab313, 0x10, 0x0, ...)
	/home/wyx/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/command.go:193 +0x98e
github.com/gogs/gogs/vendor/github.com/urfave/cli.(*App).Run(0xc0003349c0, 0xc0000b6000, 0x2, 0x2, 0x0, 0x0)
	/home/wyx/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/app.go:250 +0x647
main.main()
	/home/wyx/go/src/github.com/gogs/gogs/gogs.go:40 +0x273

my user:wyx

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (8 by maintainers)

Commits related to this issue

Most upvoted comments

+1 This is happening for me on Fedora 28, but not two other servers running CentOS 7

I have also tried deleting the ssh keys. Same error after they regenerated. ssh-keygen verifies they seem valid.

$ yum list installed | grep -i ssh
libssh.x86_64                               0.8.3-1.fc28                @updates
libssh2.x86_64                              1.8.0-7.fc28                @fedora 
openssh.x86_64                              7.8p1-2.fc28                @updates
openssh-clients.x86_64                      7.8p1-2.fc28                @updates
openssh-server.x86_64                       7.8p1-2.fc28                @updates

$ uname --all
Linux services.azazel 4.18.9-200.fc28.x86_64 #1 SMP Thu Sep 20 02:43:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ ./gogs -v
Gogs version 0.11.66.0916

$ ./gogs web
2018/09/27 21:41:46 [TRACE] Custom path: /home/gogs/app/custom
2018/09/27 21:41:46 [TRACE] Log path: /home/gogs/log
2018/09/27 21:41:46 [TRACE] Log Mode: Console (Trace)
2018/09/27 21:41:46 [TRACE] Log Mode: File (Trace)
2018/09/27 21:41:46 [ INFO] Azazel Private Gogs 0.11.66.0916
2018/09/27 21:41:46 [ INFO] Cache Service Enabled
2018/09/27 21:41:46 [ INFO] Session Service Enabled
2018/09/27 21:41:46 [ INFO] Mail Service Enabled
2018/09/27 21:41:46 [ INFO] Register Mail Service Enabled
2018/09/27 21:41:46 [ INFO] Notify Mail Service Enabled
2018/09/27 21:41:47 [ INFO] Git Version: 2.17.1
panic: SSH: Fail to parse private key

goroutine 1 [running]:
github.com/gogs/gogs/pkg/ssh.Listen(0xc4203634e1, 0x7, 0xbce, 0xc42016cd20, 0x6, 0x6)
	/home/gogs/go/src/github.com/gogs/gogs/pkg/ssh/ssh.go:182 +0x3ae
github.com/gogs/gogs/routes.GlobalInit()
	/home/gogs/go/src/github.com/gogs/gogs/routes/install.go:93 +0x22d
github.com/gogs/gogs/cmd.runWeb(0xc42031fe00, 0x0, 0xc42031fe00)
	/home/gogs/go/src/github.com/gogs/gogs/cmd/web.go:171 +0x6a
github.com/gogs/gogs/vendor/github.com/urfave/cli.HandleAction(0xe11040, 0xfb26e8, 0xc42031fe00, 0xc42016ca00, 0x0)
	/home/gogs/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/app.go:483 +0xad
github.com/gogs/gogs/vendor/github.com/urfave/cli.Command.Run(0xf62bfc, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf75699, 0x10, 0x0, ...)
	/home/gogs/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/command.go:193 +0xa35
github.com/gogs/gogs/vendor/github.com/urfave/cli.(*App).Run(0xc420354b60, 0xc4200b2000, 0x2, 0x2, 0x0, 0x0)
	/home/gogs/go/src/github.com/gogs/gogs/vendor/github.com/urfave/cli/app.go:250 +0x700
main.main()
	/home/gogs/go/src/github.com/gogs/gogs/gogs.go:40 +0x2b8