When creating the docker containers with:
cd ops/packer
packer build -only=docker ./output/iris.json
Running them with the configs/config.dev.yaml against a DB that imported schema_0.sql and dummy_data.sql and then trying to create a Plan:
[2017-11-09 14:38:46 +0000] [14] [ERROR] iris.db SERVER ERROR
Traceback (most recent call last):
File "./iris/db.py", line 37, in guarded_session
yield session
File "./iris/api.py", line 1182, in on_post
plan_id = session.execute(insert_plan_query, plan_dict).lastrowid
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1046, in execute
bind, close_with_result=True).execute(clause, params or {})
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 308, in _query
conn.query(q)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 820, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1002, in _read_query_result
result.read()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1285, in read
first_packet = self.connection._read_packet()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 966, in _read_packet
packet.check_error()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 394, in check_error
err.raise_mysql_exception(self._data)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/err.py", line 112, in _check_mysql_exception
raise errorclass(errno, errorvalue)
IntegrityError: (pymysql.err.IntegrityError) (1048, u"Column 'user_id' cannot be null") [SQL: u"INSERT INTO `plan` (\n `user_id`, `name`, `created`, `description`, `step_count`,\n `threshold_window`, `threshold_count`, `aggregation_window`,\n `aggregation_reset`, `tracking_key`, `tracking_type`, `tracking_template`\n) VALUES (\n (SELECT `id` FROM `target` where `name` = %(creator)s AND `type_id` = (\n SELECT `id` FROM `target_type` WHERE `name` = 'user'\n )),\n %(name)s,\n %(created)s,\n %(description)s,\n %(step_count)s,\n %(threshold_window)s,\n %(threshold_count)s,\n %(aggregation_window)s,\n %(aggregation_reset)s,\n %(tracking_key)s,\n %(tracking_type)s,\n %(tracking_template)s\n)"] [parameters: {u'step_count': 1, u'name': u'tes', u'threshold_count': 10, u'creator': u'root', u'created': datetime.datetime(2017, 11, 9, 14, 38, 46, 445930), u'aggregation_window': 300, u'tracking_type': None, u'aggregation_reset': 300, u'tracking_template': None, u'tracking_key': None, u'threshold_window': 900, u'description': u'tes'}]
Traceback (most recent call last):
File "/home/iris/env/local/lib/python2.7/site-packages/beaker/middleware.py", line 155, in __call__
return self.wrap_app(environ, session_start_response)
File "/home/iris/env/local/lib/python2.7/site-packages/falcon/api.py", line 209, in __call__
responder(req, resp, **params)
File "./iris/api.py", line 1182, in on_post
plan_id = session.execute(insert_plan_query, plan_dict).lastrowid
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1046, in execute
bind, close_with_result=True).execute(clause, params or {})
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
compiled_sql, distilled_params
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
exc_info
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/home/iris/env/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 158, in execute
result = self._query(query)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/cursors.py", line 308, in _query
conn.query(q)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 820, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1002, in _read_query_result
result.read()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 1285, in read
first_packet = self.connection._read_packet()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 966, in _read_packet
packet.check_error()
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/connections.py", line 394, in check_error
err.raise_mysql_exception(self._data)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "/home/iris/env/local/lib/python2.7/site-packages/pymysql/err.py", line 112, in _check_mysql_exception
raise errorclass(errno, errorvalue)
sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1048, u"Column 'user_id' cannot be null") [SQL: u"INSERT INTO `plan` (\n `user_id`, `name`, `created`, `description`, `step_count`,\n `threshold_window`, `threshold_count`, `aggregation_window`,\n `aggregation_reset`, `tracking_key`, `tracking_type`, `tracking_template`\n) VALUES (\n (SELECT `id` FROM `target` where `name` = %(creator)s AND `type_id` = (\n SELECT `id` FROM `target_type` WHERE `name` = 'user'\n )),\n %(name)s,\n %(created)s,\n %(description)s,\n %(step_count)s,\n %(threshold_window)s,\n %(threshold_count)s,\n %(aggregation_window)s,\n %(aggregation_reset)s,\n %(tracking_key)s,\n %(tracking_type)s,\n %(tracking_template)s\n)"] [parameters: {u'step_count': 1, u'name': u'tes', u'threshold_count': 10, u'creator': u'root', u'created': datetime.datetime(2017, 11, 9, 14, 38, 46, 445930), u'aggregation_window': 300, u'tracking_type': None, u'aggregation_reset': 300, u'tracking_template': None, u'tracking_key': None, u'threshold_window': 900, u'description': u'tes'}]