如何修复AWS-EC2示例ubuntu机器中的{sqlite3.OperationalError:无法打开数据库文件}的问题?

bvjxkvbb  于 2022-11-14  发布在  SQLite
关注(0)|答案(1)|浏览(116)

我正在尝试在使用ubuntu-20的AWS-EC2示例上部署这个电报机器人(https://github.com/odysseusmax/utube/)。在开始时,一切都很好,直到我收到这个错误:

sqlite3.OperationalError: unable to open database file

如果你知道如何解决这个问题,让我给你一些解决方案:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/project/Utube/bot/__main__.py", line 13, in <module>
    UtubeBot().run()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/run.py", line 61, in run
    self.start()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/sync.py", line 56, in async_to_sync_wrap
    return loop.run_until_complete(coroutine)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 53, in start
    is_authorized = await self.connect()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 39, in connect
    await self.load_session()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/client.py", line 669, in load_session
    await self.storage.open()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyrogram/storage/file_storage.py", line 107, in open
    self.conn = sqlite3.connect(str(path), timeout=1, check_same_thread=False)
sqlite3.OperationalError: unable to open database file

我使用SESSION_NAME=os.Environmental.get(“lethargic”,“:Memory:”);
我千方百计想部署这个机器人。我在Replit平台上试用了它,我必须将utube.py文件SESSION_NAME更改为NAME,一切工作正常。正如我们所知,使用AWS的免费层,Replit不是免费的。在AWS机器上,我收到了这个错误。

8yparm6h

8yparm6h1#

我认为回购中有一个错误,这就是我收到这个错误的原因。很抱歉打扰了你们。我已经用新安装解决了这个问题。谢谢你!!

相关问题