Skip to content

Docker fails on first run - "-gt: unary operator expected" #297

@Malvineous

Description

@Malvineous

I am trying to run the Docker version timescale/timescaledb:2.18.0-pg17 but it fails on the initial run with the error /docker-entrypoint-initdb.d/001_timescaledb_tune.sh: line 50: [: -gt: unary operator expected.

I have /sys/fs/cgroup/ on my system but not the file memory.max, which I think is the problem. The script seems to fail if memory.max does not exist.

I am not sure if this is the cause of the following 'panic' or if that is something else.

/usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/000_install_timescaledb.sh
CREATE EXTENSION
2025-02-07 10:40:11.555 UTC [63] ERROR:  TimescaleDB background worker connected to template database, exiting
CREATE EXTENSION

/usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/001_timescaledb_tune.sh
2025-02-07 10:40:11.562 UTC [42] LOG:  background worker "TimescaleDB Background Worker Scheduler" (PID 63) exited with exit code 1
cat: can't open '/sys/fs/cgroup/memory.max': No such file or directory
/docker-entrypoint-initdb.d/001_timescaledb_tune.sh: line 50: [: -gt: unary operator expected
Using postgresql.conf at this path:
/var/lib/postgresql/data/postgresql.conf

Writing backup to:
/tmp/timescaledb_tune.backup202502071040

panic: bytes must be at least 1 byte (got 0)

goroutine 1 [running]:
github.com/timescale/timescaledb-tune/internal/parse.parseIntToFloatUnits(0x400010dc08?)
	/go/pkg/mod/github.com/timescale/timescaledb-tune@v0.18.0/internal/parse/parse.go:115 +0x114
github.com/timescale/timescaledb-tune/internal/parse.BytesToDecimalFormat(0x0?)
	/go/pkg/mod/github.com/timescale/timescaledb-tune@v0.18.0/internal/parse/parse.go:138 +0x1c
github.com/timescale/timescaledb-tune/pkg/tstune.(*Tuner).processQuiet(0x400010dee0, 0x40000732c0, 0x0)
	/go/pkg/mod/github.com/timescale/timescaledb-tune@v0.18.0/pkg/tstune/tuner.go:668 +0x44
github.com/timescale/timescaledb-tune/pkg/tstune.(*Tuner).Run(0x400010dee0, 0x0?, {0x15f1f8, 0x400003c048}, {0x15f218, 0x400003c050}, {0x15f218, 0x400003c058})
	/go/pkg/mod/github.com/timescale/timescaledb-tune@v0.18.0/pkg/tstune/tuner.go:300 +0x42c
main.main()
	/go/pkg/mod/github.com/timescale/timescaledb-tune@v0.18.0/cmd/timescaledb-tune/main.go:65 +0xf4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions