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

ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1 #408

Closed
4 of 5 tasks
rawrew opened this issue Mar 22, 2024 · 10 comments · Fixed by #409
Closed
4 of 5 tasks
Labels
awaiting feedback Awaiting Feedback from OP bug Indicates an unexpected problem or unintended behavior

Comments

@rawrew
Copy link

rawrew commented Mar 22, 2024

Software versions

  • OS: Win 11
  • Consumer Pact library: Pact JS v12.1.3
  • Node Version: v20.11.0

Issue Checklist

Please confirm the following:

  • I have upgraded to the latest
  • I have the read the FAQs in the Readme
  • I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

No errors

Actual behaviour

Multiple error messages like:
ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1

Steps to reproduce

  1. git clone https://github.com/pact-foundation/pact-js.git

  2. Open ./pact-js/examples/typescript/package.json and change
    "@pact-foundation/pact": "file:../../dist/",
    to
    "@pact-foundation/pact": "^12.1.3",
    or
    "@pact-foundation/pact": "^12.3.0",
    (it started showing this errors starting 12.1.3)

  3. From ./pact-js/examples/typescript/
    run npm install

  4. Open ./pact-js/examples/typescript/test/get-dog.spec.ts
    Change log level to 'error' and add pactfileWriteMode: 'merge' into Pact configuration:

 const provider = new Pact({
    // .. leave as is
    logLevel: 'error',
    pactfileWriteMode: 'merge'
  });

  1. From ./pact-js/examples/typescript run:
    npm run test

  2. See error messages in console

Thank you

@rawrew rawrew added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Mar 22, 2024
@mefellows
Copy link
Member

hmm I've tried on the latest version, file:../../dist/ and specifically 12.1.3 and they all pass.

I'd suggest providing a Minimal, Reproducible Example from this this template that's already hooked up to CI.

Make it fail with the error you have, and then we can fix it.

@mefellows mefellows added awaiting feedback Awaiting Feedback from OP and removed triage This issue is yet to be triaged by a maintainer labels Mar 25, 2024
@rawrew
Copy link
Author

rawrew commented Mar 25, 2024

Hi @mefellows thank you for checking this. That's rather strange. I did reproduce this on another windows PC which even did not have Node before that.
Furthermore, I see the same error just by running template you provided with only this change:
"@pact-foundation/pact": "^12.0.0",
-->
"@pact-foundation/pact": "12.4.0",

image

But, I'm terribly sorry, that I was not clear enough - tests are indeed passing. Its just whole log is with those errors(we have a lot pacts :) )

@cahrens
Copy link

cahrens commented Mar 25, 2024

We are seeing this also.

@mefellows
Copy link
Member

Can you both please share the output of this:

npm list @pact-foundation/pact-core

@mefellows
Copy link
Member

I believe it's this line of code that's firing: https://github.com/pact-foundation/pact-reference/blame/712bc797ecbd3bbf843c1d6ae97b57d2981f5cbb/rust/pact_ffi/src/mock_server/handles.rs#L1003

It's been updated to a warn in the latest code: https://github.com/pact-foundation/pact-reference/blame/1a85d2240cc17b2f682191df14fd131a316b0578/rust/pact_ffi/src/mock_server/handles.rs#L1056

This function is called on essentially every place that can have a matcher, and if no matcher is given (e.g. it's just a string) I think the warning is printed. That might be overly excitable.

TL;DR - I don't think it's actually a problem, but would be good to know if you're tests are still behaving as you'd expect.

@sofiasedlova
Copy link

Facing the same problem, posting the output too

Can you both please share the output of this: `npm list @pact-foundation/pact-core

└─ @pact-foundation/[email protected]
  └── @pact-foundation/[email protected]

@cahrens
Copy link

cahrens commented Mar 26, 2024

Yes, the tests pass… there is just noise in the logs that cause confusion (we have many developers working in this repo).

So it sounds like we should update our version of pact when the next release is out?

roberts@wm365-d20 terra-ui % yarn why @pact-foundation/pact-core
└─ @pact-foundation/pact@npm:12.1.1
   └─ @pact-foundation/pact-core@npm:14.2.0 (via npm:^14.0.1)

@mefellows
Copy link
Member

Thanks folks - I think when we release the next version of the core (that pulls in the linked code above) this would change to a warn.

@uglyog is warn an appropriate log level here? Given the high chance of that function being called with a pure string argument (i.e. no matches, for something like the HTTP path) should it perhaps be a DEBUG?

@sergeyklay
Copy link
Member

Hello everyone! We are experiencing a multitude of log entries like the ones below on our CI and locally across all developers. We would like to know if there's something we need to fix (what and where?), or if these are merely debug logs. If it's the second, we would appreciate guidance on how to disable them. Please keep us updated about any changes regarding this issue. Also, 'just ignore them, even if you get a thousand in your CI report' isn't a strategy we'd prefer to follow. :)

2024-04-16T14:22:11.119287Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1
2024-04-16T14:22:11.121988Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1
2024-04-16T14:22:11.123592Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1
2024-04-16T14:22:11.128103Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1
2024-04-16T14:22:11.128180Z ERROR ThreadId(01) pact_ffi::mock_server::handles: Failed to parse the value: expected value at line 1 column 1

@mefellows
Copy link
Member

As per above, these are not errors and can be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting Feedback from OP bug Indicates an unexpected problem or unintended behavior
Projects
None yet
5 participants