timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.78k stars 886 forks source link

[Bug]: Unable to use docker image with CloudNativePG #7151

Closed anshul-raman closed 3 months ago

anshul-raman commented 3 months ago

What type of bug is this?

Other

What subsystems and features are affected?

Other

What happened?

When I use timescale/timescaledb-ha docker image with CloudNativePG on GKE, it gives the following permission denied error:

 {"level":"error","ts":"2024-07-24T10:02:16Z","msg":"Error while checking for an existing PGData","logging_pod":"timescaledb-postgres-orignal-image-1-initdb","error":"stat /var/lib/postgresql/data/pgdata: permission denied","stacktrace":"github.com/cloudnative-pg/cloudnative-pg/pkg/management/log.(*logger).Error\n ││ \tpkg/management/log/log.go:128\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/log.Error\n\tpkg/management/log/log.go:166\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres.InitInfo.VerifyPGData\n\tpkg/management/postgres/initdb.go:103\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cm │
│ d/manager/instance/initdb.initSubCommand\n\tinternal/cmd/manager/instance/initdb/cmd.go:144\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/initdb.NewCmd.func2\n\tinternal/cmd/manager/instance/initdb/cmd.go:104\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/cobra@v1 ││ .8.0/command.go:983\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\nmain.main\n\tcmd/manager/main.go:64\nruntime.main\n\t/opt/hostedtoolcache/go/1.21.6/x64/src/ │
│ runtime/proc.go:267"}                                                                                                                                                                                                                                                                                                      ││ Error: stat /var/lib/postgresql/data/pgdata: permission denied

TimescaleDB version affected

2.5.0

PostgreSQL version used

15

What operating system did you use?

Linux

What installation method did you use?

Docker

What platform did you run on?

Google Cloud Platform (GCP)

Relevant log output and stack trace

{"level":"error","ts":"2024-07-24T10:02:16Z","msg":"Error while checking for an existing PGData","logging_pod":"timescaledb-postgres-orignal-image-1-initdb","error":"stat /var/lib/postgresql/data/pgdata: permission denied","stacktrace":"github.com/cloudnative-pg/cloudnative-pg/pkg/management/log.(*logger).Error\n ││ \tpkg/management/log/log.go:128\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/log.Error\n\tpkg/management/log/log.go:166\ngithub.com/cloudnative-pg/cloudnative-pg/pkg/management/postgres.InitInfo.VerifyPGData\n\tpkg/management/postgres/initdb.go:103\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cm │
│ d/manager/instance/initdb.initSubCommand\n\tinternal/cmd/manager/instance/initdb/cmd.go:144\ngithub.com/cloudnative-pg/cloudnative-pg/internal/cmd/manager/instance/initdb.NewCmd.func2\n\tinternal/cmd/manager/instance/initdb/cmd.go:104\ngithub.com/spf13/cobra.(*Command).execute\n\tpkg/mod/github.com/spf13/cobra@v1 ││ .8.0/command.go:983\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tpkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\tpkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039\nmain.main\n\tcmd/manager/main.go:64\nruntime.main\n\t/opt/hostedtoolcache/go/1.21.6/x64/src/ │
│ runtime/proc.go:267"}                                                                                                                                                                                                                                                                                                      ││ Error: stat /var/lib/postgresql/data/pgdata: permission denied

### How can we reproduce the bug?

```bash
Use the `timescale/timescaledb-ha:pg15-amd64` docker image with CloudNativePG on GKE
fabriziomello commented 3 months ago

@anshul-raman This repo is only for timescaledb extension development. For images there are another repo: https://github.com/timescale/timescaledb-docker.

Anyway looking at cloudnativepg documentation I don't think they support our images: https://cloudnative-pg.io/documentation/1.23/#container-images.