Comments (6)
One of them is listening on ipv4, the other on ipv6.
Generally, a user expects us to stick to one protocol, right? Meanwhile, one way to reduce confusion would be reporting URLs of apps to reach them at instead of just port numbers (and we do have all the info required for it).
from postgrest.
The problem here is the app server binds to [::1]:3000
and admin server binds to 127.0.0.1:3000
because bindPortTCP
binds to whatever address available and localhost
resolves in both [::1]
and 127.0.0.1
addresses.
Anyway, with #3512 admin server is bound to the same address as main, so specifying the same port results in a runtime error:
❯ PGRST_SERVER_PORT=3000 PGRST_SERVER_HOST='localhost' PGRST_ADMIN_SERVER_PORT=3000 postgrest-with-postgresql-16 postgrest-run
postgrest-with-postgresql-16: You can connect with: psql 'postgres:///postgres?host=/run/user/1000/postgrest/postgrest-with-postgresql-16-BBy/socket' -U postgres
postgrest-with-postgresql-16: You can tail the logs with: tail -f /run/user/1000/postgrest/postgrest-with-postgresql-16-BBy/db.log
postgrest: Network.Socket.bind: resource busy (Address already in use)
Temporary directory kept at: /run/user/1000/postgrest/postgrest-with-postgresql-16-BBy
Although the above runtime error is rather uninformative. I wonder if I should validate the config and fail if port numbers match, or just add logs, like binding main app to <hostname>:<port>; binding admin app to <hostname>:<port>
? The latter could be useful to admins either way, and the runtime error would make perfect sense either way: when ports are equal — the problem is with the PostgREST config; otherwise there's some other service occupying the same port.
from postgrest.
Okay, we actually do diagnostic messages "[Admin server] listening on port <port>"
, but in the case of the port conflict neither of those is shown before the runtime error.
from postgrest.
Generally, a user expects us to stick to one protocol, right?
This sounds very plausible - but I'm not 100% sure.
I can easily imagine scenarios where I don't want this to be the case.
Isn't the whole problem here that we only have server-host
, but not admin-server-host
?
I think it's quite reasonable to have the admin server listen on 127.0.0.1
only, but the regular server on 0.0.0.0
.
So even if it's the same protocol, we probably still need a way to allow setting different hosts.
Meanwhile, one way to reduce confusion would be reporting URLs of apps to reach them at instead of just port numbers (and we do have all the info required for it).
Agreed, that would be really good.
Overall, even given both admin-server-host
and the display of URLs, I think we should still prevent using the same port number on both on the config level already. This only leads to confusion and ambiguity.
from postgrest.
Related Issues (20)
- arm builds failing in CI HOT 4
- Cannot nix run PostgREST on aarch64-darwin HOT 2
- Add pool checkout to `Server-Timing` HOT 1
- POST header Prefer: return=headers-only not returning LOCATION information HOT 2
- `600 Operator Error` status code
- The Case of count() : doc not ok HOT 4
- DB_SCHEMAS does not display all schemas in Swagger
- Accept header value shoud be case-insensitive
- Support structured data in PostgreSQL `COMMENT`s HOT 1
- Proper Media Types parser
- Write docs for v12.2.0 minor release HOT 13
- Update CI runners to macos v14
- www.postgrest.org links to strange site HOT 1
- Row Filter parameter format is displayed as `integer`
- Cancel query where client connection was terminated HOT 3
- Calculate math with addition, submission or calculated field
- Documentation does not mention that Updates can use the `columns` parameter or `missing=default` preference
- The schema cache load is not retried with exponential backoff HOT 1
- Clean up arm job when run again HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgrest.