{"action":"opened","issue":{"url":"https://api.github.com/repos/dojot/device-manager/issues/51","repository_url":"https://api.github.com/repos/dojot/device-manager","labels_url":"https://api.github.com/repos/dojot/device-manager/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/dojot/device-manager/issues/51/comments","events_url":"https://api.github.com/repos/dojot/device-manager/issues/51/events","html_url":"https://github.com/dojot/device-manager/issues/51","id":308642968,"number":51,"title":"Database access error when updating container version","user":{"login":"ericbaum","id":4474364,"avatar_url":"https://avatars0.githubusercontent.com/u/4474364?v=4","gravatar_id":"","url":"https://api.github.com/users/ericbaum","html_url":"https://github.com/ericbaum","followers_url":"https://api.github.com/users/ericbaum/followers","following_url":"https://api.github.com/users/ericbaum/following{/other_user}","gists_url":"https://api.github.com/users/ericbaum/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbaum/subscriptions","organizations_url":"https://api.github.com/users/ericbaum/orgs","repos_url":"https://api.github.com/users/ericbaum/repos","events_url":"https://api.github.com/users/ericbaum/events{/privacy}","received_events_url":"https://api.github.com/users/ericbaum/received_events","type":"User","site_admin":false},"labels":[{"id":674169029,"url":"https://api.github.com/repos/dojot/device-manager/labels/Type:Bug","name":"Type:Bug","color":"ee0701","default":false},{"id":674169031,"url":"https://api.github.com/repos/dojot/device-manager/labels/Type:Enhancement","name":"Type:Enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dojot/device-manager/milestones/1","html_url":"https://github.com/dojot/device-manager/milestone/1","labels_url":"https://api.github.com/repos/dojot/device-manager/milestones/1/labels","id":3218238,"number":1,"title":"sprint-33","description":null,"creator":{"login":"ericbaum","id":4474364,"avatar_url":"https://avatars0.githubusercontent.com/u/4474364?v=4","gravatar_id":"","url":"https://api.github.com/users/ericbaum","html_url":"https://github.com/ericbaum","followers_url":"https://api.github.com/users/ericbaum/followers","following_url":"https://api.github.com/users/ericbaum/following{/other_user}","gists_url":"https://api.github.com/users/ericbaum/gists{/gist_id}","starred_url":"https://api.github.com/users/ericbaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericbaum/subscriptions","organizations_url":"https://api.github.com/users/ericbaum/orgs","repos_url":"https://api.github.com/users/ericbaum/repos","events_url":"https://api.github.com/users/ericbaum/events{/privacy}","received_events_url":"https://api.github.com/users/ericbaum/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2018-03-26T16:24:20Z","updated_at":"2018-03-26T16:25:16Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-03-26T16:25:15Z","updated_at":"2018-03-26T16:25:15Z","closed_at":null,"author_association":"MEMBER","body":"After updating the device-manager from the tag version 0.2.0-nightly20180321 to tag version 0.2.0-nightly20180326 the database model became inconsistent with the module returning the following error:\r\n\r\n```\r\n [SQL: 'SELECT anon_1.templates_id AS anon_1_templates_id, anon_1.templates_label AS anon_1_templates_label, anon_1.templates_created AS anon_1_templates_created, anon_1.templates_updated AS anon_1_templates_updated, attrs_1.id AS attrs_1_id, attrs_1.label AS attrs_1_label, attrs_1.created AS attrs_1_created, attrs_1.updated AS attrs_1_updated, attrs_1.type AS attrs_1_type, attrs_1.value_type AS attrs_1_value_type, attrs_1.static_value AS attrs_1_static_value, attrs_1.template_id AS attrs_1_template_id, attrs_1.parent_id AS attrs_1_parent_id \\nFROM (SELECT templates.id AS templates_id, templates.label AS templates_label, templates.created AS templates_created, templates.updated AS templates_updated \\nFROM templates \\n LIMIT %(param_1)s OFFSET %(param_2)s) AS anon_1 LEFT OUTER JOIN attrs AS attrs_1 ON anon_1.templates_id = attrs_1.template_id'] [parameters: {'param_1': 20, 'param_2': 0}] (Background on this error at: http://sqlalche.me/e/f405)\r\n10.46.0.11 - - [26/Mar/2018:16:15:26 +0000] \"GET /template HTTP/1.1\" 500 25 \"http://10.50.11.32/\" \"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0\"\r\n[2018-03-26 16:15:47,457] ERROR in app: Exception on /template [GET]\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py\", line 1193, in _execute_context\r\n    context)\r\n  File \"/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py\", line 507, in do_execute\r\n    cursor.execute(statement, parameters)\r\npsycopg2.ProgrammingError: column attrs_1.parent_id does not exist\r\nLINE 1: ...alue, attrs_1.template_id AS attrs_1_template_id, attrs_1.pa...\r\n```\r\nTo avoid this kind of issue it is necessary implementing some sort of database versioning and migration functionalities for when there are model changes."}}
{"actor":{"display_login":"ericbaum"}}