Skip to content

Streaming Evaluation fails for Node Names containing periods #92

@whentze

Description

@whentze

In our deployment, we have hosts with names such as foobar.production.

Trying to deploy (or even build) these with --evaluator streaming currently fails with an error such as

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/nix/deployment/mod.rs:266:69
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: colmena::nix::deployment::Deployment::execute::{{closure}}::{{closure}}::{{closure}}
   4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   5: <tokio::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
   6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
   7: <tokio::future::maybe_done::MaybeDone<Fut> as core::future::future::Future>::poll
   8: <tokio::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
   9: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  10: colmena::cli::run::{{closure}}
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: tokio::park::thread::CachedParkThread::block_on
  13: tokio::runtime::thread_pool::ThreadPool::block_on
  14: colmena::main

By debugging colmena, I was able to trace the cause of this error to those node names containing periods.
In particular, these periods cause the streaming evaluator to add extraneous quotes to the attribute names, so attr.attribute() will be "\"foobar.production\"" instead of "foobar.production", which causes the lookup for that node to fail.

I have a hacky workaround in my fork that just trims any leading and trailing quotes from that node name, but there's probably a more "proper" fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions