"The deployment failed to initialize due to a configuration or code error."

I’m not able to deploy a template Python app using the following autoscale settings:
Autoscale (1 vCPU / 4 GiB RAM)

I’m getting the following error:
2024-01-05T17:41:38Z error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on … and a staff member will take a look.

Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:

import openai
import os
import sys

openai.api_key = os.environ['OPENAI_API_KEY']
if openai.api_key == "":
  You haven't set up your API key yet.

  If you don't have an API key yet, visit:


  1. Make an account or sign in
  2. Click "View API Keys" from the top right menu.
  3. Click "Create new secret key"

  Then, open the Secrets Tool and add OPENAI_API_KEY as a secret.

response = openai.chat.completions.create(
        "role": "system",
        "content": "You are a helpful assistant."
    }, {
        "role": "user",
        "content": "Who won the world series in 2020?"
    }, {
        "The Los Angeles Dodgers won the World Series in 2020."
    }, {
        "role": "user",
        "content": "Where was it played?"

1 Like

Hi @korhan , welcome to the forums!
You should not be deploying the bot as Autoscale as that is for websites, but instead as a Reserved VM.
However, your repl doesn’t appear to be a Discord/Telegram bot, so may I ask why you need to deploy this repl? Users won’t be able to run it either way.
Hope this helps!

1 Like