radamar
radamar9mo ago

Local Convex Backend on remote server?

Hi all, Thanks for the amazing software! I'm new to Convex and I've been trying to setup a Docker container to run https://github.com/a16z-infra/ai-town on Hugging Face Spaces, and I'm almost there! The idea is to have the ai-town running on a single container, so folks can have an easy start duplicating it as a Space, setting up their own LLMs, etc. It's a demo on dev and not production. I have everything running already, locally on my docker env, however when I set VITE_CONVEX_URL to the final space docker, in my case https://radames-ai-town.hf.space/backend it trows an error on validateDeploymentUrl https://github.com/get-convex/convex-backend/blob/13337fd5fe4ead354962df8b9c94fc22b5ab6ace/npm-packages/convex/src/common/index.ts#L23-L61 Thanks! looking forward to share about it when it works!
3 Replies
ian
ian9mo ago
Ah that check is to help regular convex users from entering a bad url. For now it looks like you’d have to work around it or fork the client. Could you have your url be /backend/localhost or /backend.convex.cloud? I wonder if /backend#localhost would work or if internally it would try to concatenate from there. Sorry you’re running into this
radamar
radamarOP9mo ago
amazing! smart workaround thanks! I didn't noticed it was only checking the end of the string! since I have control over the proxy, I could change that route! 👏 but now I got another issue, not sure why, maybe i need to compile the backend on this remote machine?
2024-05-07T06:18:05.632469Z DEBUG common::errors: IndexWorker died

Caused by:
0: Data read or written in this mutation changed while it was being run. Consider reducing the amount of data read by using indexed queries with selective index range expressions (https://docs.convex.dev/database/indexes/).
1: Orig Error: Data read or written in this mutation changed while it was being run. Consider reducing the amount of data read by using indexed queries with selective index range expressions (https://docs.convex.dev/database/indexes/).: A call to "schema_worker_mark_valid" changed the document with ID "jg2enj9d2fa089dzg3k6s70tc56rm1tj".
(conflicts with read of system table _schemas.by_state). Use RUST_BACKTRACE=1 READ_SET_CAPTURE_BACKTRACES=true to find trace of relevant reads.

Stack backtrace:
0: anyhow::error::<impl anyhow::Error>::msg
2024-05-07T06:18:05.632494Z ERROR common::errors: Not reporting above error: Sentry is not configured
2024-05-07T06:18:05.632501Z ERROR database::index_worker: IndexWorker died, num_failures: 1. Backing off for 246ms
2024-05-07T06:18:05.632469Z DEBUG common::errors: IndexWorker died

Caused by:
0: Data read or written in this mutation changed while it was being run. Consider reducing the amount of data read by using indexed queries with selective index range expressions (https://docs.convex.dev/database/indexes/).
1: Orig Error: Data read or written in this mutation changed while it was being run. Consider reducing the amount of data read by using indexed queries with selective index range expressions (https://docs.convex.dev/database/indexes/).: A call to "schema_worker_mark_valid" changed the document with ID "jg2enj9d2fa089dzg3k6s70tc56rm1tj".
(conflicts with read of system table _schemas.by_state). Use RUST_BACKTRACE=1 READ_SET_CAPTURE_BACKTRACES=true to find trace of relevant reads.

Stack backtrace:
0: anyhow::error::<impl anyhow::Error>::msg
2024-05-07T06:18:05.632494Z ERROR common::errors: Not reporting above error: Sentry is not configured
2024-05-07T06:18:05.632501Z ERROR database::index_worker: IndexWorker died, num_failures: 1. Backing off for 246ms
going to try the latest https://github.com/get-convex/convex-backend/releases/download/precompiled-2024-05-07-13337fd/convex-local-backend-x86_64-unknown-linux-gnu.zip Another potential issue is my Docker space user doesn't have root privileged access thanks it's all resolved now!
ian
ian9mo ago
great! When you have it in a good place to share, I'm sure others would love to see your Dockerfile / etc.

Did you find this page helpful?