airflow icon indicating copy to clipboard operation
airflow copied to clipboard

xcom table creation fails during airflow initdb because default value not accepted

Open jeremyclover opened this issue 11 years ago • 5 comments

airflow initdb to update schema fails with this error for mysql

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1067, "Invalid default value for 'timestamp'") [SQL: u'\nCREATE TABLE xcom (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\t`key` VARCHAR(512), \n\tvalue BLOB, \n\ttimestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, \n\texecution_date DATETIME NOT NULL, \n\ttask_id VARCHAR(250) NOT NULL, \n\tdag_id VARCHAR(250) NOT NULL, \n\tPRIMARY KEY (id)\n)\n\n']

Changed the timestamp type to TIMESTAMP instead of DATETIME and ran manually. Everything seems to work fine.

Similar to issue tracked and answered here: http://stackoverflow.com/questions/9005766/invalid-default-value-for-dateadded

jeremyclover avatar Aug 30 '15 04:08 jeremyclover

That's from pypi not master is it? (I believe this has been addressed in master, but I need to push a new version to Pypi)

mistercrunch avatar Aug 31 '15 14:08 mistercrunch

Same issue with version 1.5.0

gilles-g avatar Sep 04 '15 14:09 gilles-g

8ab666cc7a59fad206524c65921a9e41cb5dc6c1

mistercrunch avatar Sep 04 '15 14:09 mistercrunch

ok that's fixed in 1.5.1

mistercrunch avatar Sep 04 '15 16:09 mistercrunch

Thx !

gilles-g avatar Sep 07 '15 08:09 gilles-g