LukasPatzke / homebridge-ambient-hue

Apache License 2.0
4 stars 1 forks source link

Database error, bridge crash, after installing for the first time #9

Open patroza opened 2 years ago

patroza commented 2 years ago

Describe The Bug: The bridge crashes on startup

To Reproduce: Install 0.0.6 on a fresh Homebridge

Expected behavior: No errors, no crash :)

Logs:

17/02/2022, 09:45:09Ambient Hue BridgeERROR/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/TypeORMError.js:9
17/02/2022, 09:45:09Ambient Hue BridgeERROR/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/TypeORMError.js:9
17/02/2022, 09:45:09Ambient Hue BridgeERRORvar _this = _super.call(this, message) || this;
17/02/2022, 09:45:09Ambient Hue BridgeERRORvar _this = _super.call(this, message) || this;
17/02/2022, 09:45:09Ambient Hue BridgeERROR^
17/02/2022, 09:45:09Ambient Hue BridgeERROR^
17/02/2022, 09:45:09Ambient Hue BridgeERRORQueryFailedError: SQLITE_CONSTRAINT: NOT NULL constraint failed: light.name
17/02/2022, 09:45:09Ambient Hue BridgeERRORQueryFailedError: SQLITE_CONSTRAINT: NOT NULL constraint failed: light.name
17/02/2022, 09:45:09Ambient Hue BridgeERRORat QueryFailedError.TypeORMError [as constructor] (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/TypeORMError.js:9:28)
17/02/2022, 09:45:09Ambient Hue BridgeERRORat QueryFailedError.TypeORMError [as constructor] (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/TypeORMError.js:9:28)
17/02/2022, 09:45:09Ambient Hue BridgeERRORat new QueryFailedError (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/QueryFailedError.js:13:28)
17/02/2022, 09:45:09Ambient Hue BridgeERRORat new QueryFailedError (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/error/QueryFailedError.js:13:28)
17/02/2022, 09:45:09Ambient Hue BridgeERRORat Statement.handler (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js:117:38) {
17/02/2022, 09:45:09Ambient Hue BridgeERRORat Statement.handler (/private/var/lib/hoobs/ambienthuebridge/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js:117:38) {
17/02/2022, 09:45:09Ambient Hue BridgeERRORquery: `INSERT INTO "light"("id", "uniqueId", "name", "type", "modelid", "manufacturername", "productname", "on", "onControlled", "onThreshold", "briControlled", "briMax", "ctControlled", "smartoffOn", "smartoffBri", "smartoffCt", "smartoffActive", "published", "briCurveId", "ctCurveId") VALUES (?, ?, NULL, '', '', '', '', 0, 0, 0, 0, 254, 0, NULL, NULL, NULL, 0, 1, NULL, NULL)`,
17/02/2022, 09:45:09Ambient Hue BridgeERRORquery: `INSERT INTO "light"("id", "uniqueId", "name", "type", "modelid", "manufacturername", "productname", "on", "onControlled", "onThreshold", "briControlled", "briMax", "ctControlled", "smartoffOn", "smartoffBri", "smartoffCt", "smartoffActive", "published", "briCurveId", "ctCurveId") VALUES (?, ?, NULL, '', '', '', '', 0, 0, 0, 0, 254, 0, NULL, NULL, NULL, 0, 1, NULL, NULL)`,
17/02/2022, 09:45:09Ambient Hue BridgeERRORparameters: [ 0, 'a67fa08d-44dd-5a15-a0d3-6623729bc2b6' ],
17/02/2022, 09:45:09Ambient Hue BridgeERRORparameters: [ 0, 'a67fa08d-44dd-5a15-a0d3-6623729bc2b6' ],
17/02/2022, 09:45:09Ambient Hue BridgeERRORdriverError: [Error: SQLITE_CONSTRAINT: NOT NULL constraint failed: light.name] {
17/02/2022, 09:45:09Ambient Hue BridgeERRORdriverError: [Error: SQLITE_CONSTRAINT: NOT NULL constraint failed: light.name] {
17/02/2022, 09:45:09Ambient Hue BridgeERRORerrno: 19,
17/02/2022, 09:45:09Ambient Hue BridgeERRORerrno: 19,
17/02/2022, 09:45:09Ambient Hue BridgeERRORcode: 'SQLITE_CONSTRAINT'
17/02/2022, 09:45:09Ambient Hue BridgeERRORcode: 'SQLITE_CONSTRAINT'
17/02/2022, 09:45:09Ambient Hue BridgeERROR},
17/02/2022, 09:45:09Ambient Hue BridgeERROR},
17/02/2022, 09:45:09Ambient Hue BridgeERRORerrno: 19,
17/02/2022, 09:45:09Ambient Hue BridgeERRORerrno: 19,
17/02/2022, 09:45:09Ambient Hue BridgeERRORcode: 'SQLITE_CONSTRAINT'
17/02/2022, 09:45:09Ambient Hue BridgeERRORcode: 'SQLITE_CONSTRAINT'
17/02/2022, 09:45:09Ambient Hue BridgeERROR}
17/02/2022, 09:45:09Ambient Hue BridgeERROR}

Environment:

LukasPatzke commented 2 years ago

Can you enable the debug log "debugLog": true and attach the complete log from startup? It looks like the plugin receives lights without names from the hue bridge, which is quite unexpected.