2 years ago
Description: Deploy v1.* of Twenty CRM on Railway
Category: Productivity and Automation
URL: https://railway.app/template/nAL3hA
(!) Hobby or Pro plan is required to deploy this template
Why? -> some services in this template may use more than 512MB of memory when deploying. The Free plan has a limit of 512MB of memory per service, so you likely need to upgrade to at least the Hobby plan
Please check the following docs of Twenty as well when setting up this template:
New: storage buckets
Now that Railway offers S3 buckets you can use them with this template. The template has already been updated to include a storage bucket for file storage. To configure this manually for previous deployments of this template do this:
Create new Bucket service
Add the following env variables to the
Twentyservice (changeSTORAGE_TYPEtos3):
STORAGE_TYPE="s3"
STORAGE_S3_NAME="${{Bucket.BUCKET}}"
STORAGE_S3_REGION="${{Bucket.REGION}}"
STORAGE_S3_ENDPOINT="${{Bucket.ENDPOINT}}"
STORAGE_S3_ACCESS_KEY_ID="${{Bucket.ACCESS_KEY_ID}}"
STORAGE_S3_SECRET_ACCESS_KEY="${{Bucket.SECRET_ACCESS_KEY}}"
Add them also to your
Twenty Worker
STORAGE_TYPE="${{Twenty.STORAGE_TYPE}}"
STORAGE_S3_NAME="${{Twenty.STORAGE_S3_NAME}}"
STORAGE_S3_REGION="${{Twenty.STORAGE_S3_REGION}}"
STORAGE_S3_ENDPOINT="${{Twenty.STORAGE_S3_ENDPOINT}}"
STORAGE_S3_ACCESS_KEY_ID="${{Twenty.STORAGE_S3_ACCESS_KEY_ID}}"
STORAGE_S3_SECRET_ACCESS_KEY="${{Twenty.STORAGE_S3_SECRET_ACCESS_KEY}}"
Versioning:
NOTE: By default the template always deploys the latest docker image: twentycrm/twenty:latest. But you can pin the deployments to a specific version by updating the source image of both the Twenty and Twenty Worker services. Example: twentycrm/twenty:v1.1.1.
Find all the versions available here: https://hub.docker.com/r/twentycrm/twenty/tags
Add a comment in this thread if you run into any issues with deploying
68 Replies
a year ago
Does this template support the google auth features?
a year ago
Yes it does, but you'd need to add the env variables yourself. I think this should help: https://twenty.com/developers/section/self-hosting/self-hosting-var check the "Auth" section
a year ago
I tried deploying the Twenty CRM template and provided the 4 email env variables but both my Twenty and Twenty Worker deployments crashed. The Deployment logs on both show the error
``` ERROR [ExceptionHandler] connect ECONNREFUSED 127.0.0.1:6379
Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete]```
a year ago
So after checking the github code, I noticed some recent changes from this week and last week that introduced Redis cache storage. To get everything working, I had to add a Redis database to the environment and set the REDIS_HOST and REDIS_PORT environment variables for both the Twenty server and the Twenty Worker. It might be helpful to include this setup in the template so future users can have everything working out of the box.
a year ago
Hi, so after I tried deploying with the redis server, I get the following error in my deploy logs:
```Error: getaddrinfo ENOTFOUND redis.railway.internal at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) { errno: -3007, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'redis.railway.internal' }
```
Any ideas how to fix this?
a year ago
Hi, so after I tried deploying with the redis server, I get the following error in my deploy logs:
```Error: getaddrinfo ENOTFOUND redis.railway.internalat GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) { errno: -3007, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'redis.railway.internal' }
```
Any ideas how to fix this?
Hi, thanks for the suggestion, I added Redis to the template.
I am however getting the same error as you. I tried adding sleep 3 && yarn start:prod as the start command as per: https://docs.railway.app/guides/private-networking#initialization-time but then the container does not start properly.
Did you manage to find a fix in the meantime?
It seems the services are unable to reach the Redis instance, I am unsure why though..
a year ago
Unfortunately I have not found a fix yet.
I tried adding the sleep 3 in the start command as well and also adding it in the twenty dockerfile and using my custom docker image instead for the server source image, but that did not work either.
I also saw that bullmq is being used in the message-queue.module-factory files and I found out that bullmq uses ioredis and I saw that the railway documentation mentions :ioredis is a Redis client for node.js, commonly used for connecting to Redis from a node application. When initializing a Redis client using ioredis, you must specify family=0 in the connection string to support connecting to both IPv6 and IPv4 connections
so I tried to add family: 0 in the code where the REDIS_HOST, REDIS_PORT environment variables are used and then using a custom docker image again, but that did not work either.
Maybe I configured it wrong when trying out these solutions and you have better luck!
I'll keep experimenting and will update here if I find a solution, but if you happen to discover something in the meantime, please let me know as I'm currently stuck and unable to deploy my services
a year ago
I also saw that bullmq is being used in the message-queue.module-factory files and I found out that bullmq uses ioredis and I saw that the railway documentation mentions :
ioredis is a Redis client for node.js, commonly used for connecting to Redis from a node application. When initializing a Redis client using ioredis, you must specify family=0 in the connection string to support connecting to both IPv6 and IPv4 connections
Thanks for pointing me to this! It seems that this is indeed what is causing the error. I added the MESSAGE_QUEUE_TYPE var and set it to pg-boss (default is bullmq) so it does not use bullmq and therefore also not ioredis, which seems to fix the redis connection issue. Not the ideal solution but at least the application works 
Let me know if this works for you!
a year ago
Yes, that worked for me!
Another approach I tried successfully was deploying the Redis database in a separate environment and connecting to it using the public domain. When I updated the environment variables to point to the public URL, it worked as expected.
I’m still unsure why the internal Redis connection is failing. Do you think this is an issue with Twenty or Railway? If you manage to find the root cause, please let me know!
a year ago
It's an issue with ioredis.
bullmq uses ioredis internally.
The private network is IPv6 only.
ioredis by default only works with IPv4.
a year ago
I see! Thank you for the help!
a year ago
Hey @thomasmol! Quick question—after deploying the template, are you seeing a NOAUTH Authentication required error when you try to sign up, log in, or create a workspace? I’m having a bit of trouble getting anything to work on my end.
Any ideas on what might be causing this? Is it possibly also related to Redis? Thanks!
a year ago
Hi Abdel, I don't think that is related to Redis, what are you seeing in your deploy logs? Did the db migrations run as well?
a year ago
The deploy logs are working fine but I get the following errors on the front-end when I try to do anything after deploying the app
Attachments
a year ago
Opened a PR to fix the Redis connection issue: https://github.com/twentyhq/twenty/pull/7736
This will allow connecting to the redis instance with a connection url, so we can append ?family=0
a year ago
Hello!
Looks like the template uses the outdated Postgres image from twenty, would you mind updating that when you get a chance?
Thanks!
brody
Hello!Looks like the template uses the outdated Postgres image from twenty, would you mind updating that when you get a chance?Thanks!
a year ago
Done!
a year ago
Perhaps the template page is still cached, but you've used the twenty-postgres-spilo image right?
brody
Perhaps the template page is still cached, but you've used the twenty-postgres-spilo image right?
a year ago
yes i did!
Attachments
a year ago
Noticed the Postgres service only has two variables, the password being set to a crazy insecure value of twenty, can you add a regular Postgres database into the template and then update its image, this is so that it will have all the proper variables configured.
Then you will need to update the URL reference variable on the twenty services.
brody
Noticed the Postgres service only has two variables, the password being set to a crazy insecure value of twenty, can you add a regular Postgres database into the template and then update its image, this is so that it will have all the proper variables configured.Then you will need to update the URL reference variable on the twenty services.
a year ago
Thanks for noticing. Its updated
a year ago
Deployment health of this template seems to be pretty low currently. Help me out and reply here with any issues you are encountering!
a year ago
Have you tried deploying your template? I did that and can see clear crashes.
a year ago
Fixed a few errors:
Added missing
APP_SECRETenv var for the worker service (auto gen secret of length 32)
Changed the
DATABASE_URLandDATABSE_PUBLIC_URLenv vars of the db service to start withpostgres://(previouslypostgreseql://, which caused a validation error)
However the db service seems to not start properly. I get /etc/runit/runsvdir/default/patroni: sleeping 90 seconds Config is empty message in the logs and then it shuts down. I am investigating this issue.
moigamijunior
hi! did you got the solution?
a year ago
I haven't yet unfortunately. Are you getting the same errors?
thomasmol
I haven't yet unfortunately. Are you getting the same errors?
a year ago
Yes! Sounds like worker cannot connect to DB. I've fixed the envs, but I got the timeout.
thomasmol
I haven't yet unfortunately. Are you getting the same errors?
a year ago
[Nest] 29 - 02/19/2025, 2:19:01 PM ERROR [TypeOrmModule] Unable to connect to the database (core). Retrying (4)...
Error: connect ECONNREFUSED fd12:e62c:e118::ac:6a89:25f5:5432
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
moigamijunior
[Nest] 29 - 02/19/2025, 2:19:01 PM ERROR [TypeOrmModule] Unable to connect to the database (core). Retrying (4)...Error: connect ECONNREFUSED fd12:e62c:e118::ac:6a89:25f5:5432at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)
a year ago
Yes that is because the database service is not healthy actually. The service says 'Active', but check the deploy logs of the db and you'll see it is not live. Can you share the logs you see there?
thomasmol
Yes that is because the database service is not healthy actually. The service says 'Active', but check the deploy logs of the db and you'll see it is not live. Can you share the logs you see there?
a year ago
PermissionError: [Errno 13] Permission denied: '/var/lib/postgresql/data/pgdata'
brody
Noticed the Postgres service only has two variables, the password being set to a crazy insecure value of twenty, can you add a regular Postgres database into the template and then update its image, this is so that it will have all the proper variables configured.Then you will need to update the URL reference variable on the twenty services.
a year ago
Did not manage to get it working with this suggestion. Eventually removed the db service and built a new one directly from the twenty postgres spilo image, instead of creating a regular railway based postgres db and then manually changing the image.
That fixed the db connecting issue.
However, there is another problem, now in the twenty server service, which according to the official docker compose now uses 2 volumes. I can't seem to get it working yet and i get this error in the the deploy logs: touch: /app/docker-data/db_status: No such file or directory which makes sense because it is only mounted to /app/packages/twenty/data and you can't mount to two volumes. If you mount the volume to app/docker-data you'll get an error saying the entrypoint.sh is missing. Any ideas how to fix this issue?
thomasmol
Did not manage to get it working with this suggestion. Eventually removed the db service and built a new one directly from the twenty postgres spilo image, instead of creating a regular railway based postgres db and then manually changing the image.That fixed the db connecting issue.However, there is another problem, now in the twenty server service, which according to the official docker compose now uses 2 volumes. I can't seem to get it working yet and i get this error in the the deploy logs: touch: /app/docker-data/db_status: No such file or directory which makes sense because it is only mounted to /app/packages/twenty/data and you can't mount to two volumes. If you mount the volume to app/docker-data you'll get an error saying the entrypoint.sh is missing. Any ideas how to fix this issue?
a year ago
I got something working but it is not ideal:
Updated the 'Twenty' to also include the
APP_SECRETenv var. The twenty worker now refers to the twenty service for this var.Postgres service volume is now mounted on
/home/postgres/pgdataand based on the twenty spilo image.Added a few env vars to the Postgres service:
SPILO_PROVIDER,ALLOW_NOSSLandPGUSER_SUPERUSER,PGPASSWORD_SUPERUSERand updated some var values like db name, so it is the same as in the official twenty docker compose
The template now seems to run, but the main 'Twenty' service still has the db_status error. It does run the db migrations properly.
So to get it working you first run the template as is. Then after in the 'Twenty' service you change the start command to yarn start:prod (db migrations are not run, regardless of the db migration env var), and redploy the service. This should now work.
Running yarn start:prod as a start command does not execute db migrations.
a year ago
Can you please bake in migrations into the template, and then have it from start:prod, it's not something the user should need to do.
brody
Can you please bake in migrations into the template, and then have it from start:prod, it's not something the user should need to do.
a year ago
Yes I understand that perfectly Brody. I have been trying different commands/deploy config and can't get it working yet, and this is the best I can do thus far. Any help is much appreciated.
9 months ago
Recent deployments are close to a 100% success rate, so all looks good now. Also, since version 0.53, "upgrade is programmatically done within the DockerFile, this means from now on, you shouldn't have to run any command manually anymore." According to the official Twenty upgrade guides. So a nice change!
8 months ago
Deploys but still having DB issues, not sure if it's just me but can't get this app to work...
Error: Failed to load all config variables: relation "core.keyValuePair" does not exist
self-hosting-var page has been deleted and now 404's
8 months ago
DB still looks unhealthy, unable to connect to it, even through DBeaver afer adding public interface possibility.
UI tries to load but I got error: "Relation "core.user" does not exist".
Guys, please advice how to fix this situation?
Attachments
8 months ago
So it seems DB migrations are not properly run. To fix: add yarn database:init:prod as a Pre-deploy Command on the Twenty service. This should init the db properly and run migrations. @vicwrc: if you go to the postgres service settings and enable TCP Proxy to port 5432 you should be able to connect to it with DBeaver (even without running the pre-deploy command first).
I've updated the template:
- Twenty service now has yarn database:init:prod as a Pre-deploy command.
- I added a healthcheck to Twenty service, it checks path /healthz
You can find the run/deploy/migration commands that are used here: https://github.com/twentyhq/twenty/blob/main/packages/twenty-server/package.json
8 months ago
Hello, do we need to setup the cron jobs manually in the worker or is it already done in the template ? (update: just read the above comment that this is handled by docker now so nothing to do)
8 months ago
Hey Thomas!
We where talking about your template in Twenty's discord and one of their teammates raised the fact that this template might be deprecated?
https://discord.com/channels/1130383047699738754/1146466959676936192/1393160909530206288
What are your thoughts on that?
8 months ago
Bruh, just deployed it 2 days ago and works perfectly fine.
8 months ago
--
falz
Bruh, just deployed it 2 days ago and works perfectly fine.
8 months ago
Yeah I know, I use it everyday.
jbronssin
Hey Thomas!We where talking about your template in Twenty's discord and one of their teammates raised the fact that this template might be deprecated?https://discord.com/channels/1130383047699738754/1146466959676936192/1393160909530206288What are your thoughts on that?
8 months ago
Thanks, I'll take a look. I am not planning to deprecate this template and will keep maintaining for the time being!
8 months ago
I've updated the template to use an official Postgres image for the database, as per the docker-compose file provided by Twenty: https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/docker-compose.yml.
Changes:
Updated
Postgresservice source image topostgres:16Added
PGDATAvariable toPostgresservice with value/var/lib/postgresql/data/pgdataUpdated volume mount path to
/var/lib/postgresql/data/pgdataofPostgresservice
Previous deployments with the now deprecated twentycrm/twenty-postgres-spilo image for the Postgres DB should still work, and don't need to be migrated (if you do, make sure to backup your db)
thomasmol
I've updated the template to use an official Postgres image for the database, as per the docker-compose file provided by Twenty: https://raw.githubusercontent.com/twentyhq/twenty/refs/heads/main/packages/twenty-docker/docker-compose.yml.Changes:Updated Postgres service source image to postgres:16Added PGDATA variable to Postgres service with value /var/lib/postgresql/data/pgdataUpdated volume mount path to /var/lib/postgresql/data/pgdata of Postgres servicePrevious deployments with the now deprecated twentycrm/twenty-postgres-spilo image for the Postgres DB should still work, and don't need to be migrated (if you do, make sure to backup your db)
8 months ago
Well done mate!
So no need to migrate? Or might it become problematic over time?
jbronssin
Well done mate!So no need to migrate? Or might it become problematic over time?
8 months ago
Thank you!
I am not sure, it does not seem like a problem right now, but can't say it won't be in the future. If you want to follow the official way to deploy Twenty you might want to migrate.
Be careful though, backup your db so you can restore if needed after you migrate.
7 months ago
attempted to deploy the template today , but its not working .. something I need to do after I roll it out?
brianspelledwithani
attempted to deploy the template today , but its not working .. something I need to do after I roll it out?
7 months ago
Can you elaborate what you mean? Are you seeing errors? What do they say?
Update:
Seems to be an issue with creating new workspaces on a clean installs. I've created an github issue here: https://github.com/twentyhq/twenty/issues/13676
Deployments should be OK if you already had existing data
Update 2:
Issue has been solved, template can now be deployed again with latest version.
7 months ago
@thomasmol
I wanted to take time to migrate but discovered that I was on postgres:16 already... Was it done automatically
?
jbronssin
@thomasmol I wanted to take time to migrate but discovered that I was on postgres:16 already... Was it done automatically ?
7 months ago
Hmm interesting, I am not aware of templates updates being automatically propagated to existing deployments. Did the migration go OK?
thomasmol
Hmm interesting, I am not aware of templates updates being automatically propagated to existing deployments. Did the migration go OK?
7 months ago
everything is working like a charm 

