eryajf / chatgpt-dingtalk

🎒 钉钉 & 🤖 GPT-3.5 让你的工作效率直接起飞 🚀 私聊群聊方式、单聊串聊模式、角色扮演、图片创作 🚀
https://wiki.eryajf.net
MIT License
2.1k stars 388 forks source link

一直报错panic: runtime error: invalid memory address or nil pointer dereference #278

Closed imhut closed 1 year ago

imhut commented 1 year ago

问题反馈

`nohup: ignoring input panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0x774eef]

goroutine 1 [running]: github.com/charmbracelet/log.(Logger).log(0x8?, 0x961fd60?, {0xe62f20?, 0xc0057f8b88?}, {0x0?, 0xe85cc0?, 0xc00961fd01?}) /go/pkg/mod/github.com/charmbracelet/log@v0.2.1/logger.go:52 +0x4f github.com/charmbracelet/log.(Logger).Fatal(0xc009718f00?, {0xe62f20?, 0xc0057f8b88?}, {0x0?, 0x203000?, 0xc000003860?}) /go/pkg/mod/github.com/charmbracelet/log@v0.2.1/logger.go:318 +0x3c github.com/eryajf/chatgpt-dingtalk/pkg/logger.Fatal(...) /github/workspace/pkg/logger/logger.go:41 github.com/eryajf/chatgpt-dingtalk/config.LoadConfig() /github/workspace/config/config.go:264 +0x276 github.com/eryajf/chatgpt-dingtalk/public.InitSvc() /github/workspace/public/public.go:20 +0x1d main.init.0() /github/workspace/main.go:23 +0x19`

实在是不知道那里问题了,直接用的config.yml 就配置了: run_mode: "stream" api_key:“****” base_url:“****” app_secrets:[***] credentials: 下面参数

大佬们,帮忙看看。。。。

imhut commented 1 year ago

docker和二进制部署 都是同样的错误

barlowliu commented 1 year ago

我也遇到同样的问题,大家有解决方案吗?

imhut commented 1 year ago

我也遇到同样的问题,大家有解决方案吗?

我换其他的程序了,一切正常。。。

imhut commented 1 year ago

昨天根据排除,发现是service_url为空造成的,不是说 理论上你可以忽略该配置项,如果run_mode为stream模式,则可以忽略该配置项。。。 填写了,就不报错了,但是图片在钉钉上会不显示,根据日志,得到的URL 到的答案: ">点击图片可旋转或放大。\n" 也是一样打不开的,另外一个项目貌似直接用的第三方URL给钉钉推送的,目前就暂时这个问题。

imhut commented 1 year ago

/images/20230724-170250.png 上面把URL过滤掉了,前缀是service_url