Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL Connection issues #6

Open
chris-brabender opened this issue Apr 3, 2020 · 3 comments
Open

MySQL Connection issues #6

chris-brabender opened this issue Apr 3, 2020 · 3 comments

Comments

@chris-brabender
Copy link

On build and run of SeoSnap (master branch at the minute) I'm getting MySQL permission issues such as :

seosnap_dashboard | django.db.utils.OperationalError: (1130, "Host '172.23.0.5' is not allowed to connect to this MySQL server")

It appears the installation / configuration of MySQL 8 is not creating the users properly, and after a docker-composer build the seosnap_dashboard database is not even created properly.

I created a myslq user manually and granted it access but still:

seosnap_dashboard | django.db.utils.OperationalError: (1049, "Unknown database 'seosnap_dashboard'")
@egordm
Copy link
Contributor

egordm commented Apr 3, 2020

Hey @chris-brabender,
You are using the mysql server that's defined in the docker compose?
If so do you mind posting output of docker-compose config? (you probably also need to replace all the sensitive data it my have filled in from the .env file)
Are there any errors in database log? (Maybe regarding the storage volumes or something else)

@chris-brabender
Copy link
Author

Logs from docker-composer up;

seosnap_dashboard | Traceback (most recent call last): seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection seosnap_dashboard | self.connect() seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner seosnap_dashboard | return func(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 197, in connect seosnap_dashboard | self.connection = self.get_new_connection(conn_params) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner seosnap_dashboard | return func(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 233, in get_new_connection seosnap_dashboard | return Database.connect(**conn_params) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect seosnap_dashboard | return Connection(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__ seosnap_dashboard | super(Connection, self).__init__(*args, **kwargs2) seosnap_dashboard | MySQLdb._exceptions.OperationalError: (2002, "Can't connect to MySQL server on 'db' (115)")

seosnap_dashboard | Traceback (most recent call last): seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 220, in ensure_connection seosnap_dashboard | self.connect() seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner seosnap_dashboard | return func(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/base/base.py", line 197, in connect seosnap_dashboard | self.connection = self.get_new_connection(conn_params) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/utils/asyncio.py", line 26, in inner seosnap_dashboard | return func(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 233, in get_new_connection seosnap_dashboard | return Database.connect(**conn_params) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect seosnap_dashboard | return Connection(*args, **kwargs) seosnap_dashboard | File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__ seosnap_dashboard | super(Connection, self).__init__(*args, **kwargs2) seosnap_dashboard | MySQLdb._exceptions.OperationalError: (1045, 'Plugin sha256_password could not be loaded: /usr//usr/lib/x86_64-linux-gnu/mariadb19/plugin/sha256_password.so: cannot open shared object file: No such file or directory'

$ docker-compose config
networks:
seosnap:
driver: bridge
services:
cacheserver:
build:
context: seosnap-cacheserver
container_name: seosnap_cacheserver
depends_on:
- rendertron
environment:
ADMIN_DEBUG: '1'
ADMIN_EMAIL: [email protected]
ADMIN_LOG_LEVEL: ERROR
ADMIN_NAME: snaptron
ADMIN_PASS: Sn@ptron1337
ADMIN_SECRET:
API_NAME: snaptron
API_PASS: Sn@ptron1337
API_URL: http://dashboard:8080/docs/
API_VER: v1
CACHEWARMER_BUFFER_SIZE: '50'
CACHEWARMER_CACHE_SERVER_URL: http://cacheserver:5000/render
CACHEWARMER_CONCURRENT_REQUESTS: '2'
CACHEWARMER_LOG_LEVEL: ERROR
CACHEWARMER_THREADS: '2'
CACHEWARMER_USER_AGENT: Seosnap
DB_HOST: db
DB_NAME: seosnap_dashboard
DB_PASS: snaptron
DB_ROOT_HOST: '%'
DB_USER: snaptron
EXTERNAL_CACHE_SERVER_URL: ''
RENDERTRON_CACHE_DEBUG: '0'
RENDERTRON_CACHE_FILE_SUFFIX: .json
RENDERTRON_CACHE_HEADER_REQUEST_BLACKLIST: ''
RENDERTRON_CACHE_HEADER_RESPONSE_BLACKLIST: Set-Cookie,Content-Encoding,Transfer-Encoding
RENDERTRON_CACHE_LOCK_TIMEOUT: '1'
RENDERTRON_CACHE_RESOURCE_METHOD: GET
RENDERTRON_CACHE_RESOURCE_URL: http://rendertron:3000/render
RENDERTRON_CACHE_ROOT: ./cache
image: seosnap-cacheserver
networks:
seosnap: null
ports:
- published: 5000
target: 5000
restart: unless-stopped
volumes:
- cache:/app/cache:rw
- logs:/app/logs:rw
cachewarmer:
build:
context: seosnap-cachewarmer
container_name: seosnap_cachewarmer
depends_on:
- cacheserver
- dashboard
environment:
ADMIN_DEBUG: '1'
ADMIN_EMAIL: [email protected]
ADMIN_LOG_LEVEL: ERROR
ADMIN_NAME: snaptron
ADMIN_PASS: Sn@ptron1337
ADMIN_SECRET:
API_NAME: snaptron
API_PASS: Sn@ptron1337
API_URL: http://dashboard:8080/docs/
API_VER: v1
CACHEWARMER_BUFFER_SIZE: '50'
CACHEWARMER_CACHE_SERVER_URL: http://cacheserver:5000/render
CACHEWARMER_CONCURRENT_REQUESTS: '2'
CACHEWARMER_LOG_LEVEL: ERROR
CACHEWARMER_THREADS: '2'
CACHEWARMER_USER_AGENT: Seosnap
DB_HOST: db
DB_NAME: seosnap_dashboard
DB_PASS: snaptron
DB_ROOT_HOST: '%'
DB_USER: snaptron
EXTERNAL_CACHE_SERVER_URL: ''
RENDERTRON_CACHE_DEBUG: '0'
RENDERTRON_CACHE_FILE_SUFFIX: .json
RENDERTRON_CACHE_HEADER_REQUEST_BLACKLIST: ''
RENDERTRON_CACHE_HEADER_RESPONSE_BLACKLIST: Set-Cookie,Content-Encoding,Transfer-Encoding
RENDERTRON_CACHE_LOCK_TIMEOUT: '1'
RENDERTRON_CACHE_RESOURCE_METHOD: GET
RENDERTRON_CACHE_RESOURCE_URL: http://rendertron:3000/render
RENDERTRON_CACHE_ROOT: ./cache
image: seosnap-cachewarmer
networks:
seosnap: null
restart: "no"
volumes:
- seosnap-cachewarmer:/code:rw
- logs:/code/logs:rw
dashboard:
build:
context: seosnap-dashboard
container_name: seosnap_dashboard
depends_on:
- db
environment:
ADMIN_DEBUG: '1'
ADMIN_EMAIL: [email protected]
ADMIN_LOG_LEVEL: ERROR
ADMIN_NAME: snaptron
ADMIN_PASS: Sn@ptron1337
ADMIN_SECRET:
API_NAME: snaptron
API_PASS: Sn@ptron1337
API_URL: http://dashboard:8080/docs/
API_VER: v1
CACHEWARMER_BUFFER_SIZE: '50'
CACHEWARMER_CACHE_SERVER_URL: http://cacheserver:5000/render
CACHEWARMER_CONCURRENT_REQUESTS: '2'
CACHEWARMER_LOG_LEVEL: ERROR
CACHEWARMER_THREADS: '2'
CACHEWARMER_USER_AGENT: Seosnap
DB_HOST: db
DB_HOST_OVERRIDE: db
DB_NAME: seosnap_dashboard
DB_PASS: snaptron
DB_ROOT_HOST: '%'
DB_USER: snaptron
EXTERNAL_CACHE_SERVER_URL: ''
RENDERTRON_CACHE_DEBUG: '0'
RENDERTRON_CACHE_FILE_SUFFIX: .json
RENDERTRON_CACHE_HEADER_REQUEST_BLACKLIST: ''
RENDERTRON_CACHE_HEADER_RESPONSE_BLACKLIST: Set-Cookie,Content-Encoding,Transfer-Encoding
RENDERTRON_CACHE_LOCK_TIMEOUT: '1'
RENDERTRON_CACHE_RESOURCE_METHOD: GET
RENDERTRON_CACHE_RESOURCE_URL: http://rendertron:3000/render
RENDERTRON_CACHE_ROOT: ./cache
image: seosnap-dashboard
networks:
seosnap: null
ports:
- published: 8080
target: 8080
restart: unless-stopped
volumes:
- seosnap-dashboard:/code:rw
- logs:/code/logs:rw
db:
entrypoint:
- /entrypoint.sh
- --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: seosnap_dashboard
MYSQL_PASSWORD: snaptron
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_ROOT_HOST: '%'
MYSQL_USER: snaptron
image: mysql
networks:
seosnap: null
restart: unless-stopped
volumes:
- dev/instance/mariadb:/var/lib/mysql:rw
rendertron:
container_name: rendertron
image: ammobindotca/rendertron
networks:
seosnap: null
ports:
- published: 3000
target: 3000
restart: unless-stopped
version: '3.7'

@z0lo13
Copy link

z0lo13 commented Apr 29, 2020

@egordm @chris-brabender do you guys solved that issue? i have same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants