y-young / nazurin

🎉 Images collection done right. Telegram 图片收藏机器人 / A Telegram bot that helps you collect ACG illustrations.
http://nazurin.readthedocs.io
MIT License
260 stars 58 forks source link

多存储报错 #48

Closed zsbai closed 2 years ago

zsbai commented 2 years ago

Describe the bug 当STORAGE环境变量填多个存储报错,但是在其他issue看到应该是支持多个存储的

To Reproduce image 报错信息: image

Expected behavior A clear and concise description of what you expected to happen.

Error output / Logs

2022-08-10T09:19:26.380725+00:00 heroku[web.1]: State changed from crashed to starting
2022-08-10T09:19:33.368193+00:00 heroku[web.1]: Starting process with command `python -m nazurin`
2022-08-10T09:19:35.082434+00:00 app[web.1]: 2022-08-10 09:19:35,082 - nazurin - INFO - Sites loaded
2022-08-10T09:19:35.082563+00:00 app[web.1]: Traceback (most recent call last):
2022-08-10T09:19:35.082571+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/runpy.py", line 194, in _run_module_as_main
2022-08-10T09:19:35.082704+00:00 app[web.1]:     return _run_code(code, main_globals, None,
2022-08-10T09:19:35.082712+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/runpy.py", line 87, in _run_code
2022-08-10T09:19:35.082784+00:00 app[web.1]:     exec(code, run_globals)
2022-08-10T09:19:35.082786+00:00 app[web.1]:   File "/app/nazurin/__main__.py", line 73, in <module>
2022-08-10T09:19:35.082861+00:00 app[web.1]:     main()
2022-08-10T09:19:35.082863+00:00 app[web.1]:   File "/app/nazurin/__main__.py", line 70, in main
2022-08-10T09:19:35.082932+00:00 app[web.1]:     dp.start()
2022-08-10T09:19:35.082934+00:00 app[web.1]:   File "/app/nazurin/dispatcher.py", line 42, in start
2022-08-10T09:19:35.082993+00:00 app[web.1]:     self.init()
2022-08-10T09:19:35.082995+00:00 app[web.1]:   File "/app/nazurin/dispatcher.py", line 27, in init
2022-08-10T09:19:35.083049+00:00 app[web.1]:     self.bot.init()
2022-08-10T09:19:35.083051+00:00 app[web.1]:   File "/app/nazurin/bot.py", line 28, in init
2022-08-10T09:19:35.083108+00:00 app[web.1]:     self.storage.load()
2022-08-10T09:19:35.083109+00:00 app[web.1]:   File "/app/nazurin/storage/__init__.py", line 16, in load
2022-08-10T09:19:35.083165+00:00 app[web.1]:     driver = importlib.import_module('nazurin.storage.' +
2022-08-10T09:19:35.083166+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2022-08-10T09:19:35.083240+00:00 app[web.1]:     return _bootstrap._gcd_import(name[level:], package, level)
2022-08-10T09:19:35.083241+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2022-08-10T09:19:35.083313+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2022-08-10T09:19:35.083346+00:00 app[web.1]:   File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2022-08-10T09:19:35.083397+00:00 app[web.1]: ModuleNotFoundError: No module named "nazurin.storage.['onedrive'"

Environment (please complete the following information): heroku部署 Additional context Add any other context about the problem here.

zsbai commented 2 years ago

已解决,环境变量应配置为:OneDrive,Telegram,不能有空格,大小写敏感,希望可以在文档中描述的更加详细一点