Gladys HS, need help!

Good evening everyone,

I’m left without an assistant tonight: Gladys won’t start anymore, and I don’t really know why. I have these entries in the logs:

\u003e 2025-10-05T20:02:51+0200 \u003cerror\u003e index.js:16 (process.\u003canonymous\u003e) [Error: Connection Error:

Hi @jean_bruder, do you have the rest of the logs?

This log indicates that DuckDB closed the connection to the file on disk, but in my opinion that’s not the underlying issue in your case.

Hello @pierre-gilles

Can you remind me how to provide you with the full support log?

Thanks,
Jean

You can do:

docker logs gladys

If you want to limit to the last 1000 logs, for example:

docker logs gladys --tail=1000

Good evening @pierre-gilles

The only lines I have are the following when I display the logs via docker-compose logs gladys :

\u003e Gladys | 2025-10-06T23:17:08+0200 \u003cerror\u003e index.js:15 (process.\u003canonymous\u003e) unhandledRejection catched: Promise {
Gladys | \u003crejected\u003e [Error: Connection Error: Connection was never established or has been closed already] {
Gladys | errno: -1,
Gladys | code: ‹ DUCKDB_NODEJS_ERROR ›,
Gladys | errorType: ‹ Connection ›
Gladys | }
Gladys | }
Gladys | 2025-10-06T23:17:08+0200 \u003cerror\u003e index.js:16 (process.\u003canonymous\u003e) [Error: Connection Error: Connection was never established or has been closed already] {
Gladys | errno: -1,
Gladys | code: ‹ DUCKDB_NODEJS_ERROR ›,
Gladys | errorType: ‹ Connection ›
Gladys | }
Gladys | 2025-10-06T23:17:38+0200 \u003cerror\u003e index.js:15 (process.\u003canonymous\u003e) unhandledRejection catched: Promise {
Gladys | \u003crejected\u003e [Error: Connection Error: Connection was never established or has been closed already] {
Gladys | errno: -1,
Gladys | code: ‹ DUCKDB_NODEJS_ERROR ›,
Gladys | errorType: ‹ Connection ›
Gladys | }
Gladys | }
Gladys | 2025-10-06T23:17:38+0200 \u003cerror\u003e index.js:16 (process.\u003canonymous\u003e) [Error: Connection Error: Connection was never established or has been closed already] {
Gladys | errno: -1,
Gladys | code: ‹ DUCKDB_NODEJS_ERROR ›,
Gladys | errorType: ‹ Connection ›
Gladys | }

Could this help? Thanks in advance,
Jean

Good evening @pierre-gilles

I just fixed the error by recreating the file gladys-production.duckdb.wal on Gladys startup. Well, I lost the sensors’ state history, a shame for the temperature and humidity statistics :wink:

Sorry for the disturbance/noise …

Have a nice evening,
Jean

What kind of hardware are you running Gladys on?

Unless you did something wrong, it’s not normal to have database problems like that.

Hello @pierre-gilles

I think this was due to a power outage that occurred at the beginning of the week… Of course, that doesn’t help…

DuckDB is an ACID-compliant database, so it’s supposed to work correctly even with a power outage that interrupts your system while in use.

However, if you’re using a storage medium that can be corrupted in that kind of situation (e.g., a microSD), then DuckDB can’t do anything about it.

You’re on a mini-PC with a reliable SSD, right?

Good evening @pierre-gilles

Gladys (and my home automation ecosystem) runs on a Rock64 (equivalent to a Raspberry Pi 4), hosted on an SSD. I’ll dig through the available logs, but since it’s resolved, I won’t spend too much time…

Have a nice evening,
Jean

I think you’ll need to invest in a UPS or a battery HAT for your Rock64 so you don’t have this kind of problem during power outages.

1 Like

Normally, none of that is needed, Gladys uses robust technologies (SQLite and DuckDB) which are both ACID-compliant (in French → Propriétés ACID — Wikipédia).

A power outage usually has no impact on the reliability of these database systems, which are designed for that.

I had a power cut this morning (first time in a very long time :joy:), and everything resumed smoothly even though I have a heavily loaded database.

If @jean_bruder has to invest in something, it would rather be a robust mini-PC, I’d say :stuck_out_tongue:

The Beelink mini S13 is a very good model that I recommend (16 GB of RAM, low-power Intel N150 CPU, 512 GB SSD). That’s what I offer via the starter kit but it can be found on plenty of other sites :wink:

1 Like