My Backend Deployment Is Failing. What Should I Do?

Guidelines and Best Practices to Successfully Deploy Your Crowdbotics Backend

Encountering deployment issues can be frustrating, but fear not! Let's explore steps to tackle deployment failures on the Crowdbotics platform.

Understanding Deployment Failures

  • Dashboard Indications: Upon attempting to deploy your app, you might notice the dashboard showing the deployment process, only to later display a "deployment failed" message upon refreshing the page.

  • Log Insights: Checking the deployment logs can provide valuable insights. If you encounter an error during the execution of 'pipenv install --deploy-- system,' it's likely due to an outdated Pipfile.lock.

Steps to Resolve

To address this, follow these steps:

  1. Update Pipfile.lock:

    • Locate your Pipfile.lock, which is crucial for deploying to Heroku.
    • Whenever a new Python package is added to your Pipfile, run the command:
      pipenv lock
    • This updates the Pipfile.lock file with the latest package versions.
  2. Commit Changes:

    • After updating Pipfile.lock, commit the changes to your repository.
    • This ensures that Crowdbotics has the latest dependencies for successful deployment.

Why Pipenv.lock Matters

  • Package Management: Pipenv is used to manage Python packages within your app.
  • Dependency Locking: The Pipenv.lock file locks the exact versions of dependencies used in your project.
  • Heroku Deployment: Heroku relies on Pipenv.lock to install the correct packages during deployment.

Best Practices

  • Regular Updates: Ensure that your Pipfile.lock stays up to date with any changes to your app's dependencies.
  • Commit Workflow: Whenever changes are made to Pipfile or new packages are added, follow up with updating and committing Pipfile.lock.