6 months ago
I tried deploying this template, my "Twenty" deployment fails with below log
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Can someone help?
vivekdarak
I tried deploying this template, my "Twenty" deployment fails with below logFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memoryCan someone help?
6 months ago
Did you add resource limits to the service? I am not experiencing this with the latest version, perhaps redeploying could help.
Edit: It seems with the current version of Twenty, the server and worker services each use more than 0.5 GB RAM, even on fresh deployments. This means you might need to be at least on the Hobby plan to deploy this template without issues (Free plan has max of 0.5 GB RAM per service).
6 months ago
I was on a free plan which limits the RAM usage to 512MB, had to move to other plan. I did and was successfully able to install.
5 months ago
I tried to deploy with this template, but it keeps failing on me.
Deploy > Pre deploy command
Pre-deploy command failed
Starting Container
npm warn exec The following package was not found and will be installed: ts-node@10.9.2
Performed 'create schema "public"' successfully
Performed 'create schema "core"' successfully
Performed 'create extension "uuid-ossp"' successfully
Performed 'create extension "unaccent"' successfully
Performed 'create immutable unaccent wrapper function' successfully
query: SELECT * FROM current_schema()
query: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
query: SELECT version();
query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'core' AND "table_name" = '_typeorm_migrations'
query: SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESC
query failed: SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESC
error: Error: Query read timeout
Error during migration run:
QueryFailedError: Query read timeout
at PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SelectQueryBuilder.loadRawResults (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2192:25)
at async SelectQueryBuilder.getRawMany (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:646:29)
at async MigrationExecutor.loadExecutedMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:400:35)
at async MigrationExecutor.executePendingMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:136:36)
at async DataSource.runMigrations (/app/node_modules/typeorm/data-source/DataSource.js:265:35)
at async Object.handler (/app/node_modules/typeorm/commands/MigrationRunCommand.js:68:13) {
query: 'SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESC',
parameters: [],
driverError: Error: Query read timeout
at /app/node_modules/pg/lib/client.js:526:17
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)
at async SelectQueryBuilder.loadRawResults (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2192:25)
at async SelectQueryBuilder.getRawMany (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:646:29)
at async MigrationExecutor.loadExecutedMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:400:35)
at async MigrationExecutor.executePendingMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:136:36)
at async DataSource.runMigrations (/app/node_modules/typeorm/data-source/DataSource.js:265:35)
at async Object.handler (/app/node_modules/typeorm/commands/MigrationRunCommand.js:68:13)
}
Stopping Container
Whenever I'm lucky this step is successful, but then it'll still fail on Network.
Network > Healthcheck
Healthcheck failure
For this I don't have any logs unfortunately.
Any idea what's happening? Appreciate it!
jessezs
I tried to deploy with this template, but it keeps failing on me.Deploy > Pre deploy commandPre-deploy command failedStarting Containernpm warn exec The following package was not found and will be installed: ts-node@10.9.2Performed 'create schema "public"' successfullyPerformed 'create schema "core"' successfullyPerformed 'create extension "uuid-ossp"' successfullyPerformed 'create extension "unaccent"' successfullyPerformed 'create immutable unaccent wrapper function' successfullyquery: SELECT * FROM current_schema()query: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"query: SELECT version();query: SELECT * FROM "information_schema"."tables" WHERE "table_schema" = 'core' AND "table_name" = '_typeorm_migrations'query: SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESCquery failed: SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESCerror: Error: Query read timeoutError during migration run:QueryFailedError: Query read timeoutat PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:219:19)at process.processTicksAndRejections (node:internal/process/task_queues:105:5)at async SelectQueryBuilder.loadRawResults (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2192:25)at async SelectQueryBuilder.getRawMany (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:646:29)at async MigrationExecutor.loadExecutedMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:400:35)at async MigrationExecutor.executePendingMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:136:36)at async DataSource.runMigrations (/app/node_modules/typeorm/data-source/DataSource.js:265:35)at async Object.handler (/app/node_modules/typeorm/commands/MigrationRunCommand.js:68:13) {query: 'SELECT * FROM "core"."_typeorm_migrations" "_typeorm_migrations" ORDER BY "id" DESC',parameters: [],driverError: Error: Query read timeoutat /app/node_modules/pg/lib/client.js:526:17at process.processTicksAndRejections (node:internal/process/task_queues:105:5)at async PostgresQueryRunner.query (/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:184:25)at async SelectQueryBuilder.loadRawResults (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2192:25)at async SelectQueryBuilder.getRawMany (/app/node_modules/typeorm/query-builder/SelectQueryBuilder.js:646:29)at async MigrationExecutor.loadExecutedMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:400:35)at async MigrationExecutor.executePendingMigrations (/app/node_modules/typeorm/migration/MigrationExecutor.js:136:36)at async DataSource.runMigrations (/app/node_modules/typeorm/data-source/DataSource.js:265:35)at async Object.handler (/app/node_modules/typeorm/commands/MigrationRunCommand.js:68:13)}Stopping ContainerWhenever I'm lucky this step is successful, but then it'll still fail on Network.Network > HealthcheckHealthcheck failureFor this I don't have any logs unfortunately.Any idea what's happening? Appreciate it!
5 months ago
Looks like a db timeout. Did you change any environment variables, service settings, or set any resource limits to the services? Is your db live?
You can check the healthcheck logs in the Build logs, they should look something like this: If they fail you should see some related logs in the Deploy logs I think.
Attachments
thomasmol
Looks like a db timeout. Did you change any environment variables, service settings, or set any resource limits to the services? Is your db live?You can check the healthcheck logs in the Build logs, they should look something like this: If they fail you should see some related logs in the Deploy logs I think.
5 months ago
Hi Thomas,
Thanks for your quick reply! I didn't change any settings. Just now I started a new project with your template (nothing changed) and it failed on the health check again. See screenshot.
Is it working for you on a new project with the template?
If you want you can share your email and I can add you to the project.
EDIT (21:00 CEST):
I just created another new project and the template worked fine there, so I'm good for now haha. It did fail on the previous 5 projects I created and redeployments therein, still no idea why.
Attachments
5 months ago
Some problems and how I circumvented them:
- The bitnami version of redis doesn't apply anymore, it shows something like version not found or something like that if I remember correctly, to fix this, you must use tag latest or a sha- value to continue.
- The deployment needs you to be on a higher plan than the free one, this is because the image needs more than 512mb to build. Switching to 5$/mo worked.
0xc0a1
Some problems and how I circumvented them:- The bitnami version of redis doesn't apply anymore, it shows something like version not found or something like that if I remember correctly, to fix this, you must use tag latest or a sha- value to continue.- The deployment needs you to be on a higher plan than the free one, this is because the image needs more than 512mb to build. Switching to 5$/mo worked.
5 months ago
Thank you for sharing this!
I've updated the Redis service in the template:
Removed the Bitnami image and it now uses the same image as when deploying new Redis instances on Railway -> (https://hub.docker.com/_/redis)
Update Redis version to
8.2.1Update the mounted volume path of Redis to
/data(careful when updating this on existing deployments, you might lose data. So create backups)
I've added warnings in the description of this template regarding the minimum plan requirements
5 months ago
Ive sadly not been able to get this to work. Each time I install I just end up with a login screen but 'an error occured' when I try to login in. With the help of gpt I was able to establish that its a database issue.... but beyond my knowledge to sort it.
Im on the pro plan.
If there is any update on a method it would be great.
Ive sadly not been able to get this to work. Each time I install I just end up with a login screen but 'an error occured' when I try to login in. With the help of gpt I was able to establish that its a database issue.... but beyond my knowledge to sort it. Im on the pro plan. If there is any update on a method it would be great.
4 months ago
Were you able to get it working? I tried deploying the latest version of the template and had no issues.
2 months ago
Template update: storage buckets
Now that Railway offers S3 buckets you can use them with this Twenty CRM template. The template has been updated to include a storage bucket. To configure this manually for previous deployments of this template do the following:
Create new Bucket service
Add the following env variables to the
Twentyservice (changeSTORAGE_TYPEtos3):
STORAGE_TYPE="s3"
STORAGE_S3_NAME="${{Bucket.BUCKET}}"
STORAGE_S3_REGION="${{Bucket.REGION}}"
STORAGE_S3_ENDPOINT="${{Bucket.ENDPOINT}}"
STORAGE_S3_ACCESS_KEY_ID="${{Bucket.ACCESS_KEY_ID}}"
STORAGE_S3_SECRET_ACCESS_KEY="${{Bucket.SECRET_ACCESS_KEY}}"
Add them also to your
Twenty Workerservice:
STORAGE_TYPE="${{Twenty.STORAGE_TYPE}}"
STORAGE_S3_NAME="${{Twenty.STORAGE_S3_NAME}}"
STORAGE_S3_REGION="${{Twenty.STORAGE_S3_REGION}}"
STORAGE_S3_ENDPOINT="${{Twenty.STORAGE_S3_ENDPOINT}}"
STORAGE_S3_ACCESS_KEY_ID="${{Twenty.STORAGE_S3_ACCESS_KEY_ID}}"
STORAGE_S3_SECRET_ACCESS_KEY="${{Twenty.STORAGE_S3_SECRET_ACCESS_KEY}}"
Adding a bucket enables the storing of files uploaded on twenty as well as persistence of workflows.
Feel free to reply here if you run into any issues!
a month ago
Hey @thomasmol, this template worked perfect for me. Span up with no issues on the hobby plan, great work!
Quick question—have you had any luck setting up the multi-workspace functionality on Railway? I have fiddled with it every way that I can think of but can't seem to get it to work. Using Cloudflare for DNS, could be an SSL issue but it's hard to say. I am completely satisfied to just use this for my business needs in a single workspace capacity but am enthusiastic to explore the multi-workspace aspect of it. Might just have to go a vps or local if I want to do that but Railway is just too convenient!
coderreco
Hey @thomasmol, this template worked perfect for me. Span up with no issues on the hobby plan, great work!Quick question—have you had any luck setting up the multi-workspace functionality on Railway? I have fiddled with it every way that I can think of but can't seem to get it to work. Using Cloudflare for DNS, could be an SSL issue but it's hard to say. I am completely satisfied to just use this for my business needs in a single workspace capacity but am enthusiastic to explore the multi-workspace aspect of it. Might just have to go a vps or local if I want to do that but Railway is just too convenient!
a month ago
Thank you! As to multi-workspace: I haven't tried setting it up myself, but it should work: https://docs.twenty.com/developers/self-host/capabilities/setup#multi-workspace-mode , and wildcard domains on railway: https://docs.railway.com/guides/public-networking#wildcard-domains and cloudflare + railway: https://docs.railway.com/guides/public-networking#provider-specific-instructions
are you getting any specific errors?
thomasmol
Thank you! As to multi-workspace: I haven't tried setting it up myself, but it should work: https://docs.twenty.com/developers/self-host/capabilities/setup#multi-workspace-mode , and wildcard domains on railway: https://docs.railway.com/guides/public-networking#wildcard-domains and cloudflare + railway: https://docs.railway.com/guides/public-networking#provider-specific-instructionsare you getting any specific errors?
a month ago
If memory serves, the closest I have gotten was with cloudflare proxying off, on a nested subdomain but could not get SSL to work. I also found that when I tried to use a domain that I wasn't using for anything else so that I could wildcard on the root(*.mydomain.com) with a default subdomain of "app", I would either get errors of connecting to the backend, or it would redirect to "app.app.mydomain.com"(depending on what I set for SERVER_URL) which is not intended, and also would then have SSL issues. I did get to one point where I successfully began the creation of a secondary workspace just by trying a new nested subdomain in front, but then I couldn't get past the sign up nor could I access anything to do with my default workspace. When I eventually rolled everything back to single workspace(this was yesterday), I was facing issues and couldn't login at all because the system was finding 2 workspaces on a single workspace configuration, so I had to browse the tables and delete any rows referencing the other workspace which eventually saved me.
Now that I have mostly migrated to Twenty I will probably stop fiddling with multi-workspace on this instance but I'm still keen. I did just realize that my SSL mode was set to 'Flexible' and not 'Full' so that could have had something to do with it because at one point I did arrive at some configuration that only have me a ERR_TOO_MANY_REDIRECTS error page. I wonder if I was that close! Most of the time I was only getting insecure warning pages though.
The biggest point of confusion for me is what I should be setting my SERVER_URL to once I set up wildcard domains, and if I should also be setting FRONTEND_URL .



