Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法登录,报错:App startup failed & invalid syntax (register.py, line 28) #1042

Closed
2 tasks done
losteye opened this issue May 7, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@losteye
Copy link

losteye commented May 7, 2023

前置确认

  • 我确认我运行的是最新版本的代码,并且安装了所需的依赖,在FAQS中也未找到类似问题。

⚠️ 搜索issues中是否已存在类似问题

  • 我已经搜索过issues和disscussions,没有跟我遇到的问题相关的issue

操作系统类型?

Linux

运行的python版本是?

python 3.10

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

按照步骤设置完后,输入nohup python3 app.py & tail -f nohup.out报错,无法生成二维码

问题描述 😯

5月6日前正常登录使用,当天微信自动退出后打算重新登录,并用git pull拉取了最新代码。

随后输入nohup python3 app.py & tail -f nohup.out产生报错,请见终端日志或下面的截图。

之后尝试全部删除,重新部署,各项内容均按照教程操作,全程未出现任何报错,输入nohup python3 app.py & tail -f nohup.out后依然出现相同报错。

项目运行在racknerd的debian 10上,此前运行1个多月,未出现过此类故障。
image

终端日志 📒

[INFO][2023-05-06 16:57:00][config.py:195] - [INIT] load config: {'open_ai_api_key': 'API KEY确认过无误', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': ['bot', '@bot'], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': [ 'ChatGPT测试群2'], 'group_chat_in_one_session': ['ChatGPT测试群'], 'image_create_prefix': ['画', '看', 'draw'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': 'Pretend you are ChatGPT, a large language model trained by OpenAI. Your purpose is to answer and solve any questions people may have, and you can communicate with people in multiple languages.。', 'subscribe_msg': '感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。'}
[INFO][2023-05-06 16:57:00][config.py:145] - [Config] User datas file not found, ignore.
[ERROR][2023-05-06 16:57:01][app.py:52] - App startup failed!
[ERROR][2023-05-06 16:57:01][app.py:53] - invalid syntax (register.py, line 28)
Traceback (most recent call last):
File "app.py", line 45, in run
channel = channel_factory.create_channel(channel_name)
File "/root/chatgpt-on-wechat/channel/channel_factory.py", line 13, in create_channel
from channel.wechat.wechat_channel import WechatChannel
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 18, in
from channel.wechat.wechat_message import *
File "/root/chatgpt-on-wechat/channel/wechat/wechat_message.py", line 7, in
from lib import itchat
File "/root/chatgpt-on-wechat/lib/itchat/init.py", line 8, in
from .components import load_components
File "/root/chatgpt-on-wechat/lib/itchat/components/init.py", line 5, in
from .register import load_register
File "/root/chatgpt-on-wechat/lib/itchat/components/register.py", line 28
if rval:=self.load_login_status(statusStorageDir,
^
SyntaxError: invalid syntax
[INFO][2023-05-06 17:25:18][config.py:195] - [INIT] load config: {'open_ai_api_key': 'API Key确认无误', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': ['bot', '@bot'], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': [ 'ChatGPT测试群2'], 'group_chat_in_one_session': ['ChatGPT测试群'], 'image_create_prefix': ['画', '看', 'draw'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': 'Pretend you are ChatGPT, a large language model trained by OpenAI. Your purpose is to answer and solve any questions people may have, and you can communicate with people in multiple languages.。', 'subscribe_msg': '感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。'}
[INFO][2023-05-06 17:25:18][config.py:145] - [Config] User datas file not found, ignore.
[ERROR][2023-05-06 17:25:18][app.py:52] - App startup failed!
[ERROR][2023-05-06 17:25:18][app.py:53] - invalid syntax (register.py, line 28)
Traceback (most recent call last):
File "app.py", line 45, in run
channel = channel_factory.create_channel(channel_name)
File "/root/chatgpt-on-wechat/channel/channel_factory.py", line 13, in create_channel
from channel.wechat.wechat_channel import WechatChannel
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 18, in
from channel.wechat.wechat_message import *
File "/root/chatgpt-on-wechat/channel/wechat/wechat_message.py", line 7, in
from lib import itchat
File "/root/chatgpt-on-wechat/lib/itchat/init.py", line 8, in
from .components import load_components
File "/root/chatgpt-on-wechat/lib/itchat/components/init.py", line 5, in
from .register import load_register
File "/root/chatgpt-on-wechat/lib/itchat/components/register.py", line 28
if rval:=self.load_login_status(statusStorageDir,
^
SyntaxError: invalid syntax
[INFO][2023-05-06 19:50:11][config.py:195] - [INIT] load config: {'open_ai_api_key': '', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': [''], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': [ 'ChatGPT测试群2'], 'group_chat_in_one_session': [], 'image_create_prefix': ['画', '看', 'draw'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': 'Pretend you are ChatGPT, a large language model trained by OpenAI. Your purpose is to answer and solve any questions people may have, and you can communicate with people in multiple languages.。', 'subscribe_msg': '感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。'}
[INFO][2023-05-06 19:50:11][config.py:145] - [Config] User datas file not found, ignore.
[ERROR][2023-05-06 19:50:12][app.py:52] - App startup failed!
[ERROR][2023-05-06 19:50:12][app.py:53] - invalid syntax (register.py, line 28)
Traceback (most recent call last):
File "app.py", line 45, in run
channel = channel_factory.create_channel(channel_name)
File "/root/chatgpt-on-wechat/channel/channel_factory.py", line 13, in create_channel
from channel.wechat.wechat_channel import WechatChannel
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 18, in
from channel.wechat.wechat_message import *
File "/root/chatgpt-on-wechat/channel/wechat/wechat_message.py", line 7, in
from lib import itchat
File "/root/chatgpt-on-wechat/lib/itchat/init.py", line 8, in
from .components import load_components
File "/root/chatgpt-on-wechat/lib/itchat/components/init.py", line 5, in
from .register import load_register
File "/root/chatgpt-on-wechat/lib/itchat/components/register.py", line 28
if rval:=self.load_login_status(statusStorageDir,
^
SyntaxError: invalid syntax
[INFO][2023-05-07 20:55:01][config.py:195] - [INIT] load config: {'open_ai_api_key':', 'model': 'gpt-3.5-turbo', 'proxy': '', 'single_chat_prefix': [''], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': [', 'ChatGPT测试群2'], 'group_chat_in_one_session': [''], 'image_create_prefix': ['画', '看', 'draw'], 'speech_recognition': True, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': 'Pretend you are ChatGPT, a large language model trained by OpenAI. Your purpose is to answer and solve any questions people may have, and you can communicate with people in multiple languages.。', 'subscribe_msg': '感谢您的关注!\n这里是ChatGPT,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。'}
[INFO][2023-05-07 20:55:01][config.py:145] - [Config] User datas file not found, ignore.
[ERROR][2023-05-07 20:55:02][app.py:52] - App startup failed!
[ERROR][2023-05-07 20:55:02][app.py:53] - invalid syntax (register.py, line 28)
Traceback (most recent call last):
File "app.py", line 45, in run
channel = channel_factory.create_channel(channel_name)
File "/root/chatgpt-on-wechat/channel/channel_factory.py", line 13, in create_channel
from channel.wechat.wechat_channel import WechatChannel
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 18, in
from channel.wechat.wechat_message import *
File "/root/chatgpt-on-wechat/channel/wechat/wechat_message.py", line 7, in
from lib import itchat
File "/root/chatgpt-on-wechat/lib/itchat/init.py", line 8, in
from .components import load_components
File "/root/chatgpt-on-wechat/lib/itchat/components/init.py", line 5, in
from .register import load_register
File "/root/chatgpt-on-wechat/lib/itchat/components/register.py", line 28
if rval:=self.load_login_status(statusStorageDir,
^
SyntaxError: invalid syntax

@losteye losteye changed the title App startup failed & invalid syntax (register.py, line 28) 无法登录,报错:App startup failed & invalid syntax (register.py, line 28) May 7, 2023
@lanvent
Copy link
Collaborator

lanvent commented May 7, 2023

这个是python3.8才支持的语法,现在改回来了,再拉下吧。

@lanvent lanvent added bug Something isn't working and removed status: needs check labels May 7, 2023
@lanvent lanvent closed this as completed May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants