Skip to content
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

warp::server] server error: executor failed to spawn task: tokio::spawn failed (is a tokio runtime running this future?) #275

Closed
bbigras opened this issue Sep 24, 2019 · 2 comments

Comments

@bbigras
Copy link
Contributor

bbigras commented Sep 24, 2019

I didn't have this problem with either an old nightly or older version of the crates. not sure.

nightly-2019-09-13-i686-pc-windows-msvc

EDIT:
I also have the same result with rustc 1.39.0-nightly (eb48d6bde 2019-09-12) on Linux.

[dependencies]
env_logger = "0.7"
futures-preview = { version = "0.3.0-alpha.17", features = ["compat"] }
log = "0.4"
tokio = "0.2.0-alpha.5"
warp = "0.1"
use env_logger::Env;
use warp::Filter;

use futures::compat::Future01CompatExt;

#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
    let log_env = Env::default().filter_or("RUST_LOG", "debug");
    env_logger::init_from_env(log_env);

    let routes = warp::get2().and(warp::fs::dir("app/build"));
    let f = warp::serve(routes).bind(([0, 0, 0, 0], 8080));
    if let Err(e) = f.compat().await {
        println!("error: {:?}", e);
    }
    Ok(())
}
[2019-09-24T20:26:12Z WARN  hyper::common::exec] executor error: SpawnError { is_shutdown: true }
[2019-09-24T20:26:12Z ERROR warp::server] server error: executor failed to spawn task: tokio::spawn failed (is a tokio runtime running this future?)
@seanmonstar
Copy link
Owner

The problem is that the 0.1.x version of warp is expecting a 0.1 of tokio, and they don't notice the newer one you're using.

There's work in progress to update warp here: #265

@bbigras
Copy link
Contributor Author

bbigras commented Sep 24, 2019

Gotcha. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants