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

Step 12 (Pactflow) Error when executing Pact verifier (even without broker) #92

Open
sngnw opened this issue Nov 6, 2022 · 2 comments

Comments

@sngnw
Copy link

sngnw commented Nov 6, 2022

I encountered a handful of broken changes in each "step branches" following the JS workshop but managed to get around/fix most of them by googling. When I get to Step 12, I was dealing with SSL error publishing to Pactlow. Spent the entire day googling, generating cert, setting 'SSL_CERT_FILE' environment var - without much luck. l finally gave up and set 'PACT_DISABLE_SSL_VERIFICATION = true'. I was able to publish PACT to pactflow.

However, when I run 'npm run test:pact --prefix provider ' to execute PACT verifier, I started getting the error below.

thread '' panicked at 'Client::new(): reqwest::Error { kind: Builder, source: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', C:\Users\runneradmin.cargo\registry\src\github.com-1ecc6299db9ec823\reqwest-0.11.11\src\async_impl\client.r FAIL product/product.pact.test.js

I have never seen before prior to Step 12. I even updated the configuration to use local PACT file instead of broker and still getting the same error.

Note: Provider verifies with local Pact was working prior to Step 12.

Please help!

ERROR Message

See attached error

Or below:

npm run test:pact --prefix provider

[email protected] test:pact
npx jest --testTimeout 30000 --testMatch "**/product/product.pact.test.js" --verbose

RUNS product/product.pact.test.js
2022-11-06T02:32:11.435005Z WARN ThreadId(09) pact_matching::metrics:

Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.

thread '' panicked at 'Client::new(): reqwest::Error { kind: Builder, source: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', C:\Users\runneradmin.cargo\registry\src\github.com-1ecc6299db9ec823\reqwest-0.11.11\src\async_impl\client.r FAIL product/product.pact.test.js
Pact Verification
× validates the expectations of ProductService (31ms)

● Pact Verification › validates the expectations of ProductService

Verfication failed

  at node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:50:20

[2022-11-06 02:32:11.415 +0000] INFO (4036 on NWLPT597): [email protected]: Verifying provider
[2022-11-06 02:32:11.426 +0000] INFO (4036 on NWLPT597): [email protected]: Verifying Pacts.
[2022-11-06 02:32:11.428 +0000] INFO (4036 on NWLPT597): [email protected]: Verifying Pact Files
[2022-11-06 02:32:11.438 +0000] ERROR (4036 on NWLPT597): [email protected]: Verification unsuccessful
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 5.275s, estimated 6s
Ran all test suites.

provider\product\product.pact.test.js

See attached JS (renamed as txt): product.pact.test.js.txt

consumer\pacts\FrontendWebsite-ProductService.json

See attached JSON (renamed as txt): FrontendWebsite-ProductService.json.txt

@sngnw sngnw changed the title Step 12 (Pactflow) Error and executing Pact verifier Step 12 (Pactflow) Error when executing Pact verifier (even without broker) Nov 6, 2022
@mefellows
Copy link
Member

Hmm very strange. Could you please set the log level to DEBUG and share the log file?

I suspect it's a Windows related issue. I haven't properly tested on Windows, so there are likely dragons to be found there.

Are you running this on a personal or work machine? Most SSL issues I see relate to corporate networks/proxy configurations, or older machines that don't have up-to-date CA bundles.

@sngnw
Copy link
Author

sngnw commented Nov 6, 2022

Hi @mefellows,

Thanks for your reply.

To answer your question, I'm using my work laptop and it's running Windows 10 Enterprise. It is connected behind corporate networks/proxy configuration. I'm planning to work with our security guy from work on the SSL issue next week. For the time being, I'm able to move on with 'PACT_DISABLE_SSL_VERIFICATION = true'.

Follow up to your comment about CA bundles, I have downloaded the chain cert following Connecting to a Pact Broker running over TLS and set "SSL_CERT_FILE" per pactflow_require_https

In regards to the Pact Verifier issue, here is the Log per request.

PS C:\Shared\pact-workshop-js> npm run test:pact --prefix provider

[email protected] test:pact
npx jest --testTimeout 30000 --testMatch "**/product/product.pact.test.js" --verbose

2022-11-06T04:30:11.832002Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
core/content-generator/json
core/content-matcher/json
core/content-matcher/multipart-form-data
core/content-matcher/text
core/content-matcher/xml

RUNS product/product.pact.test.js
2022-11-06T04:30:11.832460Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/matcher/v1-equality
core/matcher/v2-max-type
core/matcher/v2-min-type
core/matcher/v2-minmax-type
core/matcher/v2-regex
core/matcher/v2-type
core/matcher/v3-content-type
core/matcher/v3-date
core/matcher/v3-datetime
core/matcher/v3-decimal-type
core/matcher/v3-includes
core/matcher/v3-integer-type
core/matcher/v3-null
core/matcher/v3-number-type
core/matcher/v3-time
core/matcher/v4-array-contains
core/matcher/v4-equals-ignore-order
core/matcher/v4-max-equals-ignore-order
core/matcher/v4-min-equals-ignore-order
core/matcher/v4-minmax-equals-ignore-order
core/matcher/v4-not-empty
core/matcher/v4-semver
2022-11-06T04:30:11.839072Z INFO ThreadId(01) pact_verifier: Not publishing results as publishing for pact source File("C:\Shared\pact-workshop-js\consumer\pacts\frontendwebsite-productservice.json") is not possible or not yet implemented
2022-11-06T04:30:11.839456Z WARN ThreadId(01) pact_matching::metrics:

Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.

2022-11-06T04:30:11.840476Z DEBUG ThreadId(01) pact_matching::metrics: Sending event to GA - {"ea": "Completed", "cd7": "0.12.12", "aid": "pact-core", "tid": "UA-117778936-1", "cid": "0edd2e019a2a470cf830401feff2a1dc", "ec": "ProviderTest", "an": "pact-core", "t": "event", "aip": "true", "cd2": "unknown", "el": "Pacts verified", "av": "13.7.8", "cd3": "windows-x86_64", "ds": "client", "v": "1", "ev": "5", "cd6": "pact_ffi"}
thread '' panicked at 'Client::new(): reqwest::Error { kind: Builder, source: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', C:\Users\runneradmin.cargo\registry\src\github.com-1ecc6299db9ec823\reqwest-0.11.11\src\async_impl\client.r FAIL product/product.pact.test.js (5.221s)
Pact Verification
× validates the expectations of ProductService (51ms)

● Pact Verification › validates the expectations of ProductService

Verfication failed

  at node_modules/@pact-foundation/pact-core/src/verifier/nativeVerifier.ts:50:20

[2022-11-06 04:30:11.804 +0000] INFO (4764 on NWLPT597): [email protected]: Verifying provider
[2022-11-06 04:30:11.820 +0000] INFO (4764 on NWLPT597): [email protected]: Verifying Pacts.
[2022-11-06 04:30:11.822 +0000] INFO (4764 on NWLPT597): [email protected]: Verifying Pact Files
[2022-11-06 04:30:11.822 +0000] DEBUG (4764 on NWLPT597): [email protected]: Initalising native core at log level 'DEBUG'
[2022-11-06 04:30:11.824 +0000] DEBUG (4764 on NWLPT597): [email protected]: the optional ffi function '2' was not executed as it had non-fatal validation errors:
[2022-11-06 04:30:11.825 +0000] DEBUG (4764 on NWLPT597): [email protected]: the optional ffi function '6' was not executed as it had non-fatal validation errors:
[2022-11-06 04:30:11.826 +0000] DEBUG (4764 on NWLPT597): [email protected]: the optional ffi function '7' was not executed as it had non-fatal validation errors:
[2022-11-06 04:30:11.827 +0000] DEBUG (4764 on NWLPT597): [email protected]: checking source type of given pactUrl: C:\Shared\pact-workshop-js\consumer\pacts\frontendwebsite-productservice.json
[2022-11-06 04:30:11.827 +0000] DEBUG (4764 on NWLPT597): [email protected]: adding C:\Shared\pact-workshop-js\consumer\pacts\frontendwebsite-productservice.json as File source
[2022-11-06 04:30:11.828 +0000] DEBUG (4764 on NWLPT597): [email protected]: the optional ffi function '9' was not executed as it had non-fatal validation errors:
[2022-11-06 04:30:11.845 +0000] DEBUG (4764 on NWLPT597): [email protected]: shutting down verifier with handle 0
[2022-11-06 04:30:11.845 +0000] DEBUG (4764 on NWLPT597): [email protected]: response from verifier: null, 1
[2022-11-06 04:30:11.846 +0000] ERROR (4764 on NWLPT597): [email protected]: Verification unsuccessful
Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 6.781s
Ran all test suites.

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