R
Railway13mo ago
ems_bloo

"Already in use" error when deploying Scala play

Hi all, I'm trying to deploy an example Scala play application, I've gone through the nixpacks scala docs and have built the package like it said, then I included the 2 service variables as shown in the second screenshot. However I'm getting this "Already in use" error. Its my first time using railway so i just wanted to test it out. Please let me know if there is anything else I'm missing. Service id: 700352af-cb3a-4d49-aa93-b1e2a0dc62ee Thanks in advance
No description
No description
10 Replies
Percy
Percy13mo ago
Project ID: 700352af-cb3a-4d49-aa93-b1e2a0dc62ee
Fragly
Fragly13mo ago
Smells like a bug, have you tried redeploying? you can do that by clicking on the 3 dots on the right of your deploy and clicking "redeploy"
ems_bloo
ems_bloo13mo ago
Just tried redeploying but still getting the same issue
No description
Fragly
Fragly13mo ago
You are using the port railway provides, right? (env.PORT) "?
ems_bloo
ems_bloo13mo ago
Ah i had mine set up as PORT
ems_bloo
ems_bloo13mo ago
The build is active and i've generated a domain but got "Application failed to respond"
No description
No description
Fragly
Fragly13mo ago
yea that normally happens when your application has a problem with its host and or port: https://docs.railway.app/troubleshoot/fixing-common-errors
ems_bloo
ems_bloo13mo ago
Okay, at least its deployed now. I'll play with how I set the host and port env variables and see if I can get that figured out If i get it sorted out I'll post in here Thanks for the help @Fragly
Fragly
Fragly13mo ago
No problem, good luck
ems_bloo
ems_bloo13mo ago
Managed to get it working by overriding the port in the start command in the settings deploy section ./target/universal/stage/bin/main -Dhttp.port=$PORT application.conf looks something like this
play{
filters{
hosts{
allowed = [".railway.app"]
}
}
http{
secret{
key="changeme"
key=${?APPLICATION_SECRET}
}
server{
http{
port = ${?env.PORT}
address = 0.0.0.0
}
https{
port = ${?env.PORT}
address = 0.0.0.0
}
}
}
}
play{
filters{
hosts{
allowed = [".railway.app"]
}
}
http{
secret{
key="changeme"
key=${?APPLICATION_SECRET}
}
server{
http{
port = ${?env.PORT}
address = 0.0.0.0
}
https{
port = ${?env.PORT}
address = 0.0.0.0
}
}
}
}
Want results from more Discord servers?
Add your server