sea-orm: CLI unable to connect to psql via localhost
Description
I am unable to connect to my psql database through the fly.io proxy. Instead it just times out
Steps to Reproduce
- run the fly.io proxy which proxies to a db hosted by fly-io (ie
fly proxy 5432 -a <app>-db) export DATABASE_URL=postgres://<app>:<redacted>@localhost:5432/<app>?sslmode=disablesea-orm-cli generate entity -o src/entities
Expected Behavior
the CLI should be able to connect to the db and generate entities
Actual Behavior
Timeout
❯ RUST_LOG=trace sea-orm-cli generate entity -o src/entities -v
Connecting to Postgres ...
pool timed out while waiting for an open connection
Reproduces How Often
always
Workarounds
unable to work around
Reproducible Example
N/A
Versions
❯ cargo tree | grep sea-
├── sea-orm v0.12.3
│ ├── sea-orm-macros v0.12.3 (proc-macro)
│ │ ├── sea-bae v0.2.0 (proc-macro)
│ ├── sea-query v0.30.2
│ ├── sea-query-binder v0.5.0
│ │ ├── sea-query v0.30.2 (*)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (7 by maintainers)
Commits related to this issue
- [SeaORM] Tips on connection https://github.com/SeaQL/sea-orm/issues/1917 — committed to SeaQL/seaql.github.io by tyt2y3 3 years ago
I’ve switched to rancher desktop from docker desktop recently and since I also got the timeout error from sea-orm-cli generate entity. It also only happens with sea-orm-cli, sqlx cli works as expected. Fortunately I just tried using 127.0.0.1 and it also fixes it for me.
So I think this must be the same issue.
So, to reproduce you could
That’s interesting finding, thanks.
Some other info I’ve uncovered - this only breaks with
@localhostnot@127.0.0.1, and only with theasync-stdfeature turned on (which is the default). With tokiolocalhostworks fine