Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relation queries does not exist on postgres docker when deploying on k8s #7

Closed
pkaramol opened this issue Nov 15, 2019 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@pkaramol
Copy link

Issue Summary

A summary of the issue and the browser/OS environment in which it occurs.

Steps to Reproduce

Deploying redash on GKE using helm (οver istio).

All containers reach a Running state.

The REDASH_DATABASE_URL=postgresql://postgres:somepass@postgres/postgres is correct.

I managed to connect to it both from an external and internal

However I get an

Internal Server Error 500

when trying tying to connect.

Here are the postgres logs:

➢  k logs -f redash-postgres-56d9d75f7d-kczk4 redash-postgres
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
performing post-bootstrap initialization ... No usable system locales were found.
Use the option "--debug" to see details.
ok
syncing data to disk ... ok

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start


WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
waiting for server to start....LOG:  database system was shut down at 2019-11-15 09:58:36 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
 done
server started

/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

LOG:  received fast shutdown request
LOG:  aborting any active transactions
LOG:  autovacuum launcher shutting down
waiting for server to shut down....LOG:  shutting down
LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

LOG:  database system was shut down at 2019-11-15 09:58:37 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
ERROR:  relation "queries" does not exist at character 979
STATEMENT:  SELECT queries.query AS queries_query, queries.updated_at AS queries_updated_at, queries.created_at AS queries_created_at, queries.id AS queries_id, queries.version AS queries_version, queries.org_id AS queries_org_id, queries.data_source_id AS queries_data_source_id, queries.latest_query_data_id AS queries_latest_query_data_id, queries.name AS queries_name, queries.description AS queries_description, queries.query_hash AS queries_query_hash, queries.api_key AS queries_api_key, queries.user_id AS queries_user_id, queries.last_modified_by_id AS queries_last_modified_by_id, queries.is_archived AS queries_is_archived, queries.is_draft AS queries_is_draft, queries.schedule AS queries_schedule, queries.schedule_failures AS queries_schedule_failures, queries.options AS queries_options, queries.search_vector AS queries_search_vector, queries.tags AS queries_tags, query_results_1.id AS query_results_1_id, query_results_1.retrieved_at AS query_results_1_retrieved_at
	FROM queries LEFT OUTER JOIN query_results AS query_results_1 ON query_results_1.id = queries.latest_query_data_id

Any other info e.g. Why do you consider this to be a bug? What did you expect to happen instead?

Have redash running normally since all environmental variables are correct (at least in terms to DB connectivity)

Technical details:

  • Redash Version: redash/redash:8.0.0.b32245
  • Browser/OS: NA/ GKE with
  • Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.11-gke.14", GitCommit:"56d89863d1033f9668ddd6e1c1aea81cd846ef88", GitTreeState:"clean", BuildDate:"2019-11-07T19:12:22Z", GoVersion:"go1.12.11b4", Compiler:"gc", Platform:"linux/amd64"}
  • Helm (Tiller) version:
➢  helm version --tls
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.11.0", GitCommit:"2e55dbe1fdb5fdb96b75ff144a339489417b146b", GitTreeState:"clean"}

istio 1.1.14

  • How did you install Redash: Created helm charts from this docker compose configuration.
@pkaramol
Copy link
Author

I even tried to add the following init-container in the redash helm

      initContainers:
        - name: init-postgres
          image: "{{ .ctx.Values.image }}:{{ .ctx.Values.tag }}"
          args: ["server", "create_db"]

but the end result remains the same.

@arikfr arikfr transferred this issue from getredash/redash Nov 24, 2019
@grugnog grugnog added the bug Something isn't working label Dec 5, 2019
@grugnog
Copy link
Collaborator

grugnog commented Oct 1, 2020

@pkaramol I missed this the first time round, but it looks like you are using a custom helm chart generated from Docker Compose. If you are still having trouble, try using the helm chart in this repository, which includes some hooks to handle installs/updates.

@grugnog grugnog closed this as completed Oct 1, 2020
lucasfcnunes pushed a commit to lucasfcnunes/contrib-helm-chart that referenced this issue Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants