Deployment Issues ("Promote" doesn't work)

Question:
I’m trying to deploy my app but the last “promote” step does not work. I’m getting this error message:

  File "/home/runner/3be8647d-7a34-4962-bc76-3c324c0a8e2f/main.py", line 15, in <module>
Traceback (most recent call last):
2024-02-08 12:51:05,802 - root - CRITICAL - OPENAI_API_KEY is not set in environment variables
exec [python3 main.py] error=exit status 1
openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
exec [python3 main.py] error=exec: already started
2024-02-08T12:51:12Z 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 https://ask.replit.com/c/help/13 and a staff member will take a look.

My app works as expected and the OpenAI API routes work (images get generated in my app).

Does anyone know what I can do to fix this? ChatGPT told me to ask here because it also didn’t know what to do haha

thx!

Replit Profile: https://replit.com/@heidekerphilipp

Did you set the secrets in the deployment secrets?

2 Likes

Hi! I didn’t know that was a thing. I added them now and tried to deploy. However, it still says the same and tells me the secrets are out of sync again.

I added the two secrets (clicked the + signs) and then clicked deploy. It went through the steps until promote and again said they’re out of sync. Any ideas?

here’s the error I’m getting: ““2024-02-08T15:15:35Z 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 https://ask.replit.com/c/help/13 and a staff member will take a look.””

I’d say double check that your code doesn’t have an error, and your deployment type.

2 Likes