Several apps are failing with the same error message
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.
51 Replies
Project ID:
d06f7acd-76c5-48ce-bc2b-0a5e42d156b8
full error logs please, those look to be cut off.
could you also send your requirements.txt file?
Requirements.txt
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
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
GitHub
GitHub - alphasecio/langchain-examples: This repository contains a ...
This repository contains a collection of apps powered by the LangChain LLM framework. - GitHub - alphasecio/langchain-examples: This repository contains a collection of apps powered by the LangChai...
the app is located in url-summary correct?
Just moved the solo apps to this monorepo, but the issue persists with separate repos too
Logs are from pinecone-summary deployment
what python version are you using locally
3.11
let's try getting railway to use 3.11 to run your app
create a
.python-version
file in pinecone-summary
with the contents 3.11
Testing
While it builds, can watch paths be set in a template? I couldnt find that option
No difference, same error
are you sure the logs you have most recently provided are full logs?
Wait, interesting, it threw the error, but deployed the app after a few seconds
After I hit refresh a few times
Is this an expected behavior?
It's a first for me
if I'm being honest, and I don't mean any offence, this just looks like you've written unstable code
No offence taken, I'm learning..
Any quick tips?
make sure arg 1 is a class
I honestly don't know, I'm not a python dev
and it's unfortunate but code questions are just a tad out of the scope of what these threads are intended for
No worries. Any suggestions on the monorepo layout, or anything else Railway specific?
nothing wrong with a mono repo
you asked about watch paths
https://docs.railway.app/deploy/builds#watch-paths
I cannot add this to a template - would i need the .toml file?
very good idea, let me see if you can define watch paths in a railway.json/toml file
The need for .python-version was new to me, but it worked, so thanks!
you absolutely can specify watch paths in a railway.json file
this uses a dockerfile, so dont use this railway.json, but you get the idea
Would it be picked up for non-beta users?
let me check, one sec
Is a watch path necessary if root dirs are explicitly provided for each app in a monorepo?
I add the python version file for one app, but others starting building too. Hence, I thought about watch paths
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
what is your start command for one of these python programs in the mono reapo?
streamlit run streamlit_app.py
and you are setting the appropriate root dir for each service?
Yes
odd that builds from other services build then
you can always set your watch paths in the railway.json file
I'm about to test that
let me know how that goes
{
"$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
}
}
Does this look ok to you?
Also, does json vs toml matter at all?
you might want
pinecone-summary/**
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 fileHelpful, thanks
Do you have a sample .json with the root dir specified? Looking for the param to use, but can't find an example
doesn't look like you can
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
Hmm.. how should a monorepo with separate root dirs for each app be handled then?
you set the root dir in the service settings
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
Thanks
IaC?
infra as code
ah fancy acronym
well if you have any more questions, feel free to ask π
I guess Railway calls it config as code π
that sounds right
Hey @mndr, sorry to bother, can I dm you about this?
are you having issues with langchain errors too?
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.
please open your own #βο½help thread
See if this helps -> create a
.python-version
file with the contents 3.11
(or whatever Python version you are using locally / where it works)