R
Railway13mo ago
lionel

Django app deployment crashes due to cffi and libffi

Trying to deploy a Django app to Railway. After it builds successfully the deployment crashes with this error: #10 378.9 Running setup.py install for cffi: started #10 378.9 Running setup.py install for cffi: finished with status 'error' #10 378.9 error: subprocess-exited-with-error #10 378.9 #10 378.9 × Running setup.py install for cffi did not run successfully. #10 378.9 │ exit code: 1 #10 378.9 ╰─> [60 lines of output] #10 378.9 Package libffi was not found in the pkg-config search path. #10 378.9 Perhaps you should add the directory containing libffi.pc' #10 378.9 to the PKG_CONFIG_PATH environment variable #10 378.9 No package 'libffi' found`
69 Replies
Percy
Percy13mo ago
Project ID: 4ad98339-d4b3-47d9-973d-7162b5b5fd9f
lionel
lionel13mo ago
4ad98339-d4b3-47d9-973d-7162b5b5fd9f
Brody
Brody13mo ago
ThallesComH
ThallesComH13mo ago
cool tool brody
Brody
Brody13mo ago
thamks
lionel
lionel13mo ago
there was attempt as well.
lionel
lionel13mo ago
mysqlclient is in the requirements.txt
Brody
Brody13mo ago
it wants MySQLdb though
lionel
lionel13mo ago
thanks that fixed that one what about the cffi error in this log?
Brody
Brody13mo ago
send your railway.json please
Brody
Brody13mo ago
give this a try
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["...", "nodejs", "libffi"]
},
"ci": {
"dependsOn": ["setup"],
"cmds": ["npm ci"]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "python3 manage.py migrate && python3 manage.py collectstatic --no-input && gunicorn readinghood.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"nixpacksPlan": {
"providers": ["python"],
"phases": {
"setup": {
"nixPkgs": ["...", "nodejs", "libffi"]
},
"ci": {
"dependsOn": ["setup"],
"cmds": ["npm ci"]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "python3 manage.py migrate && python3 manage.py collectstatic --no-input && gunicorn readinghood.wsgi",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Want results from more Discord servers?
Add your server