I don’t know if this is related, but if we have a lot of triggers or actions, they don’t load completely.
It has no link, so I moved this post to a new topic ![]()
Do you have more information to give us?
Can you check your browser’s console?
Have you seen the details of the requests that are returning errors? (Network tab?)
Is the Gladys container crashing? I’d appreciate the logs if you have them…
Oh, you’re on Gladys Plus!
I’d be happy if you could send me the details of the local requests tonight.
You will find the requests in red in the Network tab, and you will open them to display the response.
yes.
ok, that works.
j’ai testé en local et aucun problème. C’est avec Gladys Plus que ça bug.
Lorsque c’est le cas, cela me renvois sur la page de configuration.
dans la console j’ai ça:
dans les logs j’ai ça.
at ChildProcess.<anonymous> (/src/server/lib/device/device.calculateAggregate.js:102:23)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
2022-03-07T21:27:10+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval daily
2022-03-07T21:27:10+0100 <info> gateway.backup.js:46 (Gateway.backup) Gateway backup: Encrypting backup
2022-03-07T21:27:10+0100 <info> gateway.backup.js:54 (Gateway.backup) Gateway backup: Uploading backup
2022-03-07T21:27:12+0100 <info> gateway.backup.js:59 (Gateway.backup) Gladys backup uploaded with success to Gladys Gateway. gladys-db-backup-2022-3-7-21-27-0.db
2022-03-07T21:27:19+0100 <warn> device.calculateAggregate.js:95 (Socket.<anonymous>) device.calculateAggregate stderr: DatabaseError [SequelizeDatabaseError]: SQLITE_CORRUPT: database disk image is malformed
at Query.formatError (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:415:16)
at Query._handleQueryResponse (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
at Statement.afterExecute (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:246:27) {
parent: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
original: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;",
parameters: undefined
}
2022-03-07T21:27:19+0100 <warn> device.calculateAggregate.js:101 (ChildProcess.<anonymous>) device.calculateAggregate: Exiting child process with code 1
2022-03-07T21:27:19+0100 <error> device.onHourlyDeviceAggregateEvent.js:27 (DeviceManager.onHourlyDeviceAggregateEvent) Error: DatabaseError [SequelizeDatabaseError]: SQLITE_CORRUPT: database disk image is malformed
at Query.formatError (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:415:16)
at Query._handleQueryResponse (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
at Statement.afterExecute (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:246:27) {
parent: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
original: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-02-15 23:00:00.000 +00:00' AND '2022-03-06 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;",
parameters: undefined
}
at ChildProcess.<anonymous> (/src/server/lib/device/device.calculateAggregate.js:102:23)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
2022-03-07T21:27:20+0100 <info> device.calculateAggregate.js:38 (DeviceManager.calculateAggregate) Calculating aggregates device feature state for interval monthly
2022-03-07T21:27:29+0100 <warn> device.calculateAggregate.js:95 (Socket.<anonymous>) device.calculateAggregate stderr: DatabaseError [SequelizeDatabaseError]: SQLITE_CORRUPT: database disk image is malformed
at Query.formatError (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:415:16)
at Query._handleQueryResponse (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
at Statement.afterExecute (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:246:27) {
parent: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
original: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;",
parameters: undefined
}
2022-03-07T21:27:29+0100 <warn> device.calculateAggregate.js:101 (ChildProcess.<anonymous>) device.calculateAggregate: Exiting child process with code 1
2022-03-07T21:27:29+0100 <error> device.onHourlyDeviceAggregateEvent.js:32 (DeviceManager.onHourlyDeviceAggregateEvent) Error: DatabaseError [SequelizeDatabaseError]: SQLITE_CORRUPT: database disk image is malformed
at Query.formatError (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:415:16)
at Query._handleQueryResponse (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:72:18)
at Statement.afterExecute (/src/server/node_modules/sequelize/lib/dialects/sqlite/query.js:246:27) {
parent: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
original: [Error: SQLITE_CORRUPT: database disk image is malformed] {
errno: 11,
code: 'SQLITE_CORRUPT',
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;"
},
sql: "SELECT `value`, `created_at` FROM `t_device_feature_state` AS `t_device_feature_state` WHERE `t_device_feature_state`.`device_feature_id` = '04d521be-6b56-463a-a0de-5f540ac76a9a' AND `t_device_feature_state`.`created_at` BETWEEN '2022-01-31 23:00:00.000 +00:00' AND '2022-02-28 23:00:00.000 +00:00' ORDER BY `t_device_feature_state`.`created_at` ASC;",
parameters: undefined
}
at ChildProcess.<anonymous> (/src/server/lib/device/device.calculateAggregate.js:102:23)
at ChildProcess.emit (events.js:400:28)
at maybeClose (internal/child_process.js:1058:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
2022-03-07T21:27:42+0100 <info> scene.actions.js:267 (Object.user.check-presence) CheckUserPresence action: No devices of the user "vincent" were seen in the last 16 minutes.
2022-03-07T21:27:42+0100 <info> scene.actions.js:270 (Object.user.check-presence) CheckUserPresence action: Set "vincent" to left home of house "appart"
Je ne pense pas que c’est un rapport mais dans la dernière ligne il appel ma maison ''appart" ce qui était le cas, mais j’ai changé par “maison” est ce qu’il n’y aurait pas un truc là aussi ?
Doesn’t that scare you?
I’m scared!
Your database is corrupted as the logs indicate, which must be causing bugs everywhere. Connection issues with Gladys Plus are just a consequence of this corrupted database.
Are you sure you’re using an SD card for Gladys or an SSD?
On SSD, I noticed it and I think it’s due to the addition of Zigbee devices unless there’s another reason.
Oh dear, that’s not normal then ![]()
Did you add a very verbose Zigbee device?
To repair your DB, SQLite3 has tools to do it (https://stackoverflow.com/questions/18259692/how-to-recover-a-corrupt-sqlite3-database/57872238#57872238), after that it’s CLI
No, just snzb-01, 02, 03,
Ok, I would be curious to know what happened…
To fix this issue, you will need to use the CLI, I think. If you want to do it yourself, you need to do this: https://stackoverflow.com/questions/18259692/how-to-recover-a-corrupt-sqlite3-database/57872238#57872238 (after stopping gladys of course), then do not do this directly on your production DB, we don’t know what the CLI will be able to do, you must copy the DB first.
Otherwise, if this is gibberish to you, I can fix the problem on my side if you don’t mind sending me your DB.
If you don’t mind, you connect via SSH, you do:
docker stop gladys
Then you retrieve the file in /var/lib/gladysassistant/gladys-production.db
And you send me this file in private.
I will do the fix and send you back the file. The only downside of this solution is that well, while I fix your DB you cannot use Gladys (or use it, but well everything will be lost when you replace the DB file with the corrected file)
We’ll do that, no problem.
I don’t have much on it.
I fixed the DB you sent me and sent it back to you fixed ![]()
Bad news, it’s exactly the same.
I don’t understand this line, I don’t have a device with this ID.
If you ever want to take control and check where it comes from, it’s possible.
Isn’t it simply actions linked to devices that no longer exist in Gladys?
I admit I’ve never tested this case
Can you test it in a new scene? You create a dummy MQTT device, you create a scene that does a « retrieve the last state » of this device, then you delete the device and you go back to the scene?
There, the behavior is good, when you delete an Mqtt device, it is deleted from the scenes as well.
I think this is more related to zigbee2mqtt devices.
In the zigbee2mqtt integration, I have many more devices in « devices » 20 than in « zigbee discovery » 13.
So in addition, if I don’t take the right one, isn’t that what makes it bug?
Shame on me, I still haven’t switched to Gladys Plus…
Here’s a mission to accomplish quickly





