soxidus / Boardgame-Bot

A Boardgame Bot for your Telegram group to plan/manage gamenights and suggest games to play.
MIT License
2 stars 0 forks source link

Errors when running bot in docker #41

Closed karacolada closed 4 years ago

karacolada commented 4 years ago

Traceback (most recent call last): File "/home/karacol/.local/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update handler.handle_update(update, self) File "/home/karacol/.local/lib/python3.6/site-packages/telegram/ext/commandhandler.py", line 173, in handle_update return self.callback(dispatcher.bot, update, *optional_args) File "/home/karacol/git/Boardgame-Bot/src/commands.py", line 279, in spiele if check_user(update.message.chat_id): File "/home/karacol/git/Boardgame-Bot/src/database_functions.py", line 169, in check_user result_user = search_single_entry(choose_database("auth"), "users", "id", user) File "/home/karacol/git/Boardgame-Bot/src/database_functions.py", line 20, in choose_database database=config['MySQL Auth']['database'] File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/init.py", line 179, in connect return MySQLConnection(args, kwargs) File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/connection.py", line 95, in init self.connect(kwargs) File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/abstracts.py", line 716, in connect self._open_connection() File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/connection.py", line 210, in _open_connection self._ssl) File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/connection.py", line 144, in _do_auth self._auth_switch_request(username, password) File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/connection.py", line 177, in _auth_switch_request raise errors.get_exception(packet) mysql.connector.errors.ProgrammingError: 1045 (28000): Access denied for user 'testuser'@'172.18.0.1' (using password: YES)

karacolada commented 4 years ago

Actually, I'll have a look at this later. Do we set the database password in the docker configs?

karacolada commented 4 years ago

This happens because we define password and username for the database hardcoded in docker-compose.yaml. But since we let the user decide on their own password in config.ini, we should read the password (and other stuff) from there. I'm looking to adjust the code accordingly now.

karacolada commented 4 years ago

Code adjusted in commit c9f2f5d0d507902db833d6f830eedff2e16980e0