Closed JakubKoralewski closed 5 years ago
Hello! Thank you for the bug report.
I'm very sorry, but I'm unlikely to be able to help you very much with this error. Everything I know about getting Heroku to work with actix can be found in https://github.com/emk/rust-buildpack-example-actix. The last I checked, that can be deployed to Heroku and it works.
If you try deploying buildpack-example-actix, does it work? What if you update that project to the latest version of actix?
Thanks for the example! I did everything like it's done there. It works now!!! I didn't do it the scientific way so I still don't know which one it was, but it's one of or the combination of these differences:
Thanks for the example! I did everything like it's done there. It works now!!! I didn't do it the scientific way so I still don't know which one it was, but it's one of or the combination of these differences:
* bind using a tuple * parse the $PORT using .parse() * use ip 0.0.0.0 instead of 127.0.0.1
Confirming with latest Rust builds - using 0.0.0.0
along with the port as a tuple works!
Thanks for the example! I did everything like it's done there. It works now!!! I didn't do it the scientific way so I still don't know which one it was, but it's one of or the combination of these differences:
- bind using a tuple
- parse the $PORT using .parse()
- use ip 0.0.0.0 instead of 127.0.0.1
Hi,
I checked the source code of that project:
// Get the port number to listen on.
let port = env::var("PORT")
.unwrap_or_else(|_| "3000".to_string())
.parse()
.expect("PORT must be a number");
// Start a server, configuring the resources to serve.
server::new(|| {
App::new()
.resource("/", |r| r.f(greet))
.resource("/{name}", |r| r.f(greet))
})
.bind(("0.0.0.0", port))
.expect("Can not bind to port 8000")
.run();
But now Rocket does not even have the main function. What should I do to change this?
The build succeeds. I am using actix-web 0.7, diesel 1.4.2. This is my repo. Here's what the Heroku logs have to say about my error. I am binding to the correct PORT it seems that is set in the env variables. Once I release for 60 seconds I can try to access the API endpoints, but for this time I can't connect. I get a spinning circle and once the time passes I get an
Application Error
response in the browser.I don't think it's the problem, but I got this error on Sentry. It happened only once, but I tried releasing much more often than that, so I don't think that's the problem. I have used
heroku local
to bind to the PostgreSQL database on Heroku's AWS and it all works fine. It's just that it doesn't work on Heroku.Can it be this? I am leveraging auto reload with listenfd. Maybe it's somehow blocking Heroku from recognising the correct port?