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

Cannot dump database through SSH #36

Closed
ebeigarts opened this issue Oct 12, 2015 · 7 comments · Fixed by #37
Closed

Cannot dump database through SSH #36

ebeigarts opened this issue Oct 12, 2015 · 7 comments · Fixed by #37
Assignees

Comments

@ebeigarts
Copy link
Contributor

We are having problems importing the custom format dump using pg_restore on other machines - Segmentation fault (core dumped)

I think the default should be plain sql (this is also what pg_dump does by default) and maybe somehting like dokku postgres:export <app> -Fc could dump in the custom format.

WDYT?

Our current workaround is ssh root@<host> "docker exec dokku.postgres.<app> env PGPASSWORD=<pw> pg_dump --no-acl --no-owner -h localhost -U postgres -w <app>"

@josegonzalez
Copy link
Member

@Flink thoughts here?

@Flink
Copy link
Contributor

Flink commented Oct 12, 2015

I need to do some tests but I never dumped (nor restored) in plain SQL with PG and I never had any problems. (and I migrated data from Heroku to “real” PG servers, to containers, etc., it always worked). It might be a problem on your machines or maybe with a certain version of PG, I don’t know.

@ebeigarts Did you try to dump/restore directly on the machine and not through ssh? (just an idea)

@ebeigarts
Copy link
Contributor Author

@Flink it works locally on the machine. ssh -t / RequestTTY yes was the problem and this is the way dokku recommends. Using ssh -T dokku@<host> -- postgres:export <app> works. Using plain SQL dumps this wasn't a problem. Maybe there should be a warning in the README about this?

@ebeigarts
Copy link
Contributor Author

Maybe the postgres:export command could check if it is running in a tty and print a warning to stderr?

$ ssh -T root@<host> 'echo $SSH_TTY'

$ ssh -t root@<host> 'echo $SSH_TTY'
/dev/pts/4
Connection to <host> closed.

@Flink
Copy link
Contributor

Flink commented Oct 13, 2015

I think I had a similar problem on https://github.com/Flink/dokku-psql-single-container, I’ll take a look about what you’re suggesting :)

@josegonzalez
Copy link
Member

#19 @Flink maybe related?

@Flink
Copy link
Contributor

Flink commented Oct 13, 2015

Maybe we need to check for the tty yeah, I don’t know. I’ll do some testing :)

@ebeigarts ebeigarts changed the title Cannot dump database in plain SQL Cannot dump database through SSH Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants