使用docker新搭建的gogs,无法推送

Gogs 版本:0.12.0+dev
Git version:2.22.2
Go version:go1.13.8
数据库:mysql 5.7
问题描述:

使用docker搭建的gogs,新建仓库出现无法推送的问题,查询整个论坛没找到相关的解决方案。日志如下:

[email protected]:~# tail -f gogs/gogs/log/gogs.log 
2020/03/01 07:08:21 [ INFO] Gogs 0.12.0+dev
2020/03/01 07:08:21 [ INFO] SQLite3 is supported
2020/03/01 07:08:21 [ INFO] Run mode: Production
2020/03/01 07:08:21 [ INFO] Listen on http://0.0.0.0:3000
2020/03/01 07:11:13 [ERROR] [...s@/internal/route/repo/editor.go:281 editFilePost()] Failed to update repo file: git push origin master: exit status 1 - remote: panic: runtime error: invalid memory address or nil pointer dereference        
remote: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10b16cf]        
remote: 
remote: goroutine 1 [running]:        
remote: gogs.io/gogs/internal/cmd.setup(0xc0000c0b00, 0x141c9bf, 0x15, 0x1)        
remote:         gogs.io/[email protected]/internal/cmd/serv.go:71 +0x14f        
remote: gogs.io/gogs/internal/cmd.runHookPreReceive(0xc0000c0b00, 0x0, 0xc000270930)        
remote:         gogs.io/[email protected]/internal/cmd/hook.go:70 +0x82        
remote: github.com/urfave/cli.HandleAction(0x124e6c0, 0x1ce2cb8, 0xc0000c0b00, 0xc0000c0b00, 0x0)        
remote:         github.com/urfave/[email protected]/app.go:523 +0xbe        
remote: github.com/urfave/cli.Command.Run(0x1408044, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0x142ce6b, 0x1d, 0x0, ...)        
remote:         github.com/urfave/[email protected]/command.go:174 +0x51c        
remote: github.com/urfave/cli.(*App).RunAsSubcommand(0xc000188e00, 0xc0000c0840, 0x0, 0x0)        
remote:         github.com/urfave/[email protected]/app.go:404 +0x869        
remote: github.com/urfave/cli.Command.startApp(0x13fa093, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1443668, 0x2c, 0x0, ...)        
remote:         github.com/urfave/[email protected]/command.go:329 +0x845        
remote: github.com/urfave/cli.Command.Run(0x13fa093, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1443668, 0x2c, 0x0, ...)        
remote:         github.com/urfave/[email protected]/command.go:102 +0x9ca        
remote: github.com/urfave/cli.(*App).Run(0xc000188c40, 0xc0000ac000, 0x4, 0x4, 0x0, 0x0)        
remote:         github.com/urfave/[email protected]/app.go:276 +0x718        
remote: main.main()        
remote:         gogs.io/[email protected]/gogs.go:39 +0x27a        
To /data/git/gogs-repositories/dongsheng/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '/data/git/gogs-repositories/dongsheng/test.git'
^C

你好,感谢反馈!

修复已经推送:https://github.com/gogs/gogs/commit/7382c23a17cad73c137e9bca66be0cd1b04b75fd

Docker 需要耐心等待 20 分钟左右~

多谢回复,晚上我会再次尝试。

亲测已经可以使用~

可以正常工作了,感谢。