Deployment failing for actually no reason

problem: I have a simple social media website, when I run it in the Workspace everything works fine, the error is not from the database it is a result of deploying the code. Nothing goes wrong no matter how I test it but when I try to deploy the project I get the following error: “The deployment failed to initialize due to a configuration or code error.” Why is my code not deploying

Hi @TyraePaul0 !
What deployment method are you using?
Also, could you share the full deployment logs?
Thanks!

I am using autoscale and here is all the information I can get from logs (There doesn’t seem to be any information from the server actually attempting to deploy):

03/07/24 10:02:28 PM

127.0.0.1 - - [08/Mar/2024 04:02:28] "HEAD / HTTP/1.1" 200 -

03/07/24 09:57:52 PM

127.0.0.1 - - [08/Mar/2024 03:57:52] "GET / HTTP/1.1" 200 -

03/07/24 09:57:28 PM

127.0.0.1 - - [08/Mar/2024 03:57:28] "HEAD / HTTP/1.1" 200 -

03/07/24 09:56:23 PM

e[33mPress CTRL+C to quite[0m

03/07/24 09:56:23 PM

* Running on http://127.0.0.1:80

03/07/24 09:56:23 PM

* Running on all addresses (0.0.0.0)

03/07/24 09:56:23 PM

e[31me[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.e[0m

03/07/24 09:56:23 PM

* Running on http://169.254.8.1:80

03/07/24 09:56:23 PM

* Debug mode: off

03/07/24 09:56:23 PM

* Serving Flask app 'app'

03/07/24 09:56:19 PM

forwarding local port 81 to external port 1104

03/07/24 09:56:18 PM

starting up user application

03/07/24 09:52:35 PM

e[33mPress CTRL+C to quite[0m

03/07/24 09:52:35 PM

* Running on http://127.0.0.1:80

03/07/24 09:52:35 PM

* Running on all addresses (0.0.0.0)

03/07/24 09:52:35 PM

* Running on http://169.254.8.1:80

03/07/24 09:52:35 PM

e[31me[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.e[0m

03/07/24 09:52:35 PM

* Debug mode: off

03/07/24 09:52:35 PM

* Serving Flask app 'app'

03/07/24 09:52:31 PM

forwarding local port 81 to external port 1104

03/07/24 09:52:30 PM

starting up user application

What host and ports are you using for the webserver?

I’m using port 81 but by host do you mean “0.0.0.0” if so then that’s the answer otherwise could you tell me what exactly you’re asking?

Yes, that’s what I am talking about.
Try changing your port to 8000 or 8080 maybe?
Are there any errors in the Console?
There should also be another log of things, about making the deployment (creating service, manifest thing etc), it should say something about exec already starting.

I think I figured it out I just tried redeploying again out of frustration and it works now, I tested it on a different project editing code that didn’t matter as much and after deploying it deployed code that was old so I think replit is having issues keeping code to deploy and code in the workspace synced. By the way I did not change the port number at all or change any code whatsoever. Here are the logs from the successful deploy if you’re curious

2024-03-08T04:16:07Z info: Deployment: eda55e1c-a60d-4edc-9fae-cccfc1c79887
2024-03-08T04:16:07Z info: Build: f2616798-f8f8-474a-8020-fa4a2598e950
2024-03-08T04:16:07Z info: Connecting to builder
2024-03-08T04:16:07Z info: Deployment: eda55e1c-a60d-4edc-9fae-cccfc1c79887
2024-03-08T04:16:07Z info: Build: f2616798-f8f8-474a-8020-fa4a2598e950
2024-03-08T04:16:07Z info: Connecting to builder
2024-03-08T04:16:09Z info: Builder connected
2024-03-08T04:16:10Z info: Installing packages
2024-03-08T04:16:11Z info: Skipping Build as no Build command set
2024-03-08T04:16:11Z info: Pushing pid1 binary layer...
2024-03-08T04:16:12Z info: Created pid1 binary layer
2024-03-08T04:16:14Z info: Skipping Python layer creation
2024-03-08T04:16:14Z info: Skipping Node layer creation
2024-03-08T04:16:14Z info: Pushing hosting layer...
2024-03-08T04:16:14Z info: Pushing Repl layer...
2024-03-08T04:16:14Z info: Retrieved cached nix layer
2024-03-08T04:16:15Z info: Created hosting layer
2024-03-08T04:16:33Z info: Created Repl layer
2024-03-08T04:16:33Z info: Pushing Repl (cache) layer...
2024-03-08T04:16:35Z info: Created Repl (cache) layer
2024-03-08T04:16:36Z info: Pushed image manifest
2024-03-08T04:16:36Z info: Pushed soci index manifest
2024-03-08T04:16:44Z info: Creating Autoscale service
starting up user application
forwarding local port 81 to external port 1104
 * Serving Flask app 'app'
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:81
 * Debug mode: off
127.0.0.1 - - [08/Mar/2024 04:17:20] "GET / HTTP/1.1" 302 -
Press CTRL+C to quit
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://169.254.8.1:81
2024-03-08T04:17:22Z info: Waiting for service to be ready
2024-03-08T04:17:24Z info: Deployment successful

Glad you solved it!

Yes, you will need to re-deploy your repl to ensure that it uses the updated code. Deployments don’t auto-deploy when there are updates, so it is manual.

1 Like

I did this though, I redeployed 5 times before making this post so I’m still a little confused.

1 Like

Hmm… maybe it’s luck? This shouldn’t happen if no code was changed/you re-deployed 5 times. Idk.

well thanks for trying to figure it out with me anyway

1 Like

I am having this exact issue right now with some of my existing projects, and all new brand new projects, nothing is deploying. No logs either.

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