Closed mattstankey closed 2 years ago
That's very strange. I don't have a Windows machine, so could you create a git repo of just that code so that I can run it on appveyor?
This could be related to the long pathing issue. @mattstankey can you reduce the path length of your project and see if it works? If it doesn't, could you recreate a small demo project and put it somewhere for me to try on my machine? Thanks.
I can confirm that this issue is related to the long path limitation of windows. Feel free to fix it on windows by setting the appropriate registry key.
Yes, after moving the project to C;/[project_name] it does work for me. It looks like this is an issue with Windows 10 path length. I'm not sure if it is specifically related to Ruby or not, but it doesn't seem to be related to pact-node.
Thanks!
@mattstankey did you see my solution above?
I imagine this is a limitation of Ruby in Windows 10 with long path support. I don't know what you need to overcome this since MS doesn't have this limitation anymore. However, it is opt-in, even on more current builds.
Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior.
MSDN Article
https://bugs.ruby-lang.org/issues/12551 https://bugs.ruby-lang.org/issues/14631
I can confirm that this is still an issue with https://github.com/pact-foundation/pact-node/blob/master/README.md#enable-long-paths enabled and moving this to a shorter directory path like like a root drive like /c/myapp or /d/myapp the problem goes away. Python 3.x and Node for example seem to work fine with long paths on windows when you have opted in of course.
I hope this helps.
@LeeGDavis Why would it be a ruby limitation if it only happens in Windows? I do believe the file access is done with C in ruby, hence it should be using the windows file api and should adhere to the long path solution.
@mboudreau I would say it is a limitation in Ruby based on its usage of the underlying c runtime. It is a relatively new thing vendors have started to support, I think mid 2016. My assumption is they haven't taken the steps necessary to fully implement whatever is needed to support long paths. I believe it has to do with how file names are referenced, so that different versions of the api are called that support long paths. It seems they know about the issue and I imagine someone in the community will tackle this.
Maybe, but I had enabled long paths on my windows box and found I couldn't go more than 260 characters, which is weird... Again, not sure if this is related, but trying to dig deeper into the horrible abyss that is Windows.
On Thu, Jul 19, 2018 at 1:28 PM Lee Davis notifications@github.com wrote:
@mboudreau https://github.com/mboudreau I would say it is a limitation in Ruby based on its usage of the underlying c runtime. It is a relatively new thing vendors have started to support, I think mid 2016. My assumption is they haven't taken the steps necessary to fully implement whatever is needed to support long paths. I believe it has to do with how file names are referenced, so that different versions of the api are called that support long paths. It seems they know about the issue and I imagine someone in the community will tackle this.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/pact-foundation/pact-node/issues/100#issuecomment-406143222, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjA5CRQijbqS3vFyyC8FJwNjr4MXuuzks5uH_zVgaJpZM4VNXmJ .
@mboudreau have a look at this issue https://bugs.ruby-lang.org/issues/12551. While I don't know if this is exactly representative of what is being observed here, I imagine it is related. They even reference the long path prefix \\?\
to cause the api to call into the unicode version of the api. I suppose one could always use WSL 😀
@LeeGDavis I might have found a solution, but dropping the binary files in the user's tmp directory, which should be a lot less long. Let me try it out and I'll release a new fix version and see if that helps you in your situation.
hey @LeeGDavis,
I think I may have a fix for you. https://github.com/pact-foundation/pact-node/pull/103
Maybe you'd want to pull the files, build and test it out. It should download the binaries to the temp directory, which should be a lot less long than your project path.
Cheers,
M
@LeeGDavis @mattstankey disregard my last comment, I've released a version, 6.19.8-rc
, if you could please update your dependencies to it and try it out to see if you hit the same issue. Cheers.
@mboudreau I can't seem to locate that version. Is there anything special I need to do to pull that down?
@LeeGDavis Sorry, seems like it had skipped the deployment, my bad. I redeployed it properly now, please try again.
@mboudreau Looks like this is still an issue, however this error looks different. I hope this stack trace helps:
[[37m2018-07-20T03:57:49.425Z[39m] [36m INFO[39m: pact-node@6.19.8-rc/4256 on COMPUTERNAME: [36mVerifying Pacts.[39m
[[37m2018-07-20T03:57:49.428Z[39m] [36m INFO[39m: pact-node@6.19.8-rc/4256 on COMPUTERNAME: [36mVerifying Pact Files[39m
[[37m2018-07-20T03:57:49.437Z[39m] [36m INFO[39m: pact-node@6.19.8-rc/4256 on COMPUTERNAME: [36mCreated 'win32-1.52.2\bin\pact-provider-verifier.bat '/Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json' --provider-base-url 'http://localhost:4000' --custom-provider-header 'Authorization: Bearer 123'' process with PID: 11904[39m
[[37m2018-07-20T03:57:50.482Z[39m] [35m WARN[39m: pact-node@6.19.8-rc/4256 on COMPUTERNAME: [36mPact exited with code 1.[39m
F
Failures:
1) Enforcing contract tests Fullfills testing contracts with the web UI consumer
Message:
Expected Error: Error reading file from /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json
No such file or directory @ rb_sysopen - /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `read'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `get_local'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:39:in `render_pact'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:22:in `read'
C:/Users/sco ... not to be truthy.
Stack:
Error: Expected Error: Error reading file from /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json
at <Jasmine>
at verifyPacts.then.catch (D:\Projects\client\application-dir\long-application-name-service\spec\contract.pact.js:26:23)
at _rejected (D:\Projects\client\application-dir\long-application-name-service\node_modules\q\q.js:864:24)
at D:\Projects\client\application-dir\long-application-name-service\node_modules\q\q.js:890:30
at Promise.when (D:\Projects\client\application-dir\long-application-name-service\node_modules\q\q.js:1142:31)
1 spec, 1 failure
Finished in 1.073 seconds
Randomized with seed 33993 (jasmine --random=true --seed=33993)
]
Serverless: exec stderr: [-- error: Error: Error reading file from /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json
No such file or directory @ rb_sysopen - /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `read'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `get_local'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:39:in `render_pact'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:22:in `read'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_source.rb:14:in `pact_json'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `collect'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:33:in `run'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:60:in `run_with_pact_uri'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:21:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:14:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:111:in `verify_pact'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:29:in `block in call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `collect'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:22:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/verify.rb:27:in `verify'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/app/pact-provider-verifier.rb:33:in `<main>'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `read': No such file or directory @ rb_sysopen - /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json (Errno::ENOENT)
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `get_local'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:39:in `render_pact'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:22:in `read'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_source.rb:14:in `pact_json'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `collect'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:33:in `run'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:60:in `run_with_pact_uri'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:21:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:14:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:111:in `verify_pact'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:29:in `block in call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `collect'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:22:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/verify.rb:27:in `verify'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/app/pact-provider-verifier.rb:33:in `<main>'
at ChildProcess.<anonymous> (D:\Projects\client\application-dir\long-application-name-service\node_modules\@pact-foundation\pact-node\src\verifier.js:130:68)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:131:20)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
]
Serverless: Offline error executing script [Error: Command failed: cross-env IS_TEST=true ./node_modules/.bin/jasmine --config=./spec/support/contract.json
-- error: Error: Error reading file from /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json
No such file or directory @ rb_sysopen - /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `read'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `get_local'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:39:in `render_pact'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:22:in `read'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_source.rb:14:in `pact_json'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `collect'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:33:in `run'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:60:in `run_with_pact_uri'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:21:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:14:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:111:in `verify_pact'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:29:in `block in call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `collect'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:22:in `call'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/verify.rb:27:in `verify'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/app/pact-provider-verifier.rb:33:in `<main>'
C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `read': No such file or directory @ rb_sysopen - /Projects/client/application-dir/long-application-name-service/pacts/long_application_name_ui-long_application_name_api.json (Errno::ENOENT)
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:49:in `get_local'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:39:in `render_pact'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-support-1.6.4/lib/pact/consumer_contract/pact_file.rb:22:in `read'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_source.rb:14:in `pact_json'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `collect'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:115:in `pact_jsons'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:78:in `configure_rspec'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/provider/pact_spec_runner.rb:33:in `run'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:60:in `run_with_pact_uri'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:48:in `run_specs'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:21:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-1.28.0/lib/pact/cli/run_pact_verification.rb:14:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:111:in `verify_pact'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:29:in `block in call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `collect'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:28:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/app.rb:22:in `call'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/verify.rb:27:in `verify'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.15.0/lib/pact/provider_verifier/cli/custom_thor.rb:17:in `start'
from C:/Users/scoobydoo/AppData/Local/Temp/pact/win32-1.52.2/lib/app/pact-provider-verifier.rb:33:in `<main>'
at ChildProcess.<anonymous> (D:\Projects\client\application-dir\long-application-name-service\node_modules\@pact-foundation\pact-node\src\verifier.js:130:68)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:131:20)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
]
Serverless: Halting offline server
Okay, that's better. I means that the Pact binary is running, but now the binary is having issues opening the file that's more than 260 characters. We might be able to fix this.
@bethesque As per Microsoft's article, could you maybe have the binary prepend \\?\\
to windows files paths to enable long path support?
If the ruby code needs changing, I can do that, but I think you should be able to pass in the path with the right prefix?
@bethesque I can to just test it out, however, I think it should be fixed from the Ruby end since this particular issue would affect every language that uses it.
Fair point. See how it goes.
Hi, did anything ever happen re: the \\?\\
prefix? This is currently causing issues for my team, am trying to work out where to go from here
Try looking at the latest (beta) v3 branch for pact js (it won't have this issue) and also has support for v3 matchers and XML.
Pact node is not a dependency for the v3 parts of that code and should be 👌
EDIT: the v3 version can be obtained through npm, see https://github.com/pact-foundation/pact-js#pact-js-v3 for instructions.
Thanks for the suggestion @mefellows, pact js v3 isn't giving me this issue any more - but now the mock service is refusing connections!
(edit: testFn was missing a return statement. now getting an actual, workable test failure)
Thanks for the update - I wonder if we can check for the correct shape of the function and error better.
Hi All, I am also getting this error on windows machine. Is there a solution for this already? `require': cannot load such file -- pact/consumer/mock_service/cors_origin_header_middleware (LoadError)
The solution is described above @pulgupta
Closing as latest version removes Ruby and this issue.
Hi,
I am trying to test some service endpoints with Pact using Windows 10. I am getting a strange ruby error on the require statements on line 1 of the node_module packages when running ./node_modules/.bin/jasmine. The same tests run fine on a Mac, but throw the error stacktrace shown below on Windows. Here are the following details for the Pact libs:
Here is the test I am trying to run:
Error Stacktrace:
Please let me know if I need to add more information here.