R
Railwayโ€ข13mo ago
Dmitry

Something went wrong with a deployed template

After I deployed this template https://railway.app/template/CnHq4I I got a popup saying that "Something went wrong" and none of the services are deploying. Could someone please check what might be the issue? ๐Ÿ™‚
Solution:
Definitely needed the coffee.
No description
Jump to solution
101 Replies
Percy
Percyโ€ข13mo ago
Project ID: 502c4bb1-0e01-42d2-808c-94e4e2af686b
Dmitry
DmitryOPโ€ข13mo ago
502c4bb1-0e01-42d2-808c-94e4e2af686b Btw this is my template.. i'm trying to create a template so someone from the Temporal team can debug the issues i'm having ๐Ÿ™‚
Dmitry
DmitryOPโ€ข13mo ago
Corrected a few things.. but yeah still doing this
No description
Dmitry
DmitryOPโ€ข13mo ago
Private networks are automatically created if I have the "Unexposed" option right? Names are based on the service name? Hmm yeah idk went over everything a 2nd time.. everything looks fine
Dmitry
DmitryOPโ€ข13mo ago
Also I noticed that after you create the template and then go back to update it, it doesn't have a spot to edit the description (only the name)
No description
Brody
Brodyโ€ข13mo ago
you want to click update info, not edit
Dmitry
DmitryOPโ€ข13mo ago
Where is "Update Info"?
Brody
Brodyโ€ข13mo ago
while your template isnt setup perfectly, the issue above is not something thats your fault
Dmitry
DmitryOPโ€ข13mo ago
I only have an Edit button
Dmitry
DmitryOPโ€ข13mo ago
My page looks like this
No description
Dmitry
DmitryOPโ€ข13mo ago
Oh It's cause it's not published yet I'm clicking edit on a Personal Template
Brody
Brodyโ€ข13mo ago
correct
Dmitry
DmitryOPโ€ข13mo ago
Also regarding the template I'm kinda just going off this template as a reference https://railway.app/template/AhDDtZ But i'm adding ElasticSearch (which is having issues so I'm creating this template to send off to the Temporal team to look into)
Brody
Brodyโ€ข13mo ago
will need to tag in @fp for this one, the repos involved are not being cloned into the users gh account
Dmitry
DmitryOPโ€ข13mo ago
hubert yeah it should be public dunno ๐Ÿ˜„
Brody
Brodyโ€ข13mo ago
not the issue this is also not the issue, and i know you where just copying from the original template, but TEMPORAL_CORS_ORIGINS should be https://${{RAILWAY_PUBLIC_DOMAIN}} TEMPORAL_ADDRESS should be ${{Temporal.RAILWAY_PRIVATE_DOMAIN}}:${{Temporal.PORT}} ES_SEEDS should be ${{Elasticsearch.RAILWAY_PRIVATE_DOMAIN}} POSTGRES_SEEDS should be ${{Postgres.RAILWAY_PRIVATE_DOMAIN}} DB_PORT should be 5432
Dmitry
DmitryOPโ€ข13mo ago
Ahhh ty.. honestly when I was copying stuff over ... I was like there has got to be a variable name for these rather than hard coding them ๐Ÿ˜„ Thank you! I will change them now ๐Ÿ™‚
Brody
Brodyโ€ข13mo ago
angelo let the hardcoded variables slide, for context the original temporal template was a bounty
Dmitry
DmitryOPโ€ข13mo ago
Ohhhh ok gotcha that's dope! I mean it's super awesome .. cause i've been debating whether to deploy on Kubernetes or not haha.. but then last minute found this template searching.. it's been great so far.. well minus the Elasticsearch stuff.. but hoping the Temporal team can help debug the issue!
Brody
Brodyโ€ข13mo ago
whats your issues with Elasticsearch?
Dmitry
DmitryOPโ€ข13mo ago
Uggh so many things. Sometimes i'll try to deploy and Temporal will tell me "Waiting for ElasticSearch to start up", and then other times i'll deploy and it will say something related to like "Bad Shards" in ES (when viewing the UI). Idk.. I have an entire thread in the Temporal Slack trying to debug. But I told the guy.. let me just create a template on Railway and you guys can debug with it ... much easier ๐Ÿ˜… But I can see logs on Elasticsearch saying that Temporal added indexes.. so it's like not a connectivity issue.. I don't think... I have no idea sadblob
Brody
Brodyโ€ข13mo ago
Dmitry
DmitryOPโ€ข13mo ago
๐Ÿ˜ฎ Well.. DNS resolution COULD still work tho right.. cause it has worked a few times after restarting the instance like 5 times but yeah other than that it's been a pain
Brody
Brodyโ€ข13mo ago
it would be flakey as best and ive never been able to get internal dns resolution working without that variable on an alpine image
Dmitry
DmitryOPโ€ข13mo ago
Interesting Let me add it in a project I have rn ๐Ÿ˜ฎ What about the elasticsearch service I have? The bitnami/elasticsearch Would it need to be set there too?
Brody
Brodyโ€ข13mo ago
nope does elasticsearch listen on :: ?
Dmitry
DmitryOPโ€ข13mo ago
Uhhhhh
Brody
Brodyโ€ข13mo ago
since the private network is ipv6 only, the services need to bind to :: instead of 0.0.0.0 to communicate with each other on the private network
Dmitry
DmitryOPโ€ข13mo ago
So elastic has 2 things So it has this -> [2023-11-22T21:26:58,062][INFO ][o.e.t.TransportService ] [railway] publish_address {172.17.0.172:9300}, bound_addresses {[::]:9300} And this -> [INFO ][o.e.h.AbstractHttpServerTransport] [railway] publish_address {172.17.0.172:9200}, bound_addresses {[::]:9200}
Brody
Brodyโ€ข13mo ago
looks good to me
Dmitry
DmitryOPโ€ข13mo ago
Should I add it then.. or no?
Brody
Brodyโ€ข13mo ago
we went off track, add what to what exactly
Dmitry
DmitryOPโ€ข13mo ago
ENABLE_ALPINE_PRIVATE_NETWORKING=true to the elasticsearch service
Brody
Brodyโ€ข13mo ago
nope, only needed on Temporal
Dmitry
DmitryOPโ€ข13mo ago
kk, i'm gonna redeploy ES, then temporal Oh I should prob mention.. wiping a volume always throws an error for me dunno why I mean I think it get's wiped.. but just says there was an error Created a new one to make sure there's not old data tho It started up just fine @Brody ๐Ÿ˜ฎ BUTTTTT I'm not convinced.. I need to duplicate it lol Sooo that may have fixed it but... i'll need to wait until the template is sorted and test it again ๐Ÿ˜„
Brody
Brodyโ€ข13mo ago
yeah we gotta wait for fp, it's likely something broken with the gh integration
Dmitry
DmitryOPโ€ข13mo ago
Appreciate your help thus far ๐Ÿ™‚ I am seeing alot less errors in the Temporal service tho forrrr sure
Dmitry
DmitryOPโ€ข13mo ago
Is there a way to cap memory usage for a service? I'm worried that this is gonna keep growing and growing until it's default configured limit (not sure what that is)
No description
Dmitry
DmitryOPโ€ข13mo ago
Oh nvm I think the Bitnami ES image caps at 1g per docs
ELASTICSEARCH_HEAP_SIZE: Memory used for the Xmx and Xms java heap values. Default: 1024m
ELASTICSEARCH_HEAP_SIZE: Memory used for the Xmx and Xms java heap values. Default: 1024m
er wait it's at 1.8GB now ๐Ÿง
Brody
Brodyโ€ข13mo ago
there's no way to cap the memory of a service, if there was you would just end up with the app crashing
Dmitry
DmitryOPโ€ข13mo ago
Right.. it's gotta be app configured instead
Brody
Brodyโ€ข13mo ago
heap does not mean total memory allowed
Dmitry
DmitryOPโ€ข13mo ago
Hmm how the heck do I stop it from growing to like 32gb then? ๐Ÿ˜…
Brody
Brodyโ€ข13mo ago
it can't, it would crash before that since your on hobby
Dmitry
DmitryOPโ€ข13mo ago
well yeah I know that.. I just mean like
Brody
Brodyโ€ข13mo ago
if there's a memory leak with elastic search there's not much you can do
Dmitry
DmitryOPโ€ข13mo ago
๐Ÿ’€
Brody
Brodyโ€ข13mo ago
set to 512m and see what happens
Dmitry
DmitryOPโ€ข13mo ago
I see [railway] heap size [512mb] in the logs.. so we'll see what happens ๐Ÿ˜„ Interesting.. on my temporal UI.. I just got this error
There is an error with filtering Workflows.

last connection error: connection error: desc = "transport: Error while dialing: dial tcp: lookup temporal.railway.internal on 8.8.8.8:53: no such host"
There is an error with filtering Workflows.

last connection error: connection error: desc = "transport: Error while dialing: dial tcp: lookup temporal.railway.internal on 8.8.8.8:53: no such host"
Is this the same Alpine issue?
Brody
Brodyโ€ข13mo ago
yes, did you set the variable?
Dmitry
DmitryOPโ€ข13mo ago
Yeah that was on the temporal instance.. this is on my temporal-ui service
Brody
Brodyโ€ข13mo ago
is that based on a docker image too?
Dmitry
DmitryOPโ€ข13mo ago
It only happens every now and again tho.. I refresh and it's fine uhhh yeah
Brody
Brodyโ€ข13mo ago
link me please
Dmitry
DmitryOPโ€ข13mo ago
temporalio/ui:2.21.3 err
Brody
Brodyโ€ข13mo ago
yep thats an alpine image too set the variable
Dmitry
DmitryOPโ€ข13mo ago
How do you check btw?
Brody
Brodyโ€ข13mo ago
lots of way, this was the fastest right now https://hub.docker.com/layers/temporalio/ui/latest/images/sha256-d184b667ace6a4357c2cdedd3a259b4b67e2b4dea258538922b5cd496ffc3d1d?context=explore layer 3 mentions apk add apk is alpine's package manager, therefor its an image based on alpine
Dmitry
DmitryOPโ€ข13mo ago
ahhh got it! Thanks ๐Ÿ™‚
Faraz
Farazโ€ข13mo ago
. There's only a single repo, right? If I understand correctly, the repo doesn't get cloned when trying to deploy the template? Hmm, looks like some branch weirdness.
Brody
Brodyโ€ข13mo ago
yeah single repo for multiple services with different root dirs set
Faraz
Farazโ€ข13mo ago
For some reason, it's trying to clone the railway-temporal branch. Which obviously doesn't exist.
Brody
Brodyโ€ข13mo ago
๐Ÿค”
Faraz
Farazโ€ข13mo ago
I might need a coffee for this. I shall return. salute
Solution
Faraz
Farazโ€ข13mo ago
Definitely needed the coffee.
No description
Brody
Brodyโ€ข13mo ago
would have never guessed that edge cases!! wooo
Faraz
Farazโ€ข13mo ago
Should be good now!
Dmitry
DmitryOPโ€ข13mo ago
Lmaoooo it was cause of the โ€œtreeโ€ in my name? Thatโ€™s awesome lmaoooo. Thanks for the fix ๐Ÿ˜‚
Faraz
Farazโ€ข13mo ago
Your username is now a test-case in our codebase. ๐Ÿ˜„
Dmitry
DmitryOPโ€ข13mo ago
Ahahaha sweet ๐Ÿ˜
Dmitry
DmitryOPโ€ข13mo ago
Hey Brody, how would I add a custom build command to this service, in the template? I see it has a custom start command, but don't see anything for the build step
No description
Brody
Brodyโ€ข13mo ago
in a railway.json file that lives in that services root dir
Dmitry
DmitryOPโ€ข13mo ago
ohhh ok.. i'll have to look up how to format that ๐Ÿ˜„ got it thanks I have 2 services that rely on the root dir tho actually 1 for the worker and 1 for the client
Dmitry
DmitryOPโ€ข13mo ago
Is there a way to specify which service uses the railway.json file? Cause I have 2 services that use the same /hello-world/ folder/code I want to do a custom build step on only 1 of the services.. not both There's a way to set a Railway Config File Path in the settings of the service.. but I don't see an option to set it for the service (in the template builder)
Brody
Brodyโ€ข13mo ago
ah gotcha, set the build command in a nixpacks.toml file instead, you can make multiple of them with different names like hello-world.nixpacks.toml and then set a service variable NIXPACKS_CONFIG_FILE to the name of the file name
Dmitry
DmitryOPโ€ข13mo ago
ah sweet! lemme try that catjam I had another question.. hope you don't mind.. just trying to get a lay of the land of sorts still haha. I was looking at my billing.. and my Egress charges seem kinda high for my services.. esp on my Temporal service. I think I used the proxy on accident for the Postgres URL. Would I be charged in that case if I used the proxy URL instead of the private URL? I'm assuming data passed via the private network (service to service) is free, yes?
Brody
Brodyโ€ข13mo ago
Also I had another question.. hope you don't mind
i dont! thats that im here for!
my Egress charges seem kinda high for my services ... I think I used the proxy on accident ... Would I be charged in that case if I used the proxy URL instead of the private URL?
that would indeed cause egrees fees when using the databases tcp proxy
I'm assuming data passed via the private network (service to service) is free, yes?
correct, you definitely want to use the private domains, this is me trying to do that for you https://discord.com/channels/713503345364697088/1177012474122354778/1177025004035129434
Dmitry
DmitryOPโ€ข13mo ago
Yep gotcha.. yeah I was using the old template (had the old proxy URL's I think). I'm redeploying my project on the new template which uses all private URL's and such ๐Ÿ™‚ Thanks!
Brody
Brodyโ€ข13mo ago
no prob
Dmitry
DmitryOPโ€ข13mo ago
Hmm ok so I setup the environment variables like you said, and I added a file called temporal-worker.nixpacks.toml inside the /hello-world/ dir like you said. That file has the following in it
[phases.build]
cmds = ['yarn build:workflow']
[phases.build]
cmds = ['yarn build:workflow']
Does this look correct to you? The custom build command isn't set tho after I deploy the template unfortunately ๐Ÿง
No description
Dmitry
DmitryOPโ€ข13mo ago
Or would it just look like this
[build]
buildCommand = "yarn build:workflow"
[build]
buildCommand = "yarn build:workflow"
Brody
Brodyโ€ข13mo ago
one sec first option was right maybe the variable wants a / prefixed
Dmitry
DmitryOPโ€ข13mo ago
oh hmm this is interesting
Dmitry
DmitryOPโ€ข13mo ago
No description
Dmitry
DmitryOPโ€ข13mo ago
I see the custom build command in the logs
Dmitry
DmitryOPโ€ข13mo ago
But it's not set here
No description
Brody
Brodyโ€ข13mo ago
it wouldnt be
Dmitry
DmitryOPโ€ข13mo ago
Ah ok
Brody
Brodyโ€ข13mo ago
nixpacks.toml is a build config, railway.json is a service config
Dmitry
DmitryOPโ€ข13mo ago
Ah gotcha! Appreciate the help tipsfedora
Dmitry
DmitryOPโ€ข13mo ago
Adding Prometheus and Grafana to the Temporal template catjam
No description
Brody
Brodyโ€ข13mo ago
very nice
Dmitry
DmitryOPโ€ข13mo ago
Brody, this should calculate a secret in a Template correct?
${{secret(32, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/')}}
${{secret(32, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/')}}
I have it set as a variable in my template, but when the template deployed.. the value didn't get replaced for some reason
No description
Brody
Brodyโ€ข13mo ago
show me a screenshot please?
Dmitry
DmitryOPโ€ข13mo ago
sec lemme redeploy
Dmitry
DmitryOPโ€ข13mo ago
No description
Dmitry
DmitryOPโ€ข13mo ago
When I go to Variables after deploying.. it shows this
Brody
Brodyโ€ข13mo ago
hmmm thats not ideal, ill ask jr when hes active (jr is already in this thread)
Dmitry
DmitryOPโ€ข13mo ago
Awesome thanks
Want results from more Discord servers?
Add your server