Операционная ошибка Python/Telethon в базе данных SQLite: невозможно открыть файл базы данных ⇐ Python
Операционная ошибка Python/Telethon в базе данных SQLite: невозможно открыть файл базы данных
I have a python/telethon Telegram bot project consisting of a single python file, an SQLite databse, and a config file. The bot runs fine on my local system (all three files are in the same directory) but when I attempt to run the python file on ubuntu server, I'm running into the following error.
Project files are in /usr/local/bin/project/:
Traceback (most recent call last): File "/usr/local/bin/project/script.py", line 19, in client = TelegramClient(session_name, API_ID, API_HASH).start(bot_token=BOT_TOKEN) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/client/telegrambaseclient.py", line 289, in __init__ session = SQLiteSession(session) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/sessions/sqlite.py", line 47, in __init__ c = self._cursor() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/sessions/sqlite.py", line 242, in _cursor self._conn = sqlite3.connect(self.filename, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file I checked permissions on all three files, and am getting the following:
-rw-r--rw- 1 root root 10601 Mar 4 00:52 script.py -rw-rw-rw- 1 root root 716800 Mar 4 00:52 database.db -rw-r--rw- 1 root root 195 Mar 4 00:52 config.ini
Источник: https://stackoverflow.com/questions/780 ... atabase-fi
I have a python/telethon Telegram bot project consisting of a single python file, an SQLite databse, and a config file. The bot runs fine on my local system (all three files are in the same directory) but when I attempt to run the python file on ubuntu server, I'm running into the following error.
Project files are in /usr/local/bin/project/:
Traceback (most recent call last): File "/usr/local/bin/project/script.py", line 19, in client = TelegramClient(session_name, API_ID, API_HASH).start(bot_token=BOT_TOKEN) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/client/telegrambaseclient.py", line 289, in __init__ session = SQLiteSession(session) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/sessions/sqlite.py", line 47, in __init__ c = self._cursor() ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/telethon/sessions/sqlite.py", line 242, in _cursor self._conn = sqlite3.connect(self.filename, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file I checked permissions on all three files, and am getting the following:
-rw-r--rw- 1 root root 10601 Mar 4 00:52 script.py -rw-rw-rw- 1 root root 716800 Mar 4 00:52 database.db -rw-r--rw- 1 root root 195 Mar 4 00:52 config.ini
Источник: https://stackoverflow.com/questions/780 ... atabase-fi
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Ошибка базы данных SQLite студии Android (android.database.sqlite.SQLiteException)
Anonymous » » в форуме Android - 0 Ответы
- 59 Просмотры
-
Последнее сообщение Anonymous
-