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

Panic on secrets value in clickhouse sink endpoint #20974

Closed
brad-alexander opened this issue Jul 31, 2024 · 1 comment · Fixed by #20985
Closed

Panic on secrets value in clickhouse sink endpoint #20974

brad-alexander opened this issue Jul 31, 2024 · 1 comment · Fixed by #20985
Labels
domain: config Anything related to configuring Vector type: bug A code related bug.

Comments

@brad-alexander
Copy link

brad-alexander commented Jul 31, 2024

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

https://gist.github.com/brad-alexander/2de634b877b5a926874da0e377c8c4b8

panic when setting clickhouse sink endpoint (alias is host, same result with both) to a secret value. I don't NEED to do this, but it was kinda hard to figure out why it was failing. Docs around secrets are a bit sparse so I don't know if it is expected to be able to be interpolated from anywhere within the config. It works for username/password fields.

  • confirmed the secrets print as usual with no weird ascii misrepresentations to console
  • confirmed SECRET[...] string is in frame during the backtrace, so it did not get interpolated beforehand:
$ lldb vector
(lldb) image lookup -r -n UriSerde
...
   Address: vector[0x0000000101aab810] (vector.__TEXT.__text + 27953168)
   Summary: vector`_$LT$vector..sinks..util..uri..UriSerde$u20$as$u20$core..convert..From$LT$http..uri..Uri$GT$$GT$::from::h4f1432b97f06bda0
...
(lldb) breakpoint set --address 0x0000000101aab810
(lldb) run -c test_vector.yaml
...
    frame #0: 0x0000000101aab810 vector`_$LT$vector..sinks..util..uri..UriSerde$u20$as$u20$core..convert..From$LT$http..uri..Uri$GT$$GT$::from::h4f1432b97f06bda0
