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

fix get-db-dump #48

Merged
merged 2 commits into from
Dec 1, 2022
Merged

fix get-db-dump #48

merged 2 commits into from
Dec 1, 2022

Conversation

tobiasmcnulty
Copy link
Member

@tobiasmcnulty tobiasmcnulty commented Oct 20, 2022

As a workaround for #47 we can simply evaluate the variable in the remote container instead of transferring it locally first.

Fixes this error:

$ inv staging pod.get-db-dump --db-var="DATABASE_URL"
kubectl --namespace <snip> exec -i deploy/web -- pg_dump -Fc --no-owner --clean --dbname W1020 20:38:47.334596 1586748 gcp.go:119] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.26+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
postgres://<snip> > caktus-website-staging_database.dump
W1020 20:38:47.959972 1586794 gcp.go:119] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.26+; use gcloud instead.
To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke
pg_dump: error: too many command-line arguments (first is "20:38:47.334596")
Try "pg_dump --help" for more information.
command terminated with exit code 1
/bin/bash: use: command not found
/bin/bash: line 1: To: command not found
/bin/bash: line 2: postgres://<snip>: No such file or directory

@copelco
Copy link
Member

copelco commented Nov 29, 2022

Does this work? The output has an error:

pg_dump: error: too many command-line arguments (first is "20:38:47.334596")

@tobiasmcnulty
Copy link
Member Author

Does this work? The output has an error:

pg_dump: error: too many command-line arguments (first is "20:38:47.334596")

That's the error without the fix (stderr from kubectl is being passed to pg_dump).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants