LucienShui / PasteMe

PasteMe 是一个无需注册的文本分享平台(未登陆状态下只能使用阅后即焚),可以为文本设置密码和阅后即焚,支持二维码分享和各种一键复制,针对代码提供了额外的高亮功能。
https://pasteme.cn
GNU General Public License v3.0
1.18k stars 153 forks source link

后端api502 #126

Closed vihor3 closed 1 year ago

vihor3 commented 2 years ago

访问前端后提示如下

{"message":"Request failed with status code 502","method":"get","url":"/api/v3/","params":{"method":"beat"}}

并且后端的镜像似乎部署不正常 docker ps -a提示如下

7838cabaebf6   pasteme/go-backend:3.5.1   "/usr/bin/env sh /us…"   4 minutes ago   Restarting (2) 18 seconds ago                                                       pasteme-backend
LucienShui commented 2 years ago

可否执行 docker logs pasteme-backend,提供下日志。

hotzzzzy commented 2 years ago

docker logs pasteme-backend

{"level":"panic","ts":1634904295.0557005,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc00031dd40, 0xc000358380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc0003939e0, 0xca8cf1, 0x16, 0xc000358380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc0003a7660, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003fe4e8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904295.8845227,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002cfd40, 0xc00032a300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000345800, 0xca8cf1, 0x16, 0xc00032a300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000357600, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003ac488, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904296.4899263,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc00040c180, 0xc000070180, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000022480, 0xca8cf1, 0x16, 0xc000070180, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc0000583a0, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc000026ac8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904297.3133163,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0003b0180, 0xc000396100, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000380360, 0xca8cf1, 0x16, 0xc000396100, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc00038a300, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc000388a68, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904298.5098023,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002c9d40, 0xc00032c300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000345800, 0xca8cf1, 0x16, 0xc00032c300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000353560, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003aa448, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904300.50642,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc00040c180, 0xc000070180, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000022540, 0xca8cf1, 0x16, 0xc000070180, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000058380, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc000026ac8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904304.1569335,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc00040a180, 0xc000072100, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc0000225a0, 0xca8cf1, 0x16, 0xc000072100, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000058380, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc000026aa8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904310.9714568,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002d3d40, 0xc000326380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc0003438c0, 0xca8cf1, 0x16, 0xc000326380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000355640, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003ac4b8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904324.1960385,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002d9d40, 0xc00031a300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc0003416e0, 0xca8cf1, 0x16, 0xc00031a300, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc000351540, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003ac488, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904350.2025368,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002d1d40, 0xc000336380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc000347920, 0xca8cf1, 0x16, 0xc000336380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc00035b620, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc0003ac4c8, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55 {"level":"panic","ts":1634904401.81041,"caller":"config/config.go:49","msg":"invalid Config version","valid_config_version_list":["3.3.0",""],"config_version":"3.4.0","stacktrace":"github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49\ngithub.com/PasteUs/PasteMeGoBackend/common/config.init.0\n\t/go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6315\nruntime.doInit\n\t/usr/local/go/src/runtime/proc.go:6292\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:208"} panic: invalid Config version

goroutine 1 [running]: go.uber.org/zap/zapcore.(CheckedEntry).Write(0xc0002afd40, 0xc00032c380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/zapcore/entry.go:232 +0x532 go.uber.org/zap.(Logger).Panic(0xc0003099e0, 0xca8cf1, 0x16, 0xc00032c380, 0x2, 0x2) /go/pkg/mod/go.uber.org/zap@v1.19.1/logger.go:230 +0x85 github.com/PasteUs/PasteMeGoBackend/common/logging.getLogger.func1(0xca8cf1, 0x16, 0xc00031f660, 0x2, 0x2) /go/src/github.com/PasteUs/PasteMeGoBackend/common/logging/logger_func.go:38 +0x83 github.com/PasteUs/PasteMeGoBackend/common/config.checkVersion(0xc00037e518, 0x5) /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:49 +0x2ad github.com/PasteUs/PasteMeGoBackend/common/config.init.0() /go/src/github.com/PasteUs/PasteMeGoBackend/common/config/config.go:34 +0x55

LucienShui commented 2 years ago

问题同 #125 (comment)。将 backend-config 里面,"version": "3.4.0" 改为 "version": "3.3.0"

这个错误是我造成的,我会在下一个版本修复。Orz