Railway template deployment crashing
I created a deployment from my template and it crashes giving the following error[1]. I use the exact same code in one of my projects hosted on Railway and do not get this error.
[1]
45 Replies
Project ID:
d2917ff2-c65b-4779-ae0a-32a431678273
This is a code issue, not a Railway issue. We won’t be able to help you debug this
But I use the same syntax in my other project and it works fine.
Besides, the bot runs on my local
It's not that I'm pushing faulty code either
if you say the code is the exact same, well then you need to find the differences between this deployment that isn't working and the deployment that is working
different node version? different typescript versions? different tsx version? etc.
you've changed something between this and the deployment that did work.
(its pyhton i think)
same difference
same basic debugging techniques still apply
though I don't know why I missed .py and throught it was typescript lmao
i suggested a fix in her dm's, cuz iirc that operator is the same as the
or
keyword
(using words as operators feels wrong)
but maybe that may workcool
python hard
Hmm, on second thought, I may have never pushed my new code (other project) to Railway
The confusion was because that code is months old by now
But I don't think I've pushed it to Railway in a whole year lol
python easy
This is probably a version issue?
Possibly? are your dependencies static?
I was told Railway uses 3.8 and supports up to 3.11
Yes. I have
requirements.txt
Looks like whatever you’re comparing is invalid. Can you share your repo?
https://github.com/NIT-KKR-Student-Support-System/Project-Hyperlink/blob/main/main.py#L85
FYI, works on my system.
Using Python 3.10.11
What is the highlighted line supposed to do? Never seen that origin: in python
It's a function parameter
origin
is an arbitrary nameYeah I know that, I’ve never seen operators used in a parameter. Afaik that doesn’t work
i’ve tried
@Vin help
It was introduced in 3.10 AFAIK
ahhh gotcha. I tend to only use 3.9
That line is the same as:
origin: typing.Union[discord.Message, discord.Interaction],
This is the 3.9 equivalent^got it. Makes sense now
do you have a runtime.txt or railway file?
Nope
pretty sure railway defaults to python 3.9
I have a Dockerfile in my "other project" that I mentioned but it doesn't do anything special
There must be a way to override that then?
best thing to do here is create your own dockerfile or use a nixpacks.toml to set your provider to python310
3.8
If I switch to direnv entirely, will that work as well 🤔
Context:
direnv
sets up all my project's requirements when cd
ing into the dirnever heard of it, but sounds unnecessarily complex for use on railway
Well, it's for personal use mainly
I will try this config.
just chuck
3.10
in a runtime.txt fileThe entire contents of the txt will just be
3.10
?yes
Interesting
fun with regex
I guess a
.python-version
will be more pedagogicalyour choice
Yes, changing the Python version worked.
Glad it got fixed.
Thanks guys!
remember when I said to try a different version of the language lol
I got the language wrong, but same difference
Yeah, thanks a ton!
nice!