Question

How to solve? Django app "deployment failed during deploy phase" "Layer cache not found" in logs

  • Posted on February 12, 2022
  • aeonismAsked by aeonism

I am following the Deploy a Django App on App Platform tutorial, and the build fails. Does anyone have advice on how to solve this?

This is the logs I get under the Activity Tab for Deployment:

2022-02-12T15:01:59.717303993Z => Initializing build
2022-02-12T15:01:59.755702529Z => Retrieving source code to /workspace
2022-02-12T15:01:59.790510911Z => Selecting branch "main"
2022-02-12T15:02:00.910844681Z => Checking out commit "9bae184d943759372396e4f817c88c0da2fe83be"
2022-02-12T15:02:01.693914998Z => Got source_dir: /
2022-02-12T15:02:01.719719239Z => Using workspace root /workspace
2022-02-12T15:02:01.757351947Z 
2022-02-12T15:02:01.757538232Z => Building app using buildpacks
2022-02-12T15:02:01.981714611Z => Injecting app environment variables:
2022-02-12T15:02:01.981736117Z      DJANGO_SECRET_KEY DJANGO_ALLOWED_HOSTS DEBUG
2022-02-12T15:02:02.311746221Z => Running buildpack detection
2022-02-12T15:02:02.311762525Z 
2022-02-12T15:02:02.535221160Z 3 of 4 buildpacks participating
2022-02-12T15:02:02.535236817Z digitalocean/python-appdetect 0.0.2
2022-02-12T15:02:02.535316445Z heroku/python                 0.205.4
2022-02-12T15:02:02.535368067Z digitalocean/procfile         0.0.3
2022-02-12T15:02:02.586085053Z 
2022-02-12T15:02:02.586138260Z For documentation on the buildpacks used to build your app, please see:
2022-02-12T15:02:02.586195711Z    Python: https://do.co/apps-buildpack-python
2022-02-12T15:02:02.854131448Z 
2022-02-12T15:02:02.854303621Z => Building app
2022-02-12T15:02:02.854318676Z 
2022-02-12T15:02:03.425555644Z -----> No Python version was specified. Using the buildpack default: python-3.9.9
2022-02-12T15:02:03.425579592Z        To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
2022-02-12T15:02:04.198360764Z -----> Installing python-3.9.9
2022-02-12T15:02:20.158811766Z -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
2022-02-12T15:02:32.283033041Z -----> Installing SQLite3
2022-02-12T15:02:46.492033687Z rm: cannot remove '/workspace/.heroku/python/apt/state/lists': Directory not empty
2022-02-12T15:02:46.493876855Z Sqlite3 failed to install.
2022-02-12T15:02:46.708666698Z -----> Installing requirements with pip
2022-02-12T15:02:48.217479337Z        Collecting django<4.0,>=3.2
2022-02-12T15:02:48.276583122Z          Downloading Django-3.2.12-py3-none-any.whl (7.9 MB)
2022-02-12T15:02:49.186583569Z        Collecting pillow<10.0,>=9.0
2022-02-12T15:02:49.230910461Z          Downloading Pillow-9.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB)
2022-02-12T15:02:49.410582045Z        Collecting gunicorn
2022-02-12T15:02:49.431838613Z          Downloading gunicorn-20.1.0-py3-none-any.whl (79 kB)
2022-02-12T15:02:49.456203166Z        Collecting dj-database-url
2022-02-12T15:02:49.476474844Z          Downloading dj_database_url-0.5.0-py2.py3-none-any.whl (5.5 kB)
2022-02-12T15:02:49.546039195Z        Collecting asgiref<4,>=3.3.2
2022-02-12T15:02:49.563625939Z          Downloading asgiref-3.5.0-py3-none-any.whl (22 kB)
2022-02-12T15:02:49.734341112Z        Collecting pytz
2022-02-12T15:02:49.751826349Z          Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
2022-02-12T15:02:49.809352925Z        Collecting sqlparse>=0.2.2
2022-02-12T15:02:49.843504655Z          Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)
2022-02-12T15:02:50.013860766Z        Installing collected packages: sqlparse, pytz, asgiref, pillow, gunicorn, django, dj-database-url
2022-02-12T15:02:59.867290017Z        Successfully installed asgiref-3.5.0 dj-database-url-0.5.0 django-3.2.12 gunicorn-20.1.0 pillow-9.0.1 pytz-2021.3 sqlparse-0.4.2
2022-02-12T15:03:02.431388259Z -----> $ python manage.py collectstatic --noinput
2022-02-12T15:03:03.333063186Z        134 static files copied to '/workspace/staticfiles'.
2022-02-12T15:03:03.378622669Z 
2022-02-12T15:03:18.805098082Z 
2022-02-12T15:03:18.935519586Z => Uploading the built Docker image to the container registry...
2022-02-12T15:03:21.626858263Z Adding layer 'heroku/python:profile'
2022-02-12T15:03:45.558905626Z Adding 1/1 app layer(s)
2022-02-12T15:03:45.577487862Z Adding layer 'launcher'
2022-02-12T15:03:45.653094365Z Adding layer 'config'
2022-02-12T15:03:45.660420810Z Adding label 'io.buildpacks.lifecycle.metadata'
2022-02-12T15:03:45.661258972Z Adding label 'io.buildpacks.build.metadata'
2022-02-12T15:03:45.661417618Z Adding label 'io.buildpacks.project.metadata'
2022-02-12T15:04:52.897383611Z *** Images (sha256:45485291ce73df86ba01e52d05c00b14f7ae5e72f7b9ca6998ee99093ca0cdc6):
2022-02-12T15:04:52.897420859Z       <image-1>
2022-02-12T15:04:53.254639726Z Layer cache not found
2022-02-12T15:05:02.854594145Z Adding cache layer 'heroku/python:shim'
2022-02-12T15:05:56.533399990Z => Uploaded the built image to the container registry
2022-02-12T15:05:56.545630323Z => Build complete
Show comments

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer