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

No output due to EINVAL on Windows #503

Closed
5 tasks done
timvahlbrock opened this issue May 6, 2024 · 1 comment · Fixed by #504
Closed
5 tasks done

No output due to EINVAL on Windows #503

timvahlbrock opened this issue May 6, 2024 · 1 comment · Fixed by #504
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@timvahlbrock
Copy link
Contributor

Thank you for reporting a bug! We appreciate it very much. Issues are a big input into the priorities for Pact development

All italic text in this template is safe to remove before submitting

Thanks again!

Software versions

Please provide at least OS and version of pact-js

  • OS: Win 11
  • Pact Node version: 14.3.4
  • Node Version: 20.12.2
  • Other Versions: none

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
  • 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

There is output on Windows.

Actual behaviour

There is no output on Windows.

Steps to reproduce

Have pact-js-core installed either locally or globally and run any command. There is no output, but calling the .bat files directly works fine. Debugging reveals that the child process spawn fails, with EINVAL. As described here Node no longer allows calling of .bat and .cmd files for security reasons. As the input to child process spawn in this project always is sanitized, the fix described in the mentioned Node CVE Report can be safely used to fix this.

Relevant log files

error: Error: spawnSync T:\he\path\to\my\project\node_modules\@pact-foundation\pact-core\standalone\windows-x64-2.4.2\pact\bin\pact-broker.bat EINVAL
      at Object.spawnSync (node:internal/child_process:1124:20)
      at Object.spawnSync (node:child_process:876:24)
      at Object.<anonymous> (T:\he\path\to\my\project\node_modules\@pact-foundation\pact-core\bin\pact-broker.js:9:29)
      at Module._compile (node:internal/modules/cjs/loader:1369:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
      at Module.load (node:internal/modules/cjs/loader:1206:32)
      at Module._load (node:internal/modules/cjs/loader:1022:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
      at node:internal/main/run_main_module:28:49
@timvahlbrock timvahlbrock added the bug Indicates an unexpected problem or unintended behavior label May 6, 2024
@YOU54F
Copy link
Member

YOU54F commented May 8, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants