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

dbapi_hook causes mysql error 2014 on large input #459

Closed
mtustin-handy opened this issue Sep 24, 2015 · 0 comments
Closed

dbapi_hook causes mysql error 2014 on large input #459

mtustin-handy opened this issue Sep 24, 2015 · 0 comments

Comments

@mtustin-handy
Copy link
Contributor

This is the exception:

ProgrammingError: (2014, "Commands out of sync; you can't run this command now")                                                   
2015-09-24 14:54:41,780 - root - ERROR - (2014, "Commands out of sync; you can't run this command now")                            
Traceback (most recent call last):                                                                                                 
  File "/home/mtustin/airflowvenv/bin/airflow", line 10, in <module>                                                               
    args.func(args)                                                                                                                
  File "/home/mtustin/airflowvenv/lib/python2.7/site-packages/airflow/bin/cli.py", line 204, in test                               
    ti.run(force=True, ignore_dependencies=True, test_mode=True)                                                                   
  File "/home/mtustin/airflowvenv/lib/python2.7/site-packages/airflow/models.py", line 928, in run                                 
    result = task_copy.execute(context=context)                                                                                    
  File "/home/mtustin/airflowvenv/lib/python2.7/site-packages/airflow/operators/mysql_operator.py", line 33, in execute            
    hook.run(self.sql)                                                                                                             
  File "/home/mtustin/airflowvenv/lib/python2.7/site-packages/airflow/hooks/dbapi_hook.py", line 100, in run                       
    conn.commit()                                                                                                                  
_mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now")                                 

This is the task which is triggering it:

refresh_db = MySqlOperator(                                                                                                        
    mysql_conn_id='clean_db_export',                                                                                               
    sql='templates/dbschema.sql',                                                                                                  
    task_id='refresh_db',                                                                                                          
    dag=clean_and_export_dag)

templates/dbschema.sql is the result of running mysqldump --no-data.

I am able to successfully perform - in a separate task - a 4 line sql script which drops and recreates the database involved here.

The exception does not occur if I switch the order of these two lines: https://github.com/airbnb/airflow/blob/master/airflow/hooks/dbapi_hook.py#L100-L101 to give:

cur.close()
conn.commit()

I am running airflow and mysql on Redhat with kernel 3.10.0-229.el7.x86_64 #1 SMP.

I expect to have a PR open in the course of the day with that change.

mtustin-handy added a commit to mtustin-handy/airflow that referenced this issue Sep 24, 2015
mtustin-handy added a commit to mtustin-handy/airflow that referenced this issue Sep 24, 2015
mistercrunch added a commit that referenced this issue Sep 24, 2015
mistercrunch added a commit that referenced this issue Nov 16, 2015
…ator

[MySqlOperator] Fix issue #459 - mysql error 2014
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 7, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 7, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 8, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 9, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 10, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 11, 2020
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 10, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 17, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 18, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 22, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 24, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 1, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 2, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 3, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 3, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 7, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 8, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 9, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 14, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 15, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 16, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 16, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 23, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 14, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 16, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 22, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 24, 2021
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Feb 3, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 1, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 3, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 8, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 26, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 3, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 6, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 6, 2022
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 26, 2023
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
ahidalgob pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Apr 24, 2023
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 11, 2024
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 12, 2024
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Sep 16, 2024
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to kosteev/composer-airflow-test-copybara that referenced this issue Sep 17, 2024
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 6, 2024
…ator

[MySqlOperator] Fix issue apache/airflow#459 - mysql error 2014

GitOrigin-RevId: 3646c9b30d48105a15280965d5a3338ceccfef98
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

1 participant