jackc / jackc/tern

Tern is unable to find host accessible from SSH host

Open
#108 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.3k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Hi

Hope all is well!

I'm running the following command:
```
tern migrate --conn-string ${CONN_STR} --password ${PASSWORD} --migrations ./db/migrations --ssh-host ${BASTION_PUBLIC_IP} --ssh-user ec2-user
```

and am getting the following:
```
Unable to connect to PostgreSQL:
failed to connect to `host=... user=... database=...`: hostname resolving error (lookup : no such host)
```

I am able to SSH into the host and then perform the DNS lookup successfully.

I suspect tern is performing the DNS lookup locally (where the host is inaccessible) as opposed to on the ssh machine (where the host is accessible).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `tern migrate` command and its `--ssh-host`/`--ssh-user` options, then reproduce the command with the supplied connection string and bastion setup. Trace where the PostgreSQL hostname is resolved and verify completion by making the database host resolvable through the SSH host rather than the local environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
cli, databases, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.