condenser
condenser copied to clipboard
access denied on 'tonic_subset_temp_db_...'
Attempt to run direct_subset on two local MySQL databases, with a user that has all privileges on both source and target DBs, I get this:
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 517, in cmd_query
self._cmysql.query(query,
_mysql_connector.MySQLInterfaceError: Access denied for user 'bybe'@'localhost' to database 'tonic_subset_temp_db_398dhjr23'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/asaf/apps/condenser-master/direct_subset.py", line 42, in <module>
subsetter.prep_temp_dbs()
File "/home/asaf/apps/condenser-master/subset.py", line 98, in prep_temp_dbs
self.__db_helper.prep_temp_dbs(self.__source_conn, self.__destination_conn)
File "/home/asaf/apps/condenser-master/mysql_database_helper.py", line 10, in prep_temp_dbs
run_query('DROP DATABASE IF EXISTS ' + temp_db, source_conn)
File "/home/asaf/apps/condenser-master/mysql_database_helper.py", line 144, in run_query
cur.execute(query)
File "/home/asaf/apps/condenser-master/db_connect.py", line 58, in execute
retval = self.inner_cursor.execute(query)
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/cursor_cext.py", line 270, in execute
result = self._cnx.cmd_query(stmt, raw=self._raw,
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 522, in cmd_query
raise errors.get_mysql_exception(exc.errno, msg=exc.msg,
mysql.connector.errors.ProgrammingError: 1044 (42000): Access denied for user 'bybe'@'localhost' to database 'tonic_subset_temp_db_398dhjr23'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 517, in cmd_query
self._cmysql.query(query,
_mysql_connector.MySQLInterfaceError: Access denied for user 'bybe'@'localhost' to database 'tonic_subset_temp_db_398dhjr23'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/asaf/apps/condenser-master/direct_subset.py", line 57, in <module>
subsetter.unprep_temp_dbs()
File "/home/asaf/apps/condenser-master/subset.py", line 101, in unprep_temp_dbs
self.__db_helper.unprep_temp_dbs(self.__source_conn, self.__destination_conn)
File "/home/asaf/apps/condenser-master/mysql_database_helper.py", line 16, in unprep_temp_dbs
run_query('DROP DATABASE IF EXISTS ' + temp_db, source_conn)
File "/home/asaf/apps/condenser-master/mysql_database_helper.py", line 144, in run_query
cur.execute(query)
File "/home/asaf/apps/condenser-master/db_connect.py", line 58, in execute
retval = self.inner_cursor.execute(query)
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/cursor_cext.py", line 270, in execute
result = self._cnx.cmd_query(stmt, raw=self._raw,
File "/home/asaf/.local/lib/python3.9/site-packages/mysql/connector/connection_cext.py", line 522, in cmd_query
raise errors.get_mysql_exception(exc.errno, msg=exc.msg,
mysql.connector.errors.ProgrammingError: 1044 (42000): Access denied for user 'bybe'@'localhost' to database 'tonic_subset_temp_db_398dhjr23'
What might be the reason?
During subsetting, condenser creates temporary tables using the users on both the source and destination. I'm not sure how exactly your permissions are setup, but it appears that on the destination database that the user cannot access a temporary table after it's been created. Worth double-checking on the source database as well, going off the top of my head.
Thank you, I'll see if I can figure it out and update here with any new findings.