Deployment failed for Slackbot app in Python

I’m new to Replit.

I have run the code on Replit (in staging) and everything works. But when I try to deploy, at the last stage I get this error

The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information.

The logs have no information.

How can I troubleshoot this?

1 Like

Hi @jackborn, welcome to the forums!
Could you send the logs of your deployment?
Thanks!

2024-04-05T00:50:05Z info: Deployment: efbebb6f-0d87-4ba7-b3af-8e4e373f0309
2024-04-05T00:50:05Z info: Build: 7d902e14-29c2-47fa-871c-d4c46347254c
2024-04-05T00:50:05Z info: Connecting to builder
2024-04-05T00:50:07Z info: Builder connected
2024-04-05T00:50:08Z info: Installing packages
2024-04-05T00:50:08Z info: Skipping Build as no Build command set
2024-04-05T00:50:08Z info: Pushing pid1 binary layer...
2024-04-05T00:50:10Z info: Created pid1 binary layer
2024-04-05T00:50:12Z info: Skipping Python layer creation
2024-04-05T00:50:12Z info: Skipping Node layer creation
2024-04-05T00:50:12Z info: Pushing hosting layer...
2024-04-05T00:50:12Z info: Pushing Repl layer...
2024-04-05T00:50:12Z info: Retrieved cached nix layer
2024-04-05T00:50:13Z info: Created hosting layer
2024-04-05T00:50:05Z info: Deployment: efbebb6f-0d87-4ba7-b3af-8e4e373f0309
2024-04-05T00:50:05Z info: Build: 7d902e14-29c2-47fa-871c-d4c46347254c
2024-04-05T00:50:05Z info: Connecting to builder
2024-04-05T00:50:07Z info: Builder connected
2024-04-05T00:50:08Z info: Installing packages
2024-04-05T00:50:08Z info: Skipping Build as no Build command set
2024-04-05T00:50:08Z info: Pushing pid1 binary layer...
2024-04-05T00:50:10Z info: Created pid1 binary layer
2024-04-05T00:50:12Z info: Skipping Python layer creation
2024-04-05T00:50:12Z info: Skipping Node layer creation
2024-04-05T00:50:12Z info: Pushing hosting layer...
2024-04-05T00:50:12Z info: Pushing Repl layer...
2024-04-05T00:50:12Z info: Retrieved cached nix layer
2024-04-05T00:50:13Z info: Created hosting layer
2024-04-05T00:50:32Z info: Created Repl layer
2024-04-05T00:50:32Z info: Pushing Repl (cache) layer...
2024-04-05T00:50:33Z info: Created Repl (cache) layer
2024-04-05T00:50:34Z info: Pushed image manifest
2024-04-05T00:50:35Z info: Pushed soci index manifest
2024-04-05T00:50:43Z info: Creating Autoscale service
forwarding local port 8080 to external port 1104
starting up user application
2024-04-05T00:52:37Z 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.
1 Like

Could you send the link to your repl?

Yes. Thanks for your help. If the link I’m sending opens it for others to see, please let me know. I’m new to Replit so I don’t know what I don’t know.

https://replit.com/@jackborn/UpWork-AI-Bot

Ah your repl is private, so we can’t see it. Could you make it public?
You can store sensitive data like API keys in Secrets.
Also note that the link will only allow users to see the code, not run or edit it.

Try now @NateDhaliwal

Hmm… your port configuration seems correct. Does

SocketModeHandler(app, os.environ["SLACK_APP_TOKEN"]).start()

accept any arguments for the ports?
Could you also check the Networking tab and see if everything is correct?

Here’s a screenshot of the network tab. I’m not sure if this is “correct”

Shared with Zight

And I am not aware of that line you asked about accepting any arguments.

It works on Slack prior to deploy. I just can’t get it deployed.

Honestly, I have no idea. The ports in your .replit file and Networking tab all look correct.

@NateDhaliwal do you work on the Replit team?

I need to get this resolved and wondering who I can take this to next to solve or troubleshoot. Thx.

Sorry, but I’m just a volunteer helping out.
The Replit Staff do actively monitor the forum, though.

1 Like

Hi there @jackborn and welcome!
Thanks for sharing your Repl. I forked your Repl and deployed as Reserved VM via Background Worker (which is the typical deployment recommendation for a bot). I didn’t hit any errors.
Let me know if I’m misunderstanding.

Ok @SuzyAtReplit

Thanks… I had been trying to deploy to an autoscale. I’ll try what you did.

@SuzyAtReplit It’s not clear to me how to change my deployment from autoscale to Reserved VM. Can you or anyone give me info on how I can change the deployment type? Sorry for the noob question.

Nevermind… I figured it out.

Kinda related… I found this video on the Replit YouTube channel showing AI bot + autoscale. My point is that it’s not clear to me where Replit recommends reserved VM over autoscale. Seems to contradict this video.

I’d love to see a resource that explains where autoscale is not recommended. Thx.

Hey @jackborn, the difference between Autoscale and Reserved VM is actually very simple. Reserved VMs are on 99% of the time which is useful for bots that are always listening. Whereas Autoscale only turns on when a request is made, which is good for AI bot websites that turn on when a request is made.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.