Question

FastApi app not building

  1. The build is not triggering on push.
  2. I then manually force build and clean cache. It says
  Requested runtime 'python-3.11.4' is not available for this stack (heroku-18). 
  [2023-08-15 19:02:07] │  !     For supported versions, see: https://devcenter.heroku.com/articles/python-support 
  [2023-08-15 19:02:07] │ ERROR: failed to build: exit status 1 
  [2023-08-15 19:02:07] │ 
  [2023-08-15 19:02:07] │ 
  [2023-08-15 19:02:07] │ For documentation on the buildpacks used to build your app, please see: 
  [2023-08-15 19:02:07] │ 
  [2023-08-15 19:02:07] │    Python  v2.231.4  https://do.co/apps-buildpack-python 
  [2023-08-15 19:02:07] │

Well per the docs in DigitalOcean it says if there is no runtime.txt, it will default on its own version. And I didn’t have one before. Anyways, I added one, and I tried 3.11.3 and 3.11.4, both no good. Keeps failing.

I know DigitalOcean uses heroku buildpack. Not sure what’s going on right here.


Submit an answer


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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Jon Friesen
DigitalOcean Employee
DigitalOcean Employee badge
August 16, 2023
Accepted Answer

Hello,

Please consider upgrading your app to the new stack by adding a feature flag to your app spec, located in your app settings tab:

features:
    - buildpack-stack=ubuntu-22

A full app spec example:

name: sample-python
features:
    - buildpack-stack=ubuntu-22
services:
- github:
    branch: main
    repo: digitalocean/sample-python
  http_port: 8080
  instance_count: 1
  instance_size_slug: basic-xxs
  name: web
  routes:
  - path: /

Thanks

Bobby Iliev
Site Moderator
Site Moderator badge
August 16, 2023

Hi there,

I could suggest checking if there are any buildpacks upgrades available for your app.

To upgrade all of the app’s and its components’ buildpacks simultaneously, go to the control panel and click on the app with buildpacks you want to upgrade. Then, click on the app’s Overview tab. If any buildpacks have available upgrades, this page has a card titled Buildpack Upgrades Available. To upgrade, click the Deploy Upgrades button in this card. Note that this process redeploys your app.

If there are no buildpack upgrades available, is your repository open-source by any chance? If so, can you share a link here so I could take a look and see if there are any configuration settings that might be causing the problem?

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel