{"action":"created","issue":{"url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/95","labels_url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/95/comments","events_url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/95/events","html_url":"https://github.com/OpenTechStrategies/smoke-alarm-portal/issues/95","id":98886057,"number":95,"title":"Import on fresh site broken on master.","user":{"login":"kfogel","id":401111,"avatar_url":"https://avatars.githubusercontent.com/u/401111?v=3","gravatar_id":"","url":"https://api.github.com/users/kfogel","html_url":"https://github.com/kfogel","followers_url":"https://api.github.com/users/kfogel/followers","following_url":"https://api.github.com/users/kfogel/following{/other_user}","gists_url":"https://api.github.com/users/kfogel/gists{/gist_id}","starred_url":"https://api.github.com/users/kfogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfogel/subscriptions","organizations_url":"https://api.github.com/users/kfogel/orgs","repos_url":"https://api.github.com/users/kfogel/repos","events_url":"https://api.github.com/users/kfogel/events{/privacy}","received_events_url":"https://api.github.com/users/kfogel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"kfogel","id":401111,"avatar_url":"https://avatars.githubusercontent.com/u/401111?v=3","gravatar_id":"","url":"https://api.github.com/users/kfogel","html_url":"https://github.com/kfogel","followers_url":"https://api.github.com/users/kfogel/followers","following_url":"https://api.github.com/users/kfogel/following{/other_user}","gists_url":"https://api.github.com/users/kfogel/gists{/gist_id}","starred_url":"https://api.github.com/users/kfogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfogel/subscriptions","organizations_url":"https://api.github.com/users/kfogel/orgs","repos_url":"https://api.github.com/users/kfogel/repos","events_url":"https://api.github.com/users/kfogel/events{/privacy}","received_events_url":"https://api.github.com/users/kfogel/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/milestones/7","html_url":"https://github.com/OpenTechStrategies/smoke-alarm-portal/milestones/Phase%201%20Production","labels_url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/milestones/7/labels","id":1210170,"number":7,"title":"Phase 1 Production","description":"The first production rollout -- the original pilot that ARC-CNI requested, covering just the North Central Division regions, sending an email per smoke alarm request, and offering only simple admin/reporting capability.","creator":{"login":"kfogel","id":401111,"avatar_url":"https://avatars.githubusercontent.com/u/401111?v=3","gravatar_id":"","url":"https://api.github.com/users/kfogel","html_url":"https://github.com/kfogel","followers_url":"https://api.github.com/users/kfogel/followers","following_url":"https://api.github.com/users/kfogel/following{/other_user}","gists_url":"https://api.github.com/users/kfogel/gists{/gist_id}","starred_url":"https://api.github.com/users/kfogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfogel/subscriptions","organizations_url":"https://api.github.com/users/kfogel/orgs","repos_url":"https://api.github.com/users/kfogel/repos","events_url":"https://api.github.com/users/kfogel/events{/privacy}","received_events_url":"https://api.github.com/users/kfogel/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2015-07-15T21:24:57Z","updated_at":"2015-08-04T17:54:09Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-08-04T04:23:02Z","updated_at":"2015-08-04T22:31:12Z","closed_at":null,"body":"I think data import with a fresh deployment is broken on master.  Today I tried on our intended production server with commit 48c894b1b5a, and on my dev box (having completely removed the database, removed the node_modules/ directory, and in general tried to make the box completely fresh and as similar to prod as possible) with commit b775600b1d.  I'll file one ticket even though the trees are slightly different and the corresponding symptoms are different -- it's not yet clear if there is one bug or two bugs here.  Assigning to self because prod needs to get deployed tonight, but @trystant please take a look at this issue if it's still open when you see it.  It's pretty important if we can't deploy master.\r\n\r\nIn both cases I went through the INSTALL.md steps in the usual way, and nothing in the setup seems amiss.\r\n\r\nOn prod with commit 48c894b1b5a (this is the one I reported in IRC earlier today):\r\n\r\n    deploy@getasmokealarm:~/smoke-alarm-portal$ time node data/import_into_postgres.js\r\n    BEGINNING: Mon Aug 03 2015 19:06:57 GMT-0400 (EDT)\r\n    Unhandled rejection SequelizeValidationError: 631 is not a valid string\r\n        at TEXT.validate (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/data-types.js:156:11)\r\n        at Object.QueryGenerator.escape (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:894:20)\r\n        at Object.<anonymous> (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:356:23)\r\n        at Array.map (native)\r\n        at Object.<anonymous> (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:352:23)\r\n        at arrayEach (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/lodash/index.js:1289:13)\r\n        at Function.<anonymous> (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/lodash/index.js:3345:13)\r\n        at Object.QueryGenerator.bulkInsertQuery (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:350:13)\r\n        at QueryInterface.bulkInsert (/home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/query-interface.js:575:33)\r\n        at /home/deploy/smoke-alarm-portal/node_modules/sequelize/lib/model.js:2068:34\r\n        at tryCatcher (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/util.js:26:23)\r\n        at Promise._settlePromiseFromHandler (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:503:31)\r\n        at Promise._settlePromiseAt (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:577:18)\r\n        at Promise._settlePromises (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:693:14)\r\n        at Async._drainQueue (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/async.js:123:16)\r\n        at Async._drainQueues (/home/deploy/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/async.js:133:10)\r\n    \r\n    real    0m19.658s\r\n    user    0m7.996s\r\n    sys     0m0.784s\r\n\r\nOn my refreshed dev environment with commit b775600b1d:\r\n\r\n    $ time node data/import_into_postgres.js\r\n    BEGINNING: Mon Aug 03 2015 21:59:44 GMT-0500 (CDT)\r\n    Unhandled rejection SequelizeDatabaseError: type \"json\" does not exist\r\n        at Query.formatError (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query.js:429:14)\r\n        at null.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query.js:108:19)\r\n        at emit (events.js:95:17)\r\n        at Query.handleError (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/pg/lib/query.js:108:8)\r\n        at null.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/pg/lib/client.js:171:26)\r\n        at emit (events.js:95:17)\r\n        at Socket.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/pg/lib/connection.js:109:12)\r\n        at Socket.emit (events.js:95:17)\r\n        at Socket.<anonymous> (_stream_readable.js:765:14)\r\n        at Socket.emit (events.js:92:17)\r\n        at emitReadable_ (_stream_readable.js:427:10)\r\n        at emitReadable (_stream_readable.js:423:5)\r\n        at readableAddChunk (_stream_readable.js:166:9)\r\n        at Socket.Readable.push (_stream_readable.js:128:10)\r\n        at TCP.onread (net.js:529:21)\r\n    Unhandled rejection SequelizeValidationError: 631 is not a valid string\r\n        at TEXT.validate (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/data-types.js:156:11)\r\n        at Object.QueryGenerator.escape (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:894:20)\r\n        at Object.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:356:23)\r\n        at Array.map (native)\r\n        at Object.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:352:23)\r\n        at arrayEach (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/lodash/index.js:1289:13)\r\n        at Function.<anonymous> (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/lodash/index.js:3345:13)\r\n        at Object.QueryGenerator.bulkInsertQuery (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/dialects/postgres/query-generator.js:350:13)\r\n        at QueryInterface.bulkInsert (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/query-interface.js:575:33)\r\n        at /home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/lib/model.js:2068:34\r\n        at tryCatcher (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/util.js:26:23)\r\n        at Promise._settlePromiseFromHandler (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:503:31)\r\n        at Promise._settlePromiseAt (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:577:18)\r\n        at Promise._settlePromises (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/promise.js:693:14)\r\n        at Async._drainQueue (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/async.js:123:16)\r\n        at Async._drainQueues (/home/kfogel/private/work/ots/client/red-cross/r/smoke-alarm-portal/node_modules/sequelize/node_modules/bluebird/js/main/async.js:133:10)\r\n    \r\n    real\t0m13.341s\r\n    user\t0m7.620s\r\n    sys\t0m0.348s\r\n    $ \r\n"},"comment":{"url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/comments/127780109","html_url":"https://github.com/OpenTechStrategies/smoke-alarm-portal/issues/95#issuecomment-127780109","issue_url":"https://api.github.com/repos/OpenTechStrategies/smoke-alarm-portal/issues/95","id":127780109,"user":{"login":"kfogel","id":401111,"avatar_url":"https://avatars.githubusercontent.com/u/401111?v=3","gravatar_id":"","url":"https://api.github.com/users/kfogel","html_url":"https://github.com/kfogel","followers_url":"https://api.github.com/users/kfogel/followers","following_url":"https://api.github.com/users/kfogel/following{/other_user}","gists_url":"https://api.github.com/users/kfogel/gists{/gist_id}","starred_url":"https://api.github.com/users/kfogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfogel/subscriptions","organizations_url":"https://api.github.com/users/kfogel/orgs","repos_url":"https://api.github.com/users/kfogel/repos","events_url":"https://api.github.com/users/kfogel/events{/privacy}","received_events_url":"https://api.github.com/users/kfogel/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T22:31:12Z","updated_at":"2015-08-04T22:31:12Z","body":"Good point, @trystant.\r\n\r\nOn production: Node v0.10.38, PostgreSQL 9.4.4, npm 1.4.21\r\nOn demo: exactly the same as on prod\r\nOn my dev environment: exactly the same as on prod"}}