Private URL not working (public URL works fine)
I've spun a new database service inside my project to run a libSQL database (https://github.com/tursodatabase/libsql/blob/main/docs/DOCKER.md).
The service itself is running fine and I can connect to it via its public URL from another service (a Bun API) inside the same project.
But using the private URL to connect does not work.
This is what I've done:
- Enabled private networking for both apps
- Added 3s of sleep before the start command. I can see the delays in my logs. From my Dockerfile:
- "migrator" is an executable that runs migrations on my database, and "server" is the API itself. The errors are coming from my migrator command.
- Manually set the PORT env variable in the libSQL service so that I can use it in the private URL from the API
- (just in case) Added
ENABLE_ALPINE_PRIVATE_NETWORKING
as true in my API service. I'm using an external image in my Dockerfile that I'm not sure is Alpine, so this might not be having an effect.
API logs (with private URL and port):
Project ID: 71754a48-09bb-4250-b361-ff5ab1df9597Solution:Jump to solution
hey @pauldps does this template work for you? https://railway.app/template/p121Tx
i was able to confirm it was working through the private network for me.
```
+-------------------------+------------------------------+----------+---------+-------+--------------+
| ENV | Host | Scheme | Status | Error | Duration |...
16 Replies
Project ID:
71754a48-09bb-4250-b361-ff5ab1df9597
Solution
hey @pauldps does this template work for you? https://railway.app/template/p121Tx
i was able to confirm it was working through the private network for me.
how do I deploy it inside my project? it doesn't show up in the template list, and I can't seem to be able to select the project when I click "Deploy Now"
haha blame cache, just hard refresh and it will show up
indeed π deploying now and trying to connect to it
is there a clever way to get a variable from a service to use it in another service? namely the private URL from the libSQL service
(I can just copy/paste in the meanwhile)
thanks, that worked!
awsome
10MB memory usage on the libsql service β¨ will watch how it behaves with large amounts of data later
i'd like to know that too!
API endpoint that hits the db = 4ms π₯³
about the 3s sleep, I should keep it for now, right?
looking forward to removing it when it's no longer needed (heard it's being planned) -- is there somewhere I can track this change?
yeah it's still needed, unfortunately I don't have a place for you to track the new runtime, I haven't even heard anything about it lately
np, it would only affect app wakeup, and a 3s time on that is not too bad
keep it hot instead π
New reply sent from Help Station thread:
"haha blame cache, just hard refresh and it will show up" - how can I do a "hard refresh"?You're seeing this because this thread has been automatically linked to the Help Station thread.
I had said that 7 months ago, cache would no longer be an issue today