Closed karacolada closed 5 years ago
Fixed by executing docker-entrypoint.sh in auth_db container. Shouldn't this script run automatically at container startup?
Funny enough, the data_db worked perfectly without doing anything. Only the auth_db needed to be fixed.
in Commit b01e8b8f4a746ed86da3c2f9a0735086b7e5224b it should work
yup, it does!
Actually, it doesn't. On a clean docker environment, when setting up auth_db for the first time, another execution of ./docker_entrypoint.sh is needed. No idea why...
Traceback (most recent call last): File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/network.py", line 485, in open_connection socket.SOL_TCP) File "/usr/lib/python3.6/socket.py", line 745, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
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 184, 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 22, 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 206, in _open_connection self._socket.open_connection() File "/home/karacol/.local/lib/python3.6/site-packages/mysql/connector/network.py", line 501, in open_connection errno=2003, values=(self.get_address(), _strioerror(err))) mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'auth_db:3306' (-2 Name or service not known)
Closing this because it has a wrong error message - I was just too stupid to try and connect to mariadb instead of mysql. Opening a clean new issue.
When issuing a command with the bot, it fails with:
I tried connecting to the auth database through the docker container with
And then the error in the title popped up:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
When googling, I found that it most likely means that the mysql service is not running. When trying to start it with
service mysql restart
, I getmysql: unrecognized service
. The package mysql is installed, just like all the mariadb packages.service --status-all
lists no mysql/mariadb service, it doesn't seem to be available. @soxidus, did you do anything to your docker containers afterdocker-compose up -d
? Am I missing something here?