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

Restore to non-localhost database #204

Open
pangolingo opened this issue Mar 1, 2023 · 1 comment
Open

Restore to non-localhost database #204

pangolingo opened this issue Mar 1, 2023 · 1 comment

Comments

@pangolingo
Copy link

I would like to use parity to restore Heroku to a dev database. But that catch is that the dev database is not available at localhost. It's running in a Docker container (I'm also running the parity command in another Docker container), and has a hostname, username and password. This is the connection URL: postgresql://postgres:password@db:5432/hub_development?timeout=5000

As far as I can tell, Parity ignores all the DB config expect for the DB name, and tries to connect on localhost with no username/password.


Help us track down and resolve parity problems faster with this template.

What command did you execute?

development restore production

What did you expect to happen?

I expected the Prod database to be downloaded and restored to my local database (which is running in a Docker container using Docker Compose)

What actually happened?

I got an error:

dropdb: error: could not connect to database template1: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
pg_restore: connecting to database for restore
pg_restore: error: connection to database "hub_development" failed: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Some information about your installation

What's your operating system?
the mcr.microsoft.com/devcontainers/ruby:3.2 Docker container

What's the output of which development, which staging, which production?

vscode ➜ /workspaces/hub (feat/dockerize) $ which development
/usr/local/rvm/gems/default/bin/development
vscode ➜ /workspaces/hub (feat/dockerize) $ which staging
/usr/local/rvm/gems/default/bin/staging
vscode ➜ /workspaces/hub (feat/dockerize) $ which production
/usr/local/rvm/gems/default/bin/production

If installed via Rubygems, what's the gem version?
3.5.0

@pangolingo
Copy link
Author

I believe these two other PRs were attempting to address this:

#106

#173

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

No branches or pull requests

1 participant