vector`_$LT$vector..sinks..util..uri..UriSerde$u20$as$u20$core..convert..From$LT$http..uri..Uri$GT$$GT$::from::h4f1432b97f06bda0:
->  0x101aab810 <+0>: pushq  %rbp
    0x101aab811 <+1>: movq   %rsp, %rbp
    0x101aab814 <+4>: pushq  %r15
    0x101aab816 <+6>: pushq  %r14
    0x101aab818 <+8>:  pushq  %r13
    0x101aab81a <+10>: pushq  %r12
(lldb) memory read -s1 -fa -c64 `$r13`
0x107220960: SECRET[aws_vector.clickhouse_xxxxxxx
0x107220980: x_endpoint]\x02\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0

Configuration

secret:
  aws_vector:
    type: aws_secrets_manager
    secret_id: "asdf/vector"
sinks:
  clickhouse_sink:
    type: clickhouse
    host: "SECRET[aws_vector.clickhouse_xxxxxxxx_endpoint]"

Version

vector 0.40.0 (x86_64-apple-darwin 1167aa9 2024-07-29 15:08:44.028365803)

Debug Output

2024-07-31T01:45:17.584387Z  INFO vector::app: Log level is enabled. level="info"
2024-07-31T01:45:17.585473Z  INFO vector::app: Loading configs. paths=["test_vector.yaml"]
thread 'main' panicked at src/sinks/util/uri.rs:122:69:
invalid authority: InvalidDomainCharacter
stack backtrace:
   0:        0x1037b3c53 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf34041a79b0bf389
   1:        0x102c6742b - core::fmt::write::h724b66e8a9bcc71b
   2:        0x1037799fe - std::io::Write::write_fmt::ha4c4ed48db6e34b0
   3:        0x1037b83f1 - std::sys_common::backtrace::print::h9c8d1fb40b38008e
   4:        0x1037b7ca9 - std::panicking::default_hook::{{closure}}::h5bdf2bea39c58742
   5:        0x1037b7863 - std::panicking::default_hook::h2e86e89966b730bf
   6:        0x1037b896d - std::panicking::rust_panic_with_hook::hf4f242bc14be62e8
   7:        0x1037b8732 - std::panicking::begin_panic_handler::{{closure}}::h57270f44af65f655
   8:        0x1037b8689 - std::sys_common::backtrace::__rust_end_short_backtrace::h5ce52ac6cffcaee8
   9:        0x1037b8676 - _rust_begin_unwind
  10:        0x1070844a2 - core::panicking::panic_fmt::h72f2c0a769dd0f27
  11:        0x107084945 - core::result::unwrap_failed::h2b3c0be7c893eb84
  12:        0x103f3cef8 - <vector::sinks::util::uri::UriSerde as core::convert::From<http::uri::Uri>>::from::h4f1432b97f06bda0
  13:        0x103fff6ad - <vector::sinks::util::uri::UriSerde as core::convert::TryFrom<alloc::string::String>>::try_from::h128d1f801fa31cbd
  14:        0x103fff15e - <erased_serde::de::erase::DeserializeSeed<T> as erased_serde::de::DeserializeSeed>::erased_deserialize_seed::h0577c656ea270056
  15:        0x1059dfb74 - <erased_serde::de::erase::MapAccess<T> as erased_serde::de::MapAccess>::erased_next_value::h0c2cf06c95a950a4
  16:        0x103ff05b6 - <erased_serde::de::erase::Visitor<T> as erased_serde::de::Visitor>::erased_visit_map::hecbdba834603b486
  17:        0x1059df255 - typetag::content::visit_content_map::h90bc0ea5515e571e
  18:        0x1059db532 - <erased_serde::de::erase::Deserializer<T> as erased_serde::de::Deserializer>::erased_deserialize_struct::hfe5fcddc5181ffd4
  19:        0x103fc6c65 - core::ops::function::FnOnce::call_once::hfefd96f4c0c97c75
  20:        0x1059d2266 - <vector::config::sink::_::<impl serde::de::Deserialize for vector::config::sink::SinkOuter<T>>::deserialize::__Visitor<T> as serde::de::Visitor>::visit_map::h867ff4dbc1286d9f
  21:        0x10599e5ff - indexmap::serde::<impl serde::de::Deserialize for indexmap::map::IndexMap<K,V,S>>::deserialize::hf8e4ecffb4ad8efe
  22:        0x10598eedb - <vector::config::builder::_::<impl serde::de::Deserialize for vector::config::builder::ConfigBuilder>::deserialize::__Visitor as serde::de::Visitor>::visit_map::haa5a12b7719da515
  23:        0x10598ada1 - <vector::config::loading::config_builder::ConfigBuilderLoader as vector::config::loading::loader::process::Process>::merge::he61660a2af2da051
  24:        0x105957f62 - vector::config::loading::loader_from_paths::h6afaafa31dc09efb
  25:        0x105bb59bf - vector::config::init_log_schema::hc8f1909650680191
  26:        0x1061e3b51 - vector::app::ApplicationConfig::from_opts::{{closure}}::h58201554f12772d9
  27:        0x1061c8c4f - vector::app::Application::prepare_from_opts::h95aec8dec7d23a68
  28:        0x1060b6faf - vector::app::Application::run::h471bb4768e6e5110
  29:        0x102495cea - vector::main::hafc79d1d588c58f0
  30:        0x102494006 - std::sys_common::backtrace::__rust_begin_short_backtrace::h8ed4d4fad48f4c4a
  31:        0x102496967 - _main

Example Data

No response

Additional Context

No response

References

No response

@jszwedko
Copy link
Member

jszwedko commented Aug 1, 2024

Thanks for this report @brad-alexander . I opened #20985 to fix this bug.

@jszwedko jszwedko added the domain: config Anything related to configuring Vector label Aug 1, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 9, 2024
…secrets (#20985)

* fix(config): Avoid parsing configuration files without secrets

Which caused #20974

Reverts: #17759

Signed-off-by: Jesse Szwedko <[email protected]>

* Update configuration structs to default to log_schema fields after deserialization

Signed-off-by: Jesse Szwedko <[email protected]>

* Add changelog entry

Signed-off-by: Jesse Szwedko <[email protected]>

* Regenerate docs

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
frankh pushed a commit to frankh/vector that referenced this issue Aug 12, 2024
…secrets (vectordotdev#20985)

* fix(config): Avoid parsing configuration files without secrets

Which caused vectordotdev#20974

Reverts: vectordotdev#17759

Signed-off-by: Jesse Szwedko <[email protected]>

* Update configuration structs to default to log_schema fields after deserialization

Signed-off-by: Jesse Szwedko <[email protected]>

* Add changelog entry

Signed-off-by: Jesse Szwedko <[email protected]>

* Regenerate docs

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
ym pushed a commit to ym/vector that referenced this issue Aug 18, 2024
…secrets (vectordotdev#20985)

* fix(config): Avoid parsing configuration files without secrets

Which caused vectordotdev#20974

Reverts: vectordotdev#17759

Signed-off-by: Jesse Szwedko <[email protected]>

* Update configuration structs to default to log_schema fields after deserialization

Signed-off-by: Jesse Szwedko <[email protected]>

* Add changelog entry

Signed-off-by: Jesse Szwedko <[email protected]>

* Regenerate docs

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
AndrooTheChen pushed a commit to discord/vector that referenced this issue Sep 23, 2024
…secrets (vectordotdev#20985)

* fix(config): Avoid parsing configuration files without secrets

Which caused vectordotdev#20974

Reverts: vectordotdev#17759

Signed-off-by: Jesse Szwedko <[email protected]>

* Update configuration structs to default to log_schema fields after deserialization

Signed-off-by: Jesse Szwedko <[email protected]>

* Add changelog entry

Signed-off-by: Jesse Szwedko <[email protected]>

* Regenerate docs

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: config Anything related to configuring Vector type: bug A code related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants