Deployment error

I’m getting an error when I try to deploy my replit. Here is a screenshot. There is no explanation for why it fails

https://replit.com/@travelmail26/ranodmstream

1 Like

Also, my replit doesn’t seem to have the “log” tab that’s suggested in the troubleshooting guidelines

hey there you should ccc a mod @ShaneAtReplit

1 Like

I mean, haven’t they said that you don’t need to do that before because they watch the forums?

1 Like

I guess but you know today is really really active for some reason

1 Like

@soren could you take a look here?

When you see logs like this:

where all it does is pull the container, exit, then try again, it means that your program is not running continuously. We assume that deployments are all continuously running (i.e. looping) programs. If the program exits, we assume that was an error and restart the program.

The other thing to note is in this option, when you select Web Server:

Screen Shot 2023-04-26 at 12.16.06 PM

we’re looking for a port to be opened by the program, otherwise the deployment will fail. After we bundle up your application and deploy it to a VM in Google Cloud, we wait for the application to start listening on a port to ensure that everything’s working as expected before marking the deployment as successful.

It also looks like you are using matplotlib in your Repl. Deployments don’t currently support any graphical desktop interfaces like the VNC which is used in the Replit Workspace, so that won’t work.

Hope that helps!

1 Like

@lincoln-replit a few questions

1). so does that mean i just need to have a program running and listening on a port to make deployment successful?

2). i’ll want my application to display data. the ultimate goal is to receive data from an external source and then display that in an interactive graph for the user. is that possible?

3). Why don’t i have a logs tab?

thanks

1). so does that mean i just need to have a program running and listening on a port to make deployment successful?

Yes, exactly.

2). i’ll want my application to display data. the ultimate goal is to receive data from an external source and then display that in an interactive graph for the user. is that possible?

Yes, you can display it as a webpage. Some people do this with a framework like Streamlit to make it easier.

3). Why don’t i have a logs tab?

That’s strange, can you share a screenshot?

@lincoln-replit Im still running into trouble deploying. I don’t understand what conditions are necessary for deployment to be successful. In this case, I created a simple flask app that is supposed to listen on all ports (0.0.0.0) and it runs when the deployment is launched. But it still fails.

admittedly, I’m new to this type of programming and I may be doing it wrong. But I know this approach works on my local machine. I just wanted to test whether I could send a postman message to Replit before I build something more sophisticated.

Not sure what i’m doing wrong. any help is appreciated. thanks

1 Like

IIRC, replit websties/apps need to listen on 127.0.0.1? Could be wrong.

IIRC, replit websties/apps need to listen on 127.0.0.1? Could be wrong.

No, for deployments you need to listen on 0.0.0.0.

In this case, I created a simple flask app that is supposed to listen on all ports (0.0.0.0) and it runs when the deployment is launched. But it still fails.

The conditions for a successful deployment are the same as successfully running your app in the workspace, with the big “Run” button at the top of the page. If you run right now, you’ll notice that it exits immediately, because you are trying to run main.py which is an empty file. The code you want to be running is in recieve.py. If you copy the contents of recieve.py over to main.py, and then change your 127.0.0.1 to 0.0.0.0, it should work.

Before you try to deploy next, hit the Run button and see if it works from there. If it doesn’t, there is still some debugging to do, and it won’t work in deployments either.

Only things that should be accessible as webservers should listen on 0.0.0.0. I usually just have nginx handle all incoming traffic and make nginx proxy requests to other webservers

I was just going off what I’d heard before.