ashinnotfound / ChatGPT-YourChatRobot

❤开箱即用❤an unofficial implement of ChatGPT in QQ/Wechat. 一个非官方的ChatGPT腾讯qq/微信(非公众号)实现版,快来把你的qq或微信变成chatgpt吧
MIT License
432 stars 96 forks source link

今天(2022.12.12)OpenAI添加了额外的Cloudflare保护 #2

Closed rhZhang0228 closed 1 year ago

rhZhang0228 commented 1 year ago

当我向机器人发消息时,他提示 session_token: null Error refreshing session

2022-12-12 10:41:27 W/Bot 2864518580: An exception occurred when processing event. Subscriber scope: ''. Broadcaster scope: 'Bot.2864518580.EventDispatcher' net.mamoe.mirai.event.ExceptionInEventHandlerException: Exception in EventHandler at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:147) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.access$registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:1) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt$registerEventHandler$callMethod$2.invokeSuspend(JvmMethodListenersInternal.kt:154) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.mamoe.mirai.internal.event.JvmMethodListenersInternalKt.registerEventHandler$callMethod$invokeWithErrorReport(JvmMethodListenersInternal.kt:140) ... 10 more Caused by: java.lang.Exception: Error refreshing session at com.github.plexpt.chatgpt.Chatbot.refreshSession(Chatbot.java:276) at com.github.plexpt.chatgpt.Chatbot.(Chatbot.java:42) at com.ashin.util.ChatbotUtil.getChatbot(ChatbotUtil.java:64) at com.ashin.service.InteractServiceImpl.chat(InteractServiceImpl.java:21) at com.ashin.controller.MessageEventHandler.onMessage(MessageEventHandler.java:34) ... 15 more Caused by: com.alibaba.fastjson2.JSONException: illegal input, offset 1, char < at com.alibaba.fastjson2.JSONReader.read(JSONReader.java:1432) at com.alibaba.fastjson2.JSON.parseObject(JSON.java:193) at com.github.plexpt.chatgpt.Chatbot.refreshSession(Chatbot.java:266) ... 19 more

ashinnotfound commented 1 year ago

可能是sessiontoken没配置或过期了,参考项目README.md重新配置一下试试

rhZhang0228 commented 1 year ago

可能是sessiontoken没有配置或者过期了,参考项目README.md重新配置下试

好的,我试试

rhZhang0228 commented 1 year ago

可能是sessiontoken没有配置或者过期了,参考项目README.md重新配置下试

似乎还是不行,我通过 log.info("session-->{}", ChatbotUtil.sessionToken); 输出知道了我的sessionToken是正确加载了的,并且我尝试了多次登出登录chatGPT网站,试了多次sessionToken,还是一样的提示 session_token: null Error refreshing session

ashinnotfound commented 1 year ago

我刚刚测试了一下,发现也有这个问题😂,我去看看,谢谢你的发现

yuyong961020 commented 1 year ago

image

yuyong961020 commented 1 year ago

这个地方的问题

ashinnotfound commented 1 year ago

已解决

rhZhang0228 commented 1 year ago

😂似乎还是不行,对于项目,我唯二的改动之处: (1)pom.xml中chatGPT版本改为了1.1.0,因为我的maven配置的阿里云镜像,最新版目前只有1.1.0。 即: `com.github.plexpt

chatgpt
        <version>1.1.0</version>`

(2)application.properties中更改sessionToken、cfClearance、userAgent、qq、password。 在运行项目时,还是跟之前的一模一样的错误😂是更改了chatGPT版本的原因吗?

ashinnotfound commented 1 year ago

😂似乎还是不行,对于项目,我唯二的改动之处: (1)pom.xml中chatGPT版本改为了1.1.0,因为我的maven配置的阿里云镜像,最新版目前只有1.1.0。 即: com.github.plexpt chatgpt 1.1.0 (2)application.properties中更改sessionToken、cfClearance、userAgent、qq、password。 在运行项目时,还是跟之前的一模一样的错误😂是更改了chatGPT版本的原因吗?

对的,com.github.plexpt得1.1.2才可以,1.1.0依然存在这个问题,建议更新一下maven仓库😁

rhZhang0228 commented 1 year ago

嗯嗯,已解决