R
Railwayβ€’2y ago
mndr

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
Percy
Percyβ€’2y ago
Project ID: d06f7acd-76c5-48ce-bc2b-0a5e42d156b8
Brody
Brodyβ€’2y ago
full error logs please, those look to be cut off. could you also send your requirements.txt file?
mndr
mndrOPβ€’2y ago
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
mndr
mndrOPβ€’2y ago
mndr
mndrOPβ€’2y ago
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
mndr
mndrOPβ€’2y ago
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...
Brody
Brodyβ€’2y ago
the app is located in url-summary correct?
mndr
mndrOPβ€’2y ago
Just moved the solo apps to this monorepo, but the issue persists with separate repos too Logs are from pinecone-summary deployment
Brody
Brodyβ€’2y ago
what python version are you using locally
mndr
mndrOPβ€’2y ago
3.11
Brody
Brodyβ€’2y ago
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
mndr
mndrOPβ€’2y ago
Testing While it builds, can watch paths be set in a template? I couldnt find that option No difference, same error
Brody
Brodyβ€’2y ago
are you sure the logs you have most recently provided are full logs?
mndr
mndrOPβ€’2y ago
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
Brody
Brodyβ€’2y ago
if I'm being honest, and I don't mean any offence, this just looks like you've written unstable code
mndr
mndrOPβ€’2y ago
No offence taken, I'm learning.. Any quick tips?
Brody
Brodyβ€’2y ago
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
mndr
mndrOPβ€’2y ago
No worries. Any suggestions on the monorepo layout, or anything else Railway specific?
Brody
Brodyβ€’2y ago
nothing wrong with a mono repo you asked about watch paths https://docs.railway.app/deploy/builds#watch-paths
mndr
mndrOPβ€’2y ago
I cannot add this to a template - would i need the .toml file?
Brody
Brodyβ€’2y ago
very good idea, let me see if you can define watch paths in a railway.json/toml file
mndr
mndrOPβ€’2y ago
The need for .python-version was new to me, but it worked, so thanks!
Brody
Brodyβ€’2y ago
you absolutely can specify watch paths in a railway.json file
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"watchPatterns": [
"folder"
],
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"healthcheckPath": "/ok200",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"watchPatterns": [
"folder"
],
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"healthcheckPath": "/ok200",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
this uses a dockerfile, so dont use this railway.json, but you get the idea
mndr
mndrOPβ€’2y ago
Would it be picked up for non-beta users?
Brody
Brodyβ€’2y ago
let me check, one sec
mndr
mndrOPβ€’2y ago
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
Brody
Brodyβ€’2y ago
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?
mndr
mndrOPβ€’2y ago
streamlit run streamlit_app.py
Brody
Brodyβ€’2y ago
and you are setting the appropriate root dir for each service?
mndr
mndrOPβ€’2y ago
Yes
Brody
Brodyβ€’2y ago
odd that builds from other services build then
Brody
Brodyβ€’2y ago
you can always set your watch paths in the railway.json file
mndr
mndrOPβ€’2y ago
I'm about to test that
Brody
Brodyβ€’2y ago
let me know how that goes
mndr
mndrOPβ€’2y ago
{ "$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?
Brody
Brodyβ€’2y ago
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 file
mndr
mndrOPβ€’2y ago
Helpful, thanks Do you have a sample .json with the root dir specified? Looking for the param to use, but can't find an example
Brody
Brodyβ€’2y ago
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
mndr
mndrOPβ€’2y ago
Hmm.. how should a monorepo with separate root dirs for each app be handled then?
Brody
Brodyβ€’2y ago
you set the root dir in the service settings
mndr
mndrOPβ€’2y ago
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
Brody
Brodyβ€’2y ago
IaC?
mndr
mndrOPβ€’2y ago
infra as code
Brody
Brodyβ€’2y ago
ah fancy acronym well if you have any more questions, feel free to ask πŸ™‚
mndr
mndrOPβ€’2y ago
I guess Railway calls it config as code πŸ™‚
Brody
Brodyβ€’2y ago
that sounds right
Tofu Boy [COMMS OPEN]
Hey @mndr, sorry to bother, can I dm you about this?
Brody
Brodyβ€’2y ago
are you having issues with langchain errors too?
Tofu Boy [COMMS OPEN]
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.
Brody
Brodyβ€’2y ago
please open your own #βœ‹ο½œhelp thread
mndr
mndrOPβ€’2y ago
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)
Want results from more Discord servers?
Add your server