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

ci.jenkins.io failing with windows build & parcel node packager #3105

Closed
jgreffe opened this issue Aug 23, 2022 · 10 comments
Closed

ci.jenkins.io failing with windows build & parcel node packager #3105

jgreffe opened this issue Aug 23, 2022 · 10 comments

Comments

@jgreffe
Copy link

jgreffe commented Aug 23, 2022

Service(s)

ci.jenkins.io

Summary

When building this plugin: https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fpipeline-stage-view-plugin/detail/PR-240/2/pipeline/92/

windows build fails when processing node with parcel packager:

[2022-08-19T13:53:12.412Z] [INFO] --- frontend-maven-plugin:1.12.1:npm (npm mvnbuild) @ pipeline-stage-view ---
[2022-08-19T13:53:12.412Z] [INFO] testFailureIgnore property is ignored in non test phases
[2022-08-19T13:53:12.412Z] [INFO] Running 'npm run mvnbuild' in C:\Jenkins\workspace\ipeline-stage-view-plugin_PR-240\ui
[2022-08-19T13:53:12.412Z] [INFO] 
[2022-08-19T13:53:12.412Z] [INFO] > [email protected] mvnbuild
[2022-08-19T13:53:12.412Z] [INFO] > parcel build --public-url ./ ./src/main/js/stageview.js --dist-dir ./src/main/webapp/jsmodules && parcel build --public-url ./ ./src/main/js/stageview_adjunct.js --dist-dir ./target/generated-adjuncts/org/jenkinsci/pipeline
[2022-08-19T13:53:12.412Z] [INFO] 
[2022-08-19T13:53:12.412Z] [INFO] Error: The specified module could not be found.
[2022-08-19T13:53:12.412Z] [INFO] \\?\C:\Jenkins\workspace\ipeline-stage-view-plugin_PR-240\ui\node_modules\@parcel\source-map\parcel_sourcemap_node\artifacts\index.win32-x64-msvc.node
[2022-08-19T13:53:12.412Z] [INFO]     at Module._extensions..node (node:internal/modules/cjs/loader:1204:18)
[2022-08-19T13:53:12.412Z] [INFO]     at Module.load (node:internal/modules/cjs/loader:998:32)
[2022-08-19T13:53:12.412Z] [INFO]     at Module._load (node:internal/modules/cjs/loader:839:12)
[2022-08-19T13:53:12.412Z] [INFO]     at Module.require (node:internal/modules/cjs/loader:1022:19)
[2022-08-19T13:53:12.412Z] [INFO]     at require (C:\Jenkins\workspace\ipeline-stage-view-plugin_PR-240\ui\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
[2022-08-19T13:53:12.412Z] [INFO]     at Object.<anonymous> (C:\Jenkins\workspace\ipeline-stage-view-plugin_PR-240\ui\node_modules\@parcel\source-map\parcel_sourcemap_node\index.js:15:18)
[2022-08-19T13:53:12.412Z] [INFO]     at Module._compile (C:\Jenkins\workspace\ipeline-stage-view-plugin_PR-240\ui\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
[2022-08-19T13:53:12.412Z] [INFO]     at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
[2022-08-19T13:53:12.412Z] [INFO]     at Module.load (node:internal/modules/cjs/loader:998:32)
[2022-08-19T13:53:12.412Z] [INFO]     at Module._load (node:internal/modules/cjs/loader:839:12) {
[2022-08-19T13:53:12.412Z] [INFO]   code: 'ERR_DLOPEN_FAILED'
[2022-08-19T13:53:12.412Z] [INFO] }

Same repository built on a bare windows 10 machine succeeds.

Could be related to windows image used:

[2022-08-19T13:44:58.210Z] Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
[2022-08-19T13:44:58.210Z] Maven home: C:\ProgramData\Maven
[2022-08-19T13:44:58.210Z] Java version: 1.8.0_312, vendor: Temurin, runtime: C:\openjdk-8\jre
[2022-08-19T13:44:58.210Z] Default locale: en_US, platform encoding: Cp1252
[2022-08-19T13:44:58.489Z] OS name: "windows server 2019", version: "10.0", arch: "amd64", family: "windows"

Suggested fix is to set useContainerAgent to false in Jenkinsfile:

buildPlugin(useContainerAgent: false, configurations: [
  [ platform: "linux", jdk: "8" ],
  [ platform: "windows", jdk: "8" ],
  [ platform: "linux", jdk: "11" ]
])

Reproduction steps

No response

@jgreffe jgreffe added the triage Incoming issues that need review label Aug 23, 2022
@lemeurherve
Copy link
Member

lemeurherve commented Aug 23, 2022

Comparing this PR with the next one which is passing, the main difference seems to be the use of parcel in the plugin now.
I'm wondering if parcel should be added to the agent tools, I'll open a PR to check it.

@jgreffe
Copy link
Author

jgreffe commented Aug 23, 2022

Not sure parcel should be added, because it's installed through npm install --silent (it's an npm dependency).
I feel issue is related to index.win32-x64-msvc.node, maybe some missing DLL or other optional library not installed on the agent (?)
I found a similar issue (about fs-search), and seems linked to MS Visual C++: parcel-bundler/parcel#7104 (comment)

Also, using buildPlugin(useContainerAgent: false, configurations: [ leads to same issue, and windows seems the same:

[2022-08-23T14:23:43.165Z] Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
[2022-08-23T14:23:43.165Z] Maven home: C:\ProgramData\Maven
[2022-08-23T14:23:43.165Z] Java version: 1.8.0_312, vendor: Temurin, runtime: C:\openjdk-8\jre
[2022-08-23T14:23:43.165Z] Default locale: en_US, platform encoding: Cp1252
[2022-08-23T14:23:43.165Z] OS name: "windows server 2019", version: "10.0", arch: "amd64", family: "windows"

https://github.com/jenkinsci/pipeline-stage-view-plugin/pull/240/files#diff-e6ffa5dc854b843b3ee3c3c28f8eae2f436c2df2b1ca299cca1fa5982e390cf8
https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fpipeline-stage-view-plugin/detail/PR-240/6/pipeline

lemeurherve added a commit to jenkins-infra/packer-images that referenced this issue Aug 23, 2022
@lemeurherve lemeurherve self-assigned this Aug 23, 2022
@lemeurherve lemeurherve removed the triage Incoming issues that need review label Aug 23, 2022
dduportal pushed a commit to jenkins-infra/packer-images that referenced this issue Aug 23, 2022
…mplate (#322)

fix: add Microsoft Visual C++ 2015 Redistributable  

Needed for `parcel` (npm tool)

Ref: jenkins-infra/helpdesk#3105
@dduportal dduportal added this to the infra-team-sync-2022-08-30 milestone Aug 23, 2022
@lemeurherve
Copy link
Member

lemeurherve commented Aug 24, 2022

Also, using buildPlugin(useContainerAgent: false, configurations: [ leads to same issue, and windows seems the same:

This is normal. Since you don't have the required rights, you can't use modification made to Jenkinsfile for a pull request build as it would allow bad things™

10:35:05  Connecting to https://api.github.com to check permissions of obtain list of jgreffe for jenkinsci/pipeline-stage-view-plugin
10:35:05  Loading trusted files from base branch master at 341bbdb77b1c39c076c8c15e82be490e0839de37 rather than 328c815cc40c3d2e61da31eba127028520c1da09
10:35:05  Obtained Jenkinsfile from 341bbdb77b1c39c076c8c15e82be490e0839de37
10:35:05  ‘Jenkinsfile’ has been modified in an untrusted revision

@jgreffe I've replayed your build with useContainer: false, it finished with success, you're good to go for your PR 🙂

Unfortunately (for me), as I missed that permission issue before adding Microsoft Visual C++ 2015 Redistributable to the Windows packer image, I'm not sure its addition was required.

@dduportal WDYT? Should I try to revert the template to check if only useContainer: false is enough, or should I let it as it is?

@jgreffe
Copy link
Author

jgreffe commented Aug 24, 2022

@lemeurherve : yeepee!! 🎉

This means we'll have to ask you to trigger builds whenever we change this useContainer: false in any repository?

BTW, we have the exact same issue for this PR:
https://github.com/cloudbees/cloudbees-workflow-ui-plugin/pull/22
https://gauntlet-3.cloudbees.com/gaia/blue/organizations/jenkins/Atlas%2FPlugins%2Fcloudbees-workflow-ui-plugin/detail/PR-22/5/pipeline
But I can't find any Jenkinsfile. Should we update .gaia file in order to use a specific windows container?

cc @scherler

@lemeurherve
Copy link
Member

lemeurherve commented Aug 24, 2022

This means we'll have to ask you to trigger builds whenever we change this useContainer: false in any repository?

This means to be able to run PR builds on Jenkinsfile changes, the pull request has to be opened by one of the maintainer of the repository/plugin.

BTW, we have the exact same issue for this PR:
https://github.com/cloudbees/cloudbees-workflow-ui-plugin/pull/22
gauntlet-3.cloudbees.com/gaia/blue/organizations/jenkins/Atlas%2FPlugins%2Fcloudbees-workflow-ui-plugin/detail/PR-22/5/pipeline
But I can't find any Jenkinsfile. Should we update .gaia file in order to use a specific windows container?

Sorry I can't really help you as I don't know how this CloudBees Gauntlet instance is configured/working.

@jgreffe
Copy link
Author

jgreffe commented Aug 24, 2022

Thanks for your help, I'll ask in proper channel.
👍🏼

@lemeurherve
Copy link
Member

Also note I'm still not sure if it works now because of the useContainer: false, or because of the addition of MS C++

@dduportal
Copy link
Contributor

@jgreffe Regarding the OSS infra, the useContainer: false is a tempororary trick to force using VM agents.
But the infra-team is working on #2822 to provide the same template for VM and containers: once deployed you'll be able to rollback this hack :)

@dduportal
Copy link
Contributor

Also note I'm still not sure if it works now because of the useContainer: false, or because of the addition of MS C++

Both:

  • useContainer ensure that a VM is used
  • hence the VMs are now using the new template (I guess) with MS C++

@lemeurherve
Copy link
Member

Both

Good, closing this issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants