Closed stepan-leibo closed 6 years ago
Another stack trace
[WARN] Unsupported specification version '3.0.0' found in the metadata in the pact file "\"PlatformTicketingClient-PlatformTicketingApp.json\"", will try load it as a V2 specification
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /checkout/src/liballoc/vec.rs:1555:10
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
at /checkout/src/libstd/sys_common/backtrace.rs:71
2: std::panicking::default_hook::{{closure}}
at /checkout/src/libstd/sys_common/backtrace.rs:60
at /checkout/src/libstd/panicking.rs:381
3: std::panicking::default_hook
at /checkout/src/libstd/panicking.rs:397
4: std::panicking::rust_panic_with_hook
at /checkout/src/libstd/panicking.rs:611
5: std::panicking::begin_panic
at /checkout/src/libstd/panicking.rs:572
6: std::panicking::begin_panic_fmt
at /checkout/src/libstd/panicking.rs:522
7: rust_begin_unwind
at /checkout/src/libstd/panicking.rs:498
8: core::panicking::panic_fmt
at /checkout/src/libcore/panicking.rs:71
9: core::panicking::panic_bounds_check
at /checkout/src/libcore/panicking.rs:58
10: <alloc::vec::Vec<T> as core::ops::index::Index<usize>>::index
at /checkout/src/liballoc/vec.rs:1555
11: pact_matching::models::matchingrules::MatchingRules::load_from_v2_map
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/matchingrules.rs:452
12: pact_matching::models::matchingrules::matchers_from_json
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/matchingrules.rs:526
13: pact_matching::models::Request::from_json
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:422
14: pact_matching::models::Interaction::from_json
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:672
15: pact_matching::models::parse_interactions::{{closure}}
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:779
16: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once
at /checkout/src/libcore/ops/function.rs:271
17: <core::option::Option<T>>::map
at /checkout/src/libcore/option.rs:398
18: <core::iter::Map<I, F> as core::iter::iterator::Iterator>::next
at /checkout/src/libcore/iter/mod.rs:1073
19: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::spec_extend
at /checkout/src/liballoc/vec.rs:1825
20: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
at /checkout/src/liballoc/vec.rs:1808
21: <alloc::vec::Vec<T> as core::iter::traits::FromIterator<T>>::from_iter
at /checkout/src/liballoc/vec.rs:1695
22: core::iter::iterator::Iterator::collect
at /checkout/src/libcore/iter/iterator.rs:1298
23: pact_matching::models::parse_interactions
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:778
24: pact_matching::models::Pact::from_json
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:845
25: pact_matching::models::Pact::read_pact
at /home/stepan/.cargo/registry/src/github.com-1ecc6299db9ec823/pact_matching-0.3.0/src/models/mod.rs:933
26: pact_stub_server::load_pacts::{{closure}}
at src/main.rs:173
27: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &'a mut F>::call_once
at /checkout/src/libcore/ops/function.rs:271
28: <core::option::Option<T>>::map
at /checkout/src/libcore/option.rs:398
29: <core::iter::FlatMap<I, U, F> as core::iter::iterator::Iterator>::next
at /checkout/src/libcore/iter/mod.rs:1888
30: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T, I>>::from_iter
at /checkout/src/liballoc/vec.rs:1782
31: <alloc::vec::Vec<T> as core::iter::traits::FromIterator<T>>::from_iter
at /checkout/src/liballoc/vec.rs:1695
32: core::iter::iterator::Iterator::collect
at /checkout/src/libcore/iter/iterator.rs:1298
33: pact_stub_server::load_pacts
at src/main.rs:171
34: pact_stub_server::handle_command_args
at src/main.rs:353
35: pact_stub_server::main
at src/main.rs:97
36: __rust_maybe_catch_panic
at /checkout/src/libpanic_unwind/lib.rs:99
37: std::rt::lang_start
at /checkout/src/libstd/panicking.rs:459
at /checkout/src/libstd/panic.rs:361
at /checkout/src/libstd/rt.rs:61
38: main
39: __libc_start_main
40: _start
Could your meta data inside the pact be off? The error is saying that you have version 3 specified.
Thank you @stones I switched to version 2 of pact.
Also I had to build 2 different version of pact-stub-server executable - one for mac and the second for linux to make it work.
I've got the following exception on running pact on Ubuntu machine
It works perfectly fine on MacOS