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

在env里面添加NICKNAME报错 #16

Open
2598142880 opened this issue Feb 19, 2024 · 5 comments
Open

在env里面添加NICKNAME报错 #16

2598142880 opened this issue Feb 19, 2024 · 5 comments

Comments

@2598142880
Copy link

02-19 13:38:45 [SUCCESS] nonebot | NoneBot is initializing...
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/nonebot/config.py", line 68, in call
env_val = settings.config.parse_env_var(field.name, env_val)
File "pydantic/env_settings.py", line 132, in pydantic.env_settings.Config.parse_env_var
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "", line 6, in
File "/usr/local/lib/python3.10/dist-packages/nonebot/init.py", line 297, in init
config = Config(
File "pydantic/env_settings.py", line 41, in pydantic.env_settings.BaseSettings.init
File "pydantic/env_settings.py", line 76, in pydantic.env_settings.BaseSettings._build_values
File "/usr/local/lib/python3.10/dist-packages/nonebot/config.py", line 71, in call
raise SettingsError(
pydantic.env_settings.SettingsError: error parsing env var "nickname"

@zhulinyv
Copy link
Owner

请将配置项截图或复制到该 issue, 注意不要暴露 cdkey, token 等重要信息

@2598142880
Copy link
Author

7a833af6708f1fc2403ef12e4ad544ff

@zhulinyv
Copy link
Owner

格式错了, 应为:

NICKNAME=["宵宫"]

@2598142880
Copy link
Author

image
类型不是str吗(

@zhulinyv
Copy link
Owner

这就改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants