cloudfoundry / python-buildpack

Cloud Foundry buildpack for the Python Language
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
119 stars 278 forks source link

ERR Failed to stage build: staging failed #768

Closed YuejieLI closed 2 months ago

YuejieLI commented 1 year ago

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version? cf version 7.5.0+0ad1d63.2022-06-04

What version of the buildpack you are using? python_buildpack 1.8.8

If you were attempting to accomplish a task, what was it you were attempting to do? I try to cf push an webapp to SAP BTP CF

What did you expect to happen? app running

What was the actual behavior? I got error telling me staging phase failed: see following errors:

it doesn' t happen to aiohttp only, it happens many packages to my requirements.txt. it seems PIP deosn't work!

2023-05-21T11:41:30.94+0800 [STG/0] OUT -----> Python Buildpack version 1.8.8 2023-05-21T11:41:30.94+0800 [STG/0] OUT WARNING buildpack version changed from 1.8.4 to 1.8.8 2023-05-21T11:41:30.94+0800 [STG/0] OUT -----> Supplying Python 2023-05-21T11:41:30.94+0800 [STG/0] OUT -----> Installing python 3.7.16 2023-05-21T11:41:30.94+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/f5cdf87200ba4d26deff1c80b3b99dad/python_3.7.16_linux_x64_cflinuxfs4_3248b4f3.tgz] 2023-05-21T11:41:33.17+0800 [STG/0] OUT Using python's pip module 2023-05-21T11:41:34.45+0800 [STG/0] OUT pip 22.0.4 from /tmp/contents736759813/deps/0/python/lib/python3.7/site-packages/pip (python 3.7) 2023-05-21T11:41:34.49+0800 [STG/0] OUT -----> Noticed dependency requiring libffi. Bootstrapping libffi. 2023-05-21T11:41:34.49+0800 [STG/0] OUT -----> Installing libffi 3.2.1 2023-05-21T11:41:34.49+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/0841b343acf6839a9aa6d0f42315930e/libffi-3.2.1-linux-x64-5f5bf32c.tgz] 2023-05-21T11:41:34.49+0800 [STG/0] OUT -----> Running Pip Install (Vendored) 2023-05-21T11:41:35.24+0800 [STG/0] OUT Using the pip --no-build-isolation flag since it is available 2023-05-21T11:41:35.24+0800 [STG/0] OUT python -m pip install -r /tmp/app/requirements.txt --ignore-installed --exists-action=w --src=/tmp/contents736759813/deps/0/src --no-index --find-links=file:///tmp/app/vendor --disable-pip-version-check --no-warn-script-location --no-build-isolation 2023-05-21T11:41:35.89+0800 [STG/0] OUT Looking in links: file:///tmp/app/vendor 2023-05-21T11:41:35.91+0800 [STG/0] ERR ERROR: Could not find a version that satisfies the requirement aiohttp==3.8.4 (from versions: none) 2023-05-21T11:41:35.91+0800 [STG/0] ERR ERROR: No matching distribution found for aiohttp==3.8.4 2023-05-21T11:41:35.97+0800 [STG/0] OUT Running pip install failed. You need to include all dependencies in the vendor directory. 2023-05-21T11:41:35.97+0800 [STG/0] OUT ERROR Could not install vendored pip packages: could not run pip: exit status 1 2023-05-21T11:41:36.32+0800 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14 2023-05-21T11:41:36.33+0800 [STG/0] OUT Exit status 223 2023-05-21T11:41:36.75+0800 [STG/0] OUT Cell 4d6fa3f4-05eb-456a-b72a-6a1517ec489b stopping instance 7e90e931-e3d8-47ea-8f20-bd4a1fe29b65 2023-05-21T11:41:36.75+0800 [STG/0] OUT Cell 4d6fa3f4-05eb-456a-b72a-6a1517ec489b destroying container for instance 7e90e931-e3d8-47ea-8f20-bd4a1fe29b65 2023-05-21T11:41:36.80+0800 [API/40] ERR Failed to stage build: staging failed 2023-05-21T11:41:42.79+0800 [STG/0] OUT Cell 4d6fa3f4-05eb-456a-b72a-6a1517ec489b successfully destroyed container for instance 7e90e931-e3d8-47ea-8f20-bd4a1fe29b65

cf logs --recent 2023-05-21T12:17:54.00+0800 [STG/0] OUT WARNING buildpack version changed from 1.8.4 to 1.8.8 2023-05-21T12:17:54.00+0800 [STG/0] OUT -----> Supplying Python 2023-05-21T12:17:54.00+0800 [STG/0] OUT -----> Installing python 3.7.16 2023-05-21T12:17:54.00+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/f5cdf87200ba4d26deff1c80b3b99dad/python_3.7.16_linux_x64_cflinuxfs4_3248b4f3.tgz] 2023-05-21T12:17:56.45+0800 [STG/0] OUT Using python's pip module 2023-05-21T12:17:57.75+0800 [STG/0] OUT pip 22.0.4 from /tmp/contents920094868/deps/0/python/lib/python3.7/site-packages/pip (python 3.7) 2023-05-21T12:17:57.79+0800 [STG/0] OUT -----> Noticed dependency requiring libffi. Bootstrapping libffi. 2023-05-21T12:17:57.79+0800 [STG/0] OUT -----> Installing libffi 3.2.1 2023-05-21T12:17:57.79+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/0841b343acf6839a9aa6d0f42315930e/libffi-3.2.1-linux-x64-5f5bf32c.tgz] 2023-05-21T12:17:57.80+0800 [STG/0] OUT -----> Running Pip Install (Vendored) 2023-05-21T12:17:58.52+0800 [STG/0] OUT Using the pip --no-build-isolation flag since it is available 2023-05-21T12:17:58.52+0800 [STG/0] OUT python -m pip install -r /tmp/app/requirements.txt --ignore-installed --exists-action=w --src=/tmp/contents920094868/deps/0/src --no-index --find-links=file:///tmp/app/vendor --disable-pip-version-check --no-warn-script-location --no-build-isolation 2023-05-21T12:17:59.12+0800 [STG/0] OUT Looking in links: file:///tmp/app/vendor 2023-05-21T12:17:59.15+0800 [STG/0] OUT Processing ./vendor/fastapi-0.68.1-py3-none-any.whl 2023-05-21T12:17:59.16+0800 [STG/0] OUT Processing ./vendor/uvicorn-0.15.0-py3-none-any.whl 2023-05-21T12:17:59.17+0800 [STG/0] ERR ERROR: Could not find a version that satisfies the requirement pydantic (from versions: none) 2023-05-21T12:17:59.17+0800 [STG/0] ERR ERROR: No matching distribution found for pydantic 2023-05-21T12:17:59.23+0800 [STG/0] OUT Running pip install failed. You need to include all dependencies in the vendor directory. 2023-05-21T12:17:59.23+0800 [STG/0] OUT ERROR Could not install vendored pip packages: could not run pip: exit status 1 2023-05-21T12:17:59.48+0800 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14 2023-05-21T12:17:59.49+0800 [STG/0] OUT Exit status 223 2023-05-21T12:17:59.74+0800 [STG/0] OUT Cell ec586f58-37d9-40f3-b7b5-8004e62c575b stopping instance e373df16-55e5-4e0e-b351-7c5092ce5f03 2023-05-21T12:17:59.74+0800 [STG/0] OUT Cell ec586f58-37d9-40f3-b7b5-8004e62c575b destroying container for instance e373df16-55e5-4e0e-b351-7c5092ce5f03 2023-05-21T12:17:59.82+0800 [API/143] ERR Failed to stage build: staging failed 2023-05-21T12:18:05.28+0800 [STG/0] OUT Cell ec586f58-37d9-40f3-b7b5-8004e62c575b successfully destroyed container for instance e373df16-55e5-4e0e-b351-7c5092ce5f03 2023-05-21T12:20:21.02+0800 [API/156] OUT Applied manifest to app with guid eacf7b14-9295-44e1-830f-221b2563f41d (--- 2023-05-21T12:20:21.02+0800 [API/156] OUT applications: 2023-05-21T12:20:21.02+0800 [API/156] OUT - name: Starlette-dev 2023-05-21T12:20:21.02+0800 [API/156] OUT path: "/Users/i037382/Documents/Starlette_Gitee" 2023-05-21T12:20:21.02+0800 [API/156] OUT memory: 128M 2023-05-21T12:20:21.02+0800 [API/156] OUT default-route: true 2023-05-21T12:20:21.02+0800 [API/156] OUT buildpack: python_buildpack#1.8.4 2023-05-21T12:20:21.02+0800 [API/156] OUT command: python main.py 2023-05-21T12:20:21.02+0800 [API/156] OUT domain: cfapps.eu10.hana.ondemand.com 2023-05-21T12:20:21.02+0800 [API/156] OUT host: Starlette-dev 2023-05-21T12:20:21.02+0800 [API/156] OUT route: Starlette-dev.cfapps.eu10.hana.ondemand.com 2023-05-21T12:20:21.03+0800 [API/156] OUT services: 2023-05-21T12:20:21.03+0800 [API/156] OUT - myxsuaa 2023-05-21T12:20:21.03+0800 [API/156] OUT - dynatrace-service 2023-05-21T12:20:21.03+0800 [API/156] OUT ) 2023-05-21T12:20:21.50+0800 [API/7] OUT Updating process: "web" 2023-05-21T12:20:21.69+0800 [API/7] OUT Scaling process: "web" 2023-05-21T12:21:37.67+0800 [API/57] OUT Applied manifest to app with guid eacf7b14-9295-44e1-830f-221b2563f41d (--- 2023-05-21T12:21:37.67+0800 [API/57] OUT applications: 2023-05-21T12:21:37.68+0800 [API/57] OUT - name: Starlette-dev 2023-05-21T12:21:37.68+0800 [API/57] OUT path: "/Users/i037382/Documents/Starlette_Gitee" 2023-05-21T12:21:37.68+0800 [API/57] OUT memory: 128M 2023-05-21T12:21:37.68+0800 [API/57] OUT default-route: true 2023-05-21T12:21:37.68+0800 [API/57] OUT buildpack: python_buildpack#1.8.8 2023-05-21T12:21:37.68+0800 [API/57] OUT command: python main.py 2023-05-21T12:21:37.68+0800 [API/57] OUT domain: cfapps.eu10.hana.ondemand.com 2023-05-21T12:21:37.68+0800 [API/57] OUT host: Starlette-dev 2023-05-21T12:21:37.68+0800 [API/57] OUT route: Starlette-dev.cfapps.eu10.hana.ondemand.com 2023-05-21T12:21:37.68+0800 [API/57] OUT services: 2023-05-21T12:21:37.68+0800 [API/57] OUT - myxsuaa 2023-05-21T12:21:37.68+0800 [API/57] OUT - dynatrace-service 2023-05-21T12:21:37.68+0800 [API/57] OUT ) 2023-05-21T12:21:38.32+0800 [API/9] OUT Updating process: "web" 2023-05-21T12:21:38.53+0800 [API/9] OUT Scaling process: "web" 2023-05-21T12:23:02.07+0800 [API/44] OUT Applied manifest to app with guid eacf7b14-9295-44e1-830f-221b2563f41d (--- 2023-05-21T12:23:02.07+0800 [API/44] OUT applications: 2023-05-21T12:23:02.07+0800 [API/44] OUT - name: Starlette-dev 2023-05-21T12:23:02.07+0800 [API/44] OUT path: "/Users/i037382/Documents/Starlette_Gitee" 2023-05-21T12:23:02.07+0800 [API/44] OUT memory: 128M 2023-05-21T12:23:02.07+0800 [API/44] OUT default-route: true 2023-05-21T12:23:02.07+0800 [API/44] OUT buildpack: python_buildpack 2023-05-21T12:23:02.07+0800 [API/44] OUT command: python main.py 2023-05-21T12:23:02.07+0800 [API/44] OUT domain: cfapps.eu10.hana.ondemand.com 2023-05-21T12:23:02.07+0800 [API/44] OUT host: Starlette-dev 2023-05-21T12:23:02.07+0800 [API/44] OUT route: Starlette-dev.cfapps.eu10.hana.ondemand.com 2023-05-21T12:23:02.07+0800 [API/44] OUT services: 2023-05-21T12:23:02.07+0800 [API/44] OUT - myxsuaa 2023-05-21T12:23:02.07+0800 [API/44] OUT - dynatrace-service 2023-05-21T12:23:02.07+0800 [API/44] OUT ) 2023-05-21T12:23:02.71+0800 [API/3] OUT Updating process: "web" 2023-05-21T12:23:02.84+0800 [API/3] OUT Scaling process: "web" 2023-05-21T12:23:02.91+0800 [API/3] OUT Updated app with guid eacf7b14-9295-44e1-830f-221b2563f41d ({"lifecycle"=>{"data"=>{"buildpacks"=>["python_buildpack"]}}}) 2023-05-21T12:23:02.94+0800 [API/3] OUT Updated app with guid eacf7b14-9295-44e1-830f-221b2563f41d ({"environment_variables"=>"[PRIVATE DATA HIDDEN]"}) 2023-05-21T12:23:51.95+0800 [API/157] OUT Uploading app package for app with guid eacf7b14-9295-44e1-830f-221b2563f41d 2023-05-21T12:25:42.02+0800 [API/142] OUT Creating build for app with guid eacf7b14-9295-44e1-830f-221b2563f41d 2023-05-21T12:25:42.64+0800 [STG/0] OUT Downloading python_buildpack... 2023-05-21T12:25:42.68+0800 [STG/0] OUT Downloaded python_buildpack 2023-05-21T12:25:42.68+0800 [STG/0] OUT Cell f5fd9e46-c3ec-416d-837f-fc635366b782 creating container for instance bf34caa7-6f1a-4bca-bdde-a4dacc8347af 2023-05-21T12:25:43.04+0800 [STG/0] OUT Security group rules were updated 2023-05-21T12:25:43.05+0800 [STG/0] OUT Cell f5fd9e46-c3ec-416d-837f-fc635366b782 successfully created container for instance bf34caa7-6f1a-4bca-bdde-a4dacc8347af 2023-05-21T12:25:43.34+0800 [STG/0] OUT Downloading app package... 2023-05-21T12:25:43.34+0800 [STG/0] OUT Downloading build artifacts cache... 2023-05-21T12:25:44.62+0800 [STG/0] OUT Downloaded build artifacts cache (34.6M) 2023-05-21T12:25:58.55+0800 [STG/0] OUT Downloaded app package (465.4M) 2023-05-21T12:25:58.64+0800 [STG/0] OUT -----> Python Buildpack version 1.8.8 2023-05-21T12:25:58.64+0800 [STG/0] OUT WARNING buildpack version changed from 1.8.4 to 1.8.8 2023-05-21T12:25:58.64+0800 [STG/0] OUT -----> Supplying Python 2023-05-21T12:25:58.64+0800 [STG/0] OUT -----> Installing python 3.7.16 2023-05-21T12:25:58.64+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/f5cdf87200ba4d26deff1c80b3b99dad/python_3.7.16_linux_x64_cflinuxfs4_3248b4f3.tgz] 2023-05-21T12:26:00.82+0800 [STG/0] OUT Using python's pip module 2023-05-21T12:26:02.09+0800 [STG/0] OUT pip 22.0.4 from /tmp/contents1038047568/deps/0/python/lib/python3.7/site-packages/pip (python 3.7) 2023-05-21T12:26:02.14+0800 [STG/0] OUT -----> Noticed dependency requiring libffi. Bootstrapping libffi. 2023-05-21T12:26:02.14+0800 [STG/0] OUT -----> Installing libffi 3.2.1 2023-05-21T12:26:02.14+0800 [STG/0] OUT Copy [/tmp/buildpacks/a6ba7d39023edfa9626f30becde665ee/dependencies/0841b343acf6839a9aa6d0f42315930e/libffi-3.2.1-linux-x64-5f5bf32c.tgz] 2023-05-21T12:26:02.14+0800 [STG/0] OUT -----> Running Pip Install (Vendored) 2023-05-21T12:26:02.86+0800 [STG/0] OUT Using the pip --no-build-isolation flag since it is available 2023-05-21T12:26:02.86+0800 [STG/0] OUT python -m pip install -r /tmp/app/requirements.txt --ignore-installed --exists-action=w --src=/tmp/contents1038047568/deps/0/src --no-index --find-links=file:///tmp/app/vendor --disable-pip-version-check --no-warn-script-location --no-build-isolation 2023-05-21T12:26:03.47+0800 [STG/0] OUT Looking in links: file:///tmp/app/vendor 2023-05-21T12:26:03.49+0800 [STG/0] OUT Processing ./vendor/fastapi-0.68.1-py3-none-any.whl 2023-05-21T12:26:03.51+0800 [STG/0] OUT Processing ./vendor/uvicorn-0.15.0-py3-none-any.whl 2023-05-21T12:26:03.52+0800 [STG/0] ERR ERROR: Could not find a version that satisfies the requirement pydantic (from versions: none) 2023-05-21T12:26:03.52+0800 [STG/0] ERR ERROR: No matching distribution found for pydantic 2023-05-21T12:26:03.58+0800 [STG/0] OUT Running pip install failed. You need to include all dependencies in the vendor directory. 2023-05-21T12:26:03.58+0800 [STG/0] OUT ERROR Could not install vendored pip packages: could not run pip: exit status 1 2023-05-21T12:26:03.81+0800 [STG/0] ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14 2023-05-21T12:26:03.82+0800 [STG/0] OUT Exit status 223 2023-05-21T12:26:04.31+0800 [STG/0] OUT Cell f5fd9e46-c3ec-416d-837f-fc635366b782 stopping instance bf34caa7-6f1a-4bca-bdde-a4dacc8347af 2023-05-21T12:26:04.31+0800 [STG/0] OUT Cell f5fd9e46-c3ec-416d-837f-fc635366b782 destroying container for instance bf34caa7-6f1a-4bca-bdde-a4dacc8347af 2023-05-21T12:26:04.36+0800 [API/20] ERR Failed to stage build: staging failed 2023-05-21T12:26:10.61+0800 [STG/0] OUT Cell f5fd9e46-c3ec-416d-837f-fc635366b782 successfully destroyed container for instance bf34caa7-6f1a-4bca-bdde-a4dacc8347af

Please confirm where necessary:

robdimsdale commented 1 year ago

I think the relevant logs are:

2023-05-21T11:41:35.97+0800 [STG/0] OUT Running pip install failed. You need to include all dependencies in the vendor directory.
2023-05-21T11:41:35.97+0800 [STG/0] OUT ERROR Could not install vendored pip packages: could not run pip: exit status 1

Do you have all your dependencies vendored? It seems like you only have some of them vendored and that is unsupported. It used to work but that was a bug - see https://github.com/cloudfoundry/python-buildpack/pull/638.

robdimsdale commented 2 months ago

I'm going to close this out as there's been no response in over a year.