-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit code 3 after adding Diesel postgres fairing #1931
Comments
For me on Arch the code is working as-is. Have you verified that the postgresql server is actually running and the configuration for the database connection is correct? However I totally agree that the error should be more descriptive than exit code 3. |
I've manually run the diesel CLI: So, perhaps there is a difference in URL formatting between the two, or some other connection issue that doesn't present itself via cmdline, but I know at least that the postgres database is up and running. |
Ok, I've done some additional testing, and it feels like a race issue. I've had launchoff a couple of times, but when it happens feels inconsistent. I've rebooted, restarted the postgres service, and sometimes that fixes it, sometimes it doesn't. There doesn't appear to be a rhyme or reason to it that I can tell yet. |
Is this all of the log information you get? Try running with Nevertheless, this is a problem with Diesel/Windows/Configuration, not Rocket. |
I've tested it with debug logging, and there are no additional logs. Just an immediate exit code of 3, and nothing else. I'm not really sure where the issue lies. It definitely occurs during the fairing(), but it is proving tough to debug. It feels like std::process::exit(), but even putting a breakpoint there doesn't catch the exit. I do agree, this doesn't feel like Rocket (unless there's some multithreading stuff going on at this point in time) |
Same setup, if I run it under a debugger I can see the following error is written to the console before the program panics and exits:
That error appears in r2d2. Judging from the code there should have been something more after that message. |
I'm able to re-produce this with Postgres running on a Windows 10 machine as well. I set up a new Rocket project just to remove anything extraneous and ended up with a similar example to the OP. Postgres logs had the following
Which seems to indicate that the pool is disconnecting before all the connections have been established. Increasing my I only rarely use this machine for development, so simply limiting |
I reported it on diesel-rs/diesel#2947. |
Diesel maintainer here. This seems to be an platform specific issue either in diesel or in libpq. Neither As I do not have a windows 10 machine for development it would be really helpful to get some help tracking down this issue from the people affected by this. See the linked thread for details about information we are looking for, maybe you can help tracking down this issue. |
It looks like there's a platform solution at diesel-rs/diesel#2947 (comment). Since there isn't anything to fix in Rocket, I'm closing this out. |
Same issue with actix and diesel::r2d2 |
I came across this similar error while working with Actix-Diesel-Postgres I re-started the postgres services from services.msc(windows10) |
Quick question, how to gracefully shutdown, actix server and close any postgres connections still open ? |
Description
I'm attempting to build a rocket app backed by a Diesel Postgres database. However, when I attempt to run the application, it immediately dies:
To Reproduce
Cargo.toml
Rocket.toml
main.rs
The application works if I remove the
attach()
line. I've also tested the database connection string via diesel cmdline, which works.Expected Behavior
I'd expect either no error, or a more descriptive error than "Exit code 3".
Environment:
The text was updated successfully, but these errors were encountered: