R

Railway

βœ‹ο½œhelp

Join Server

Several apps are failing with the same error message

Mmndr5/23/2023
All apps deployed successfully 1-2 days ago. They still deploy successfully locally or using Gitpod. Has something changed with Railway?

Project ID: d06f7acd-76c5-48ce-bc2b-0a5e42d156b8

Error: TypeError: issubclass() arg 1 must be a class
Traceback attached.
Bbrody5/23/2023
full error logs please, those look to be cut off.
could you also send your requirements.txt file?
Mmndr5/23/2023
Requirements.txt
Mmndr5/23/2023
streamlit==1.22.0
langchain==0.0.173
openai==0.27.6
tiktoken==0.4.0
pypdf==3.8.1
pinecone-client==2.2.1
Mmndr5/23/2023
Mmndr5/23/2023
Fyi, this worked 2-3 days ago, no changes to the code since. It also works if I launch locally or in a remote env like Gitpod
Bbrody5/23/2023
the app is located in url-summary correct?
Mmndr5/23/2023
Just moved the solo apps to this monorepo, but the issue persists with separate repos too
Mmndr5/23/2023
Logs are from pinecone-summary deployment
Bbrody5/23/2023
what python version are you using locally
Mmndr5/23/2023
3.11
Bbrody5/23/2023
let's try getting railway to use 3.11 to run your app
Bbrody5/23/2023
create a .python-version file in pinecone-summary with the contents 3.11
Mmndr5/23/2023
Testing
Mmndr5/23/2023
While it builds, can watch paths be set in a template? I couldnt find that option
Mmndr5/23/2023
No difference, same error
Bbrody5/23/2023
are you sure the logs you have most recently provided are full logs?
Mmndr5/23/2023
Wait, interesting, it threw the error, but deployed the app after a few seconds
Mmndr5/23/2023
After I hit refresh a few times
Mmndr5/23/2023
Is this an expected behavior?
Mmndr5/23/2023
It's a first for me
Bbrody5/23/2023
if I'm being honest, and I don't mean any offence, this just looks like you've written unstable code
Mmndr5/23/2023
No offence taken, I'm learning..
Mmndr5/23/2023
Any quick tips?
Bbrody5/23/2023
make sure arg 1 is a class
Bbrody5/23/2023
I honestly don't know, I'm not a python dev
Bbrody5/23/2023
and it's unfortunate but code questions are just a tad out of the scope of what these threads are intended for
Mmndr5/23/2023
No worries. Any suggestions on the monorepo layout, or anything else Railway specific?
Bbrody5/23/2023
nothing wrong with a mono repo
Mmndr5/23/2023
I cannot add this to a template - would i need the .toml file?
Bbrody5/23/2023
very good idea, let me see if you can define watch paths in a railway.json/toml file
Mmndr5/23/2023
The need for .python-version was new to me, but it worked, so thanks!
Bbrody5/23/2023
you absolutely can specify watch paths in a railway.json file
Bbrody5/23/2023
{
  "$schema": "https://railway.app/railway.schema.json",
  "build": {
    "builder": "DOCKERFILE",
    "watchPatterns": [
      "folder"
    ],
    "dockerfilePath": "Dockerfile"
  },
  "deploy": {
    "numReplicas": 1,
    "healthcheckPath": "/ok200",
    "restartPolicyType": "ON_FAILURE",
    "restartPolicyMaxRetries": 10
  }
}
Bbrody5/23/2023
this uses a dockerfile, so dont use this railway.json, but you get the idea
Mmndr5/23/2023
Would it be picked up for non-beta users?
Bbrody5/23/2023
let me check, one sec
Mmndr5/23/2023
Is a watch path necessary if root dirs are explicitly provided for each app in a monorepo?
Mmndr5/23/2023
I add the python version file for one app, but others starting building too. Hence, I thought about watch paths
Bbrody5/23/2023
yep if you put a railway.json file in a sub dir, and specify that dir as your root dir the railway.json from that dir does get used
Bbrody5/23/2023
what is your start command for one of these python programs in the mono reapo?
Mmndr5/23/2023
streamlit run streamlit_app.py
Bbrody5/23/2023
and you are setting the appropriate root dir for each service?
Mmndr5/23/2023
Yes
Bbrody5/23/2023
odd that builds from other services build then
Bbrody5/23/2023
you can always set your watch paths in the railway.json file
Mmndr5/23/2023
I'm about to test that
Bbrody5/23/2023
let me know how that goes
Mmndr5/23/2023
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"watchPatterns": [
"/pinecone-summary"
]
},
"deploy": {
"numReplicas": 1,
"startCommand": "streamlit run streamlit_app.py",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Mmndr5/23/2023
Does this look ok to you?
Mmndr5/23/2023
Also, does json vs toml matter at all?
Bbrody5/23/2023
you might want pinecone-summary/**
Bbrody5/23/2023
its user preference, i prefer railway.json since it has a schema so that when you edit that file with vscode it will be able to tell you what you can and cant do in the railway.json file
Mmndr5/23/2023
Helpful, thanks
Mmndr5/23/2023
Do you have a sample .json with the root dir specified? Looking for the param to use, but can't find an example
Bbrody5/23/2023
doesn't look like you can
Bbrody5/23/2023
it makes sense to not be able to, since railway won't even know what root directory to look in for a railway.json unless you tell it first and foremost
Mmndr5/23/2023
Hmm.. how should a monorepo with separate root dirs for each app be handled then?
Bbrody5/23/2023
you set the root dir in the service settings
Mmndr5/23/2023
Ok, that's how I've been doing it so far. Wanted to know if there was an IaC option, but that's fine, all good
Mmndr5/23/2023
Thanks
Bbrody5/23/2023
IaC?
Mmndr5/23/2023
infra as code
Bbrody5/23/2023
ah fancy acronym
Bbrody5/23/2023
well if you have any more questions, feel free to ask πŸ™‚
Mmndr5/23/2023
I guess Railway calls it config as code πŸ™‚
Bbrody5/23/2023
that sounds right
TBTofu Boy5/23/2023
Hey @mndr, sorry to bother, can I dm you about this?
Bbrody5/23/2023
are you having issues with langchain errors too?
TBTofu Boy5/23/2023
No, the weird thing is that it's a completely different project. It's just a discord bot, yet the exact same error started appearing for me.
Bbrody5/23/2023
please open your own #βœ‹ο½œhelp thread
Mmndr5/23/2023
See if this helps -> create a .python-version file with the contents 3.11
Mmndr5/23/2023
(or whatever Python version you are using locally / where it works)