Backend deployment fails - masonite-cli

App link - https://app.crowdbotics.com/dashboard/app/18674

So the app was working fine and while we were trying to deploy this time we got this error

ModuleNotFoundError: No module named 'setuptools_rust'

we absolutely changed nothing related to any package for a while, tried to install it also in docker with pip but got other errors so rolled back, here is full error message

https://build-output.heroku.com/streams/bc/bc7578ed-b417-4e98-862d-0cd1c439e18f/logs/51/51579b26-087d-4ec3-8f0f-511fec5b9f69.log?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIQI6BAUWXGR4S77Q%2F20210212%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210212T194728Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=374f43061a932dad354770bcb925c3a3ef9a550778fdacaf9312ed8e7236f9d2

Hi Mohamed,

This was caused by a recent update in the python cryptography package. The easiest fix is to pin the package version by adding cryptography = "<3.4" under the [packages] section in Pipenv. Make sure you run pipenv lock and commit the updated of version of Pipenv.lock as well.

Alternatively if you want to use the most recent version of cryptography you’d have to add Rust build dependencies in Dockerfile.

1 Like

Hi @Crowdbotics_Dan thank you so much for your support, our current version is actually cryptography==3.3.1 and we are using requirements.txt is it might be another way? or should i go with Rust build thing?

@mohamed.youssef, the Dockerfile runs off Pipfile.lock. Please make sure you add the necessary dependencies to Pipfile and then run pipenv lock.

You can read more about Pipenv here - pipenv · PyPI

Hi @dmitrii.k @Crowdbotics_Dan , we are using requirements.txt not pipenv, so it should install from there directly, right?

also the version of cryptography we have is 3.3.1 shouldn’t that be good?

Hi @mohamed.youssef,

Your production uses Docker. Your repository contains a Dockerfile that describes the docker image that runs in production. That docker image uses pipenv in production. Please refer to your README for more information about that.

You’re free to modify the Dockerfile to make it suit your process. I encourage you to test locally using Docker Compose - this will ensure you build and run the same image that will build and run in production before deploying it.