Closed j3rrywan9 closed 1 year ago
The relevant versions of the packages you are using. The official pact-ref-verifier Docker image with tag 0.9.16: https://hub.docker.com/layers/pactfoundation/pact-ref-verifier/0.9.16/images/sha256-caf09b90140066410563eac2efd7a69f306ffb781befd2b81946aa92545ce0cc
pact-ref-verifier
0.9.16
The steps to recreate your issue. a) Start a container from the official image using Docker Compose
version: "3.7"
services: pact-verifier: container_name: verifier image: "pactfoundation/pact-ref-verifier:0.9.16" entrypoint: "cat" tty: true environment: PACT_BROKER_TOKEN: "[MY_PACKFLOW_TOKEN]" volumes:
b) Run the `pact_verifier_cli` with the `--filter-consumer` option
docker exec --env RUST_BACKTRACE=full -it verifier /usr/local/bin/pact_verifier_cli --filter-consumer modelling-environment-data-tool --scheme http --hostname "api-services" --port 8180 --base-path / --consumer-version-selectors '{"branch": "develop"}' --broker-url https://anaplan.pactflow.io --provider-name api-services --state-change-url http://state-service:8001/state --loglevel debug
c) The above command ends up with an error stack like the following
2022-09-22T00:00:36.529668Z DEBUG main pact_verifier_cli: Pact source to verify = PactBrokerWithDynamicConfiguration(https://anaplan.pactflow.io, provider_name='api-services', enable_ending=false, include_wip_since=None, provider_tags=[], provider_branch=None, consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: None, fallback_tag: None, latest: None, deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: Some("develop"), matching_branch: None }], auth=Token(Me3Q**)') thread 'main' panicked at 'Must use Arg::allow_invalid_utf8 with _os lookups at [hash: 2AFE180D94FE0B73]', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.20/src/parser/matches/arg_matches.rs:1795:13 stack backtrace: 0: 0x7f479fe7df5d - std::backtrace_rs::backtrace::libunwind::trace::hc5376e1f9e4c14fa at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7f479fe7df5d - std::backtrace_rs::backtrace::trace_unsynchronized::hd15c3fc9f4947abd at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f479fe7df5d - std::sys_common::backtrace::_print_fmt::ha8075890ce48b75c at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5 3: 0x7f479fe7df5d - ::fmt::hc0b18c49c3f409e9 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22 4: 0x7f479febf8ec - core::fmt::write::h5f97ce7fceb49c8e at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17 5: 0x7f479fe77621 - std::io::Write::write_fmt::h92643d786d6b0c5a at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15 6: 0x7f479fe7f8d5 - std::sys_common::backtrace::_print::hbcbdbbe490a4940a version "3.7" at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5 7: 0x7f479fe7f8d5 - std::sys_common::backtrace::print::h099f7bb689415e9c at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9 version "3.7" 8: 0x7f479fe7f8d5 - std::panicking::default_hook::{{closure}}::hb730f576b7ac56c9 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22 9: 0x7f479fe7f549 - std::panicking::default_hook::hed6832fe5378b865 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9 10: 0x7f479fe7fea8 - std::panicking::rust_panic_with_hook::h2727878cd2386357 version: "3.7" at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:698:17 11: 0x7f479fe7fd57 - std::panicking::begin_panic_handler::{{closure}}::hb832e69bd7fe3dc1 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:588:13 12: 0x7f479fe7e414 - std::sys_common::backtrace::rust_end_short_backtrace::h3509025fa7911dd3 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:138:18 13: 0x7f479fe7fa89 - rust_begin_unwind at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5 14: 0x7f479f45e493 - core::panicking::panic_fmt::h5d9da573c785c98d at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14 15: 0x7f479f47c2e9 - core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once::hcac4254539df2e41 16: 0x7f479f5634b7 - <alloc::vec::Vec as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h468164c7e6e492f3 17: 0x7f479f47b7c6 - clap::parser::matches::arg_matches::ArgMatches::values_of_lossy::h917dd39b89e6e2f8 18: 0x7f479f521206 - pact_verifier_cli::handle_cli::{{closure}}::h9fc9e0008ccae4c8 19: 0x7f479f50dc90 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h28868bb30bdec82a 20: 0x7f479f52545e - std::thread::local::LocalKey::with::h124f45d9ad1fe329 21: 0x7f479f48baaf - tokio::park::thread::CachedParkThread::block_on::hfd8cb9d3d9518660 22: 0x7f479f576144 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h401b495e3f485475 23: 0x7f479f538384 - pact_verifier_cli::main::habf490dd2502caa0 24: 0x7f479f495993 - std::sys_common::backtrace::rust_begin_short_backtrace::he4288a202a2193e6 25: 0x7f479f523969 - std::rt::lang_start::{{closure}}::hd151dd2965b17e4d 26: 0x7f479fe71a01 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h18fd15a330c116b9 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280:13 27: 0x7f479fe71a01 - std::panicking::try::do_call::he918a328b783a420 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40 28: 0x7f479fe71a01 - std::panicking::try::h88ecc043ee71c652 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19 29: 0x7f479fe71a01 - std::panic::catch_unwind::h074c8fe23976f009 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14 30: 0x7f479fe71a01 - std::rt::lang_start_internal::{{closure}}::he26a080dffc4764a at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:48 31: 0x7f479fe71a01 - std::panicking::try::do_call::hf9be9f327f382512 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40 32: 0x7f479fe71a01 - std::panicking::try::h163c4b2413cf9165 at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19 33: 0x7f479fe71a01 - std::panic::catch_unwind::h58a40b305e945d4e at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14 34: 0x7f479fe71a01 - std::rt::lang_start_internal::h183e60933887f95a at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:20 35: 0x7f479f5389a2 - main
Arg::allow_invalid_utf8
_os
[hash: 2AFE180D94FE0B73]
d) For comparison, I also tried - rerun the same command without the `--filter-consumer`, it works fine - switch to `0.9.12`, rerun the same command, it works fine - switch to `0.9.13`, rerun the same command, it panics with similar error stack
At this point, I believe the clap 3.x upgrade introduced in https://github.com/pact-foundation/pact-reference/commit/6117aa50f9b824695c240eabacfff64d75eff173 as part of the 0.9.13 release is the culprit.
clap
0.9.13
The relevant versions of the packages you are using. The official
pact-ref-verifier
Docker image with tag0.9.16
: https://hub.docker.com/layers/pactfoundation/pact-ref-verifier/0.9.16/images/sha256-caf09b90140066410563eac2efd7a69f306ffb781befd2b81946aa92545ce0ccThe steps to recreate your issue. a) Start a container from the official image using Docker Compose
services: pact-verifier: container_name: verifier image: "pactfoundation/pact-ref-verifier:0.9.16" entrypoint: "cat" tty: true environment: PACT_BROKER_TOKEN: "[MY_PACKFLOW_TOKEN]" volumes:
docker exec --env RUST_BACKTRACE=full -it verifier /usr/local/bin/pact_verifier_cli --filter-consumer modelling-environment-data-tool --scheme http --hostname "api-services" --port 8180 --base-path / --consumer-version-selectors '{"branch": "develop"}' --broker-url https://anaplan.pactflow.io --provider-name api-services --state-change-url http://state-service:8001/state --loglevel debug
2022-09-22T00:00:36.529668Z DEBUG main pact_verifier_cli: Pact source to verify = PactBrokerWithDynamicConfiguration(https://anaplan.pactflow.io, provider_name='api-services', enable_ending=false, include_wip_since=None, provider_tags=[], provider_branch=None, consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: None, fallback_tag: None, latest: None, deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: Some("develop"), matching_branch: None }], auth=Token(Me3Q**)') thread 'main' panicked at 'Must use::fmt::hc0b18c49c3f409e9
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:45:22
4: 0x7f479febf8ec - core::fmt::write::h5f97ce7fceb49c8e
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/fmt/mod.rs:1196:17
5: 0x7f479fe77621 - std::io::Write::write_fmt::h92643d786d6b0c5a
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/io/mod.rs:1654:15
6: 0x7f479fe7f8d5 - std::sys_common::backtrace::_print::hbcbdbbe490a4940a
version "3.7"
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:48:5
7: 0x7f479fe7f8d5 - std::sys_common::backtrace::print::h099f7bb689415e9c
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:35:9
version "3.7"
8: 0x7f479fe7f8d5 - std::panicking::default_hook::{{closure}}::hb730f576b7ac56c9
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:295:22
9: 0x7f479fe7f549 - std::panicking::default_hook::hed6832fe5378b865
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:314:9
10: 0x7f479fe7fea8 - std::panicking::rust_panic_with_hook::h2727878cd2386357
version: "3.7"
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:698:17
11: 0x7f479fe7fd57 - std::panicking::begin_panic_handler::{{closure}}::hb832e69bd7fe3dc1
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:588:13
12: 0x7f479fe7e414 - std::sys_common::backtrace::rust_end_short_backtrace::h3509025fa7911dd3
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:138:18
13: 0x7f479fe7fa89 - rust_begin_unwind
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:584:5
14: 0x7f479f45e493 - core::panicking::panic_fmt::h5d9da573c785c98d
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/panicking.rs:142:14
15: 0x7f479f47c2e9 - core::ops::function::impls::<impl core::ops::function::FnOnce for &mut F>::call_once::hcac4254539df2e41
16: 0x7f479f5634b7 - <alloc::vec::Vec as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h468164c7e6e492f3
17: 0x7f479f47b7c6 - clap::parser::matches::arg_matches::ArgMatches::values_of_lossy::h917dd39b89e6e2f8
18: 0x7f479f521206 - pact_verifier_cli::handle_cli::{{closure}}::h9fc9e0008ccae4c8
19: 0x7f479f50dc90 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h28868bb30bdec82a
20: 0x7f479f52545e - std::thread::local::LocalKey::with::h124f45d9ad1fe329
21: 0x7f479f48baaf - tokio::park::thread::CachedParkThread::block_on::hfd8cb9d3d9518660
22: 0x7f479f576144 - tokio::runtime::scheduler::multi_thread::MultiThread::block_on::h401b495e3f485475
23: 0x7f479f538384 - pact_verifier_cli::main::habf490dd2502caa0
24: 0x7f479f495993 - std::sys_common::backtrace:: rust_begin_short_backtrace::he4288a202a2193e6
25: 0x7f479f523969 - std::rt::lang_start::{{closure}}::hd151dd2965b17e4d
26: 0x7f479fe71a01 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h18fd15a330c116b9
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280:13
27: 0x7f479fe71a01 - std::panicking::try::do_call::he918a328b783a420
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
28: 0x7f479fe71a01 - std::panicking::try::h88ecc043ee71c652
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
29: 0x7f479fe71a01 - std::panic::catch_unwind::h074c8fe23976f009
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
30: 0x7f479fe71a01 - std::rt::lang_start_internal::{{closure}}::he26a080dffc4764a
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:48
31: 0x7f479fe71a01 - std::panicking::try::do_call::hf9be9f327f382512
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492:40
32: 0x7f479fe71a01 - std::panicking::try::h163c4b2413cf9165
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456:19
33: 0x7f479fe71a01 - std::panic::catch_unwind::h58a40b305e945d4e
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137:14
34: 0x7f479fe71a01 - std::rt::lang_start_internal::h183e60933887f95a
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128:20
35: 0x7f479f5389a2 - main
Arg::allow_invalid_utf8
with_os
lookups at[hash: 2AFE180D94FE0B73]
', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/clap-3.2.20/src/parser/matches/arg_matches.rs:1795:13 stack backtrace: 0: 0x7f479fe7df5d - std::backtrace_rs::backtrace::libunwind::trace::hc5376e1f9e4c14fa at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7f479fe7df5d - std::backtrace_rs::backtrace::trace_unsynchronized::hd15c3fc9f4947abd at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f479fe7df5d - std::sys_common::backtrace::_print_fmt::ha8075890ce48b75c at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/sys_common/backtrace.rs:66:5 3: 0x7f479fe7df5d -At this point, I believe the
clap
3.x upgrade introduced in https://github.com/pact-foundation/pact-reference/commit/6117aa50f9b824695c240eabacfff64d75eff173 as part of the0.9.13
release is the culprit.