a year ago
Template Bounty: Convex with Postgres
First successful post in this thread with:
- Convex
- Postgres
- Private Network Use
Will earn the bounty
Pinned Solution
a year ago
https://railway.com/deploy/convex
Here is my template
28 Replies
a year ago
Alright well. I've been stuck on this one error for over an hour. If anyone knows, please.
Error: Error occurred while creating a new object: error performing TLS handshake: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity))
SSL is completely disabled with the DO_NOT_USE_SSL=1 variable. I can connect totally fine with my device. I'm so lost.
a year ago
Hmm. Apparently Convex requires that you put nothing in the envvars. Could try this
https://station.railway.com/questions/postgre-sql-connection-issue-with-convex-fb8a7f81#gx0n
a year ago
Do you have one working with the public URL? Happy to pay out half for that!
jake
Do you have one working with the public URL? Happy to pay out half for that!
a year ago
Public URL doesn't work either. I've already tried what was suggested in that other post. No avail.
arnochenfx
<https://railway.com/deploy/PTm-L-?referralCode=PnLAIF>
a year ago
Please follow our best practices guide -
arnochenfx
<https://railway.com/deploy/PTm-L-?referralCode=PnLAIF>
a year ago
Hmm. Any reason to use PG vector vs vanilla postgres?
jake
Hmm. Any reason to use PG vector vs vanilla postgres?
a year ago
It's a mistake, I have changed to vanilla postgres
samgordon
Alright well. I've been stuck on this one error for over an hour. If anyone knows, please. `Error: Error occurred while creating a new object: error performing TLS handshake: invalid peer certificate: Other(OtherError(CaUsedAsEndEntity))` SSL is completely disabled with the `DO_NOT_USE_SSL=1` variable. I can connect totally fine with my device. I'm so lost.
a year ago
Look at debug or verbose output (if supported) to confirm whether TLS is still being attempted despite DO_NOT_USE_SSL=1.
Try explicitly disabling SSL in the configuration file or command line, not just through the environment variable.
brody
Please follow our best practices guide - <https://docs.railway.com/guides/templates-best-practices>
a year ago
https://railway.com/deploy/convex
Here is my template
a year ago
You got it. I was using 1 for disable SSL as per the documentation. Nice job lol.
arnochenfx
<https://railway.com/deploy/convex> Here is my template
a year ago
Thank you for your submission, before we can accept your template, please read over the best practices guide I linked and implement the suggestions listed on that page.
brody
Thank you for your submission, before we can accept your template, please read over the best practices guide I linked and implement the suggestions listed on that page.
a year ago
I have already made adjustments based on the templates-best-practices.
arnochenfx
I have already made adjustments based on the templates-best-practices.
a year ago
You have left out several best practices, to name a few -
- Missing service icons.
- Incorrect service names (dash delimited instead of space delimited)
- Incorrect name casing.
These, and more are mentioned in the docs page, please give it a read over and implemented the suggestions listed in the docs page.
brody
You have left out several best practices, to name a few - * Missing service icons. * Incorrect service names (dash delimited instead of space delimited) * Incorrect name casing. These, and more are mentioned in the docs page, please give it a read over and implemented the suggestions listed in the docs page.
a year ago
Thank you for your feedback. I have reviewed the documentation and updated the service icons, name casing, and naming conventions as suggested. Please let me know if any further adjustments are needed.
a year ago
Just tried this out... it works! Thank you!
Two friction points:
- I found we still needed to do the step where we remove the initial domain from the convex-backend and re-add one mapped to port 3210. Not sure if this can be skipped somehow.
- In my test, CONVEX_CLOUD_ORIGIN was now using the internal name, which caused the dashboard to populate the wrong value. I had to manually change this to the public name after doing step 1.
When this is all landed, hit me up on discord, happy to throw in another $100.
a year ago
Also, I see that Railway support durable volumes ( https://docs.railway.com/guides/volumes ).
1. The postgres image should be using one of those for postgres's data dir.
- The convex-backend /convex/data directory should also be using one. It contains file storage and other persistent blob data.
If we had postgres (as we do here), plus those two volumes, this is pretty close to a self-hosted convex that's unlikely to lose data for developers and will probably keep a decent HA.
jamwt
Also, I see that Railway support durable volumes ( <https://docs.railway.com/guides/volumes> ). 1\. The postgres image should be using one of those for postgres's data dir. 1. The convex-backend /convex/data directory should also be using one. It contains file storage and other persistent blob data. If we had postgres (as we do here), plus those two volumes, this is pretty close to a self-hosted convex that's unlikely to lose data for developers and will probably keep a decent HA.
a year ago
Thank you so much for your feedback and detailed suggestions! I've already made all the changes you mentioned.
Let me know if you notice anything else or if there’s any other improvement you'd like to see! Thanks again for your help.
arnochenfx
Thank you so much for your feedback and detailed suggestions! I've already made all the changes you mentioned. Let me know if you notice anything else or if there’s any other improvement you'd like to see! Thanks again for your help.
a year ago
Rock on. Checking with Brody and then will hit the payout button tomorrow! Great stuff :D
a year ago
Hey arnochenfx,
I've given it a closer look now that I'm at my laptop, and I can see some room for improvement -
1. Your pre-deploy command modifies the filesystem, since the pre-deploy command is run in a separate container, any changes made to the filesystem are not persisted in the runtime image. You would want to move that logic into the start command, make sure to exec ./run_backend.sh from within the shell wrapper as your final command.
2. Both the Dashboard and Backend services are missing health checks, / for the Dashboard and /version for the backend should be sufficient.
brody
Hey arnochenfx, I've given it a closer look now that I'm at my laptop, and I can see some room for improvement - 1\. Your pre-deploy command modifies the filesystem, since the pre-deploy command is run in a separate container, any changes made to the filesystem are not persisted in the runtime image. You would want to move that logic into the start command, make sure to `exec ./run_backend.sh` from within the shell wrapper as your final command. 2\. Both the Dashboard and Backend services are missing health checks, `/` for the Dashboard and `/version` for the backend should be sufficient.
a year ago
Hey brody,
Thanks a lot for your feedback!
I've updated the configuration as you suggested. The health checks have now been added for both the Dashboard and Backend services, and I've also moved the pre-deploy logic into the Start Command.
a year ago
Looks great, thank you for putting up with all my feedback!
We can't wait to see what templates you will make in the future!
(I've notified Jake so that he can pay you out)
Status changed to Solved jake • 12 months ago
arnochenfx
<https://railway.com/deploy/convex> Here is my template
a year ago
Payout completed! Only thing is it seems the admin key might be broken?
Status changed to Open Railway • 12 months ago
jake
Payout completed! Only thing is it seems the admin key might be broken? <https://x.com/diblacksmith/status/1932104338408968618?s=46>
a year ago
Needs to follow the guide to generate a Admin Key.
The Admin Key is generated by the program inside the container based on INSTANCE_SECRET and INSTANCE_NAME, so we cannot directly specify a random one through environment variables. And INSTANCE_SECRET is generated by the template variable function.
Attachments





