-
Notifications
You must be signed in to change notification settings - Fork 121
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
Only run one data source when the database is not created by Mordred #556
Comments
I've been able to reproduce the bug in this docker compose deployment. I use the env variable so the services:
identitiesdb:
environment:
- MARIADB_DATABASE=test_sh It happens both with the [phases]
identities = true # or false
[git]
[github]
[github:pull]
[github2:pull]
... However, only one of these data sources is collected. It changes randomly. It's
This behavior only occurs in the first mordred run. If the container is restarted, all data sources are collected. Maybe unrelated, but when this behaviour occurs, the container log shows some Exception in thread Global tasks:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Exception in thread github:pull:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Exception in thread github:repo:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Exception in thread github:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Exception in thread github2:pull:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Exception in thread github2:issue:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
result.read()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 732, in _read_query_result
result.read()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 170, in execute
result.read()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet
result = self._query(query)
File "/usr/local/lib/python3.8/site-packages/pymysql/cursors.py", line 328, in _query
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet
packet.check_error()
File "/usr/local/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet
result.read()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read
packet.check_error()
File "/usr/local/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error
packet.check_error()
File "/usr/local/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error
first_packet = self.connection._read_packet()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 684, in _read_packet
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.8/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
conn.query(q)
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 517, in query
packet.check_error()
File "/usr/local/lib/python3.8/site-packages/pymysql/protocol.py", line 220, in check_error
result.read()
File "/usr/local/lib/python3.8/site-packages/pymysql/connections.py", line 1075, in read
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.8/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
err.raise_mysql_exception(self._data)
File "/usr/local/lib/python3.8/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1050, "Table 'organizations' already exists")
... |
I have the same trouble now, any ideas about avoiding? |
Hi @guoqiangqi Sorry for the late reply, You can restart the Mordred container (you will see this error on the very first execution) or let Mordred create the database (change the database name) These names must be different:
I hope it helps you. |
Hi @zhquan So appreciate for your advice, i have changed my configuration so the database names in |
I was tring to attach my log files but failed, the |
@guoqiangqi are you running Mordred using docker or micro.py? (Mordred container should create the database if does not exist). Anyway, try to create the database but using sortinghat and restart the Mordred container or run again micro.py.
|
@zhquan I run Mordred using docker-compose, create the datebase with |
When the database is created by default by MariaDB or manually
create database test_sh;
Mordred will run only one data source randomly.Example:
In this case, Mordred will run
git
orgithub
randomly.The text was updated successfully, but these errors were encountered: