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

publish fails using github workflow and windows_latest container #2498

Closed
3 tasks done
stepheneb opened this issue Sep 3, 2021 · 9 comments
Closed
3 tasks done

publish fails using github workflow and windows_latest container #2498

stepheneb opened this issue Sep 3, 2021 · 9 comments
Labels

Comments

@stepheneb
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.0.0-beta.60

Electron version

v13.2.3

Operating system

Windows Server 2019 (windows_latest container in github actions))

Last known working Electron Forge version

No response

Expected behavior

Executing npm run publish builds and uploads release artifacts on the windows_latest container in a github workflow action.

Actual behavior

Issue occurs executing a release in this public repository: https://github.com/stepheneb/cfa-own-electron

Running this yaml workflow release-windows.yml:

  publish_on_win:
    environment: release
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@master
      with:
        node-version: 14
    - name: install dependencies
      run: npm install
    - name: publish
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: npm run publish

Generates the following failure apparently during the uploading phase of the task

Making for the following targets: squirrel
- Making for target: squirrel - On platform: win32 - For arch: x64
✔ Making for target: squirrel - On platform: win32 - For arch: x64
- Resolving publish target: @electron-forge/publisher-github
✔ Resolving publish target: @electron-forge/publisher-github
- Searching for target release: 1.0.0-beta.13
✔ Searching for target release: 1.0.0-beta.13
- Uploading Artifacts 0/1 to v1.0.0-beta.13
npm ERR! code ELIFECYCLE
npm ERR! errno 3221226505
npm ERR! [email protected] publish: `electron-forge publish`
npm ERR! Exit status 3221226505
npm ERR! 
npm ERR! Failed at the [email protected] publish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\2021-09-03T14_40_36_114Z-debug.log
Error: Process completed with exit code 1.
##[debug]Finishing: publish

I updated the workflow release-windows.yml
to split the publish task into two separate npm invocations.

      run: |
        npm run publish-dry-run
        npm run publish-from-dry-run

And the workflow succeeds: https://github.com/stepheneb/cfa-own-electron/runs/3507277578

The generated artifacts are all about 640 MB

  • CfA.OWN.Electron-1.0.0-beta.14-x64.dmg
    660 MB
  • CfA.OWN.Electron-1.0.0-beta.14.Setup.exe
    622 MB
  • CfA.OWN.Electron-darwin-x64-1.0.0-beta.14.zip
    638 MB
  • cfa_owns_electron-1.0.0-beta14-full.nupkg
    624 MB

Steps to reproduce

The issue is likely to be size/memory related so it's probably easiest to just clone my large public repo: https://github.com/stepheneb/cfa-own-electron

Clone and checkout repository. Update the bata version and push tags. This will start the release workflow. The macos release succeeds, the windows release will also succeed using the current separation of the publish task into two npm invocations.

  1. fork: https://github.com/stepheneb/cfa-own-electron
  2. clone repo locally
  3. npm install
  4. npm version prerelease
  5. git push origin main
  6. git push --follow-tags

To cause a failure revert and commit the change that split the npm invocation into two parts.

Change .github/workflows/release-windows.yml from:

      run: |
        npm run publish-dry-run
        npm run publish-from-dry-run

to

      run: npm run publish

Tag a new beta release and push the changes.

npm version prerelease
git push origin main
git push --follow-tags

Open github.com<username>/cfa-own-electron/actions to monitor the workflow release actions.

Additional information

I earlier reported an error where it was clear the node process ran out of memory #2472.

Since then I have extracted about 300 MB into a separate repository that is no longer included in the application packaging.

The cause of the failure now is not as clear in the debug logs the github workflow generates when running the publish operating in one npm invocation.

Two items that might make debugging easier.

  1. Running the publish task with extended debug logging to the console. Did not see how to do this in the CLI doc.
  2. Not Electron Forge related -- display the detailed npm log in the event of an error in a github workflow.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\2021-09-03T14_40_36_114Z-debug.log
@stepheneb stepheneb added the bug label Sep 3, 2021
@malept
Copy link
Member

malept commented Sep 3, 2021

You can get more debugging info by reading the support document.

@stepheneb
Copy link
Author

I changed the run command in the the windows release yaml config to:

run: set DEBUG=electron-forge:* & node_modules\.bin\electron-forge publish

Hmmm here's the first try ... so far I'm not getting more info on the failure -- it seems like less. I'll next try setting the DEBUG value with a powershell command.

Run set DEBUG=electron-forge:* & node_modules\.bin\electron-forge publish
##[debug]C:\Program Files\PowerShell\7\pwsh.EXE -command ". 'D:\a\_temp\876ed4bf-d2da-40fe-a175-37b3cab6494c.ps1'"

Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
--     ----            -------------   -----         -----------     --------             -------
1      Job1            BackgroundJob   Running       True            localhost            Microsoft.PowerShell.Man…
- Checking your system
✔ Checking your system
- Resolving Forge Config
✔ Resolving Forge Config
We need to package your application before we can make it
- Preparing to Package Application for arch: x64
- Compiling Main Process Code
✔ Compiling Main Process Code
- Compiling Renderer Template
(node:3092) [DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH] DeprecationWarning: [hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Compiling Renderer Template
- Compiling Renderer Preload: main_window
✔ Compiling Renderer Preload: main_window
- Compiling Renderer Preload: admin_window
✔ Compiling Renderer Preload: admin_window
✔ Preparing to Package Application for arch: x64
- Preparing native dependencies
✔ Preparing native dependencies
- Packaging Application
✔ Packaging Application
Making for the following targets: squirrel
- Making for target: squirrel - On platform: win32 - For arch: x64
✔ Making for target: squirrel - On platform: win32 - For arch: x64
- Resolving publish target: @electron-forge/publisher-github
✔ Resolving publish target: @electron-forge/publisher-github
- Searching for target release: 1.0.0-beta.16
✔ Searching for target release: 1.0.0-beta.16
- Uploading Artifacts 0/1 to v1.0.0-beta.16

Error: Process completed with exit code 1.
##[debug]Finishing: publish

@stepheneb
Copy link
Author

Similar result with the powershell invocation.

run: $env:DEBUG='electron-forge:*';node_modules\.bin\electron-forge publish
Run $env:DEBUG='electron-forge:*';node_modules\.bin\electron-forge publish
##[debug]C:\Program Files\PowerShell\7\pwsh.EXE -command ". 'D:\a\_temp\335165cc-098f-4c43-a30d-6ac16500cb8c.ps1'"
WARNING: DEBUG environment variable detected. Append the electron-forge:lifecycle namespace
to the value of DEBUG in order to view progress indicators.
2021-09-04T04:06:43.791Z electron-forge:async-ora Process Started: Checking your system
2021-09-04T04:06:43.794Z electron-forge:check-system checking system, create ~/.skip-forge-system-check to stop doing this
2021-09-04T04:06:44.516Z electron-forge:async-ora Process Succeeded: Checking your system -- after 725ms
WARNING: DEBUG environment variable detected. Append the electron-forge:lifecycle namespace
to the value of DEBUG in order to view progress indicators.
2021-09-04T04:06:45.520Z electron-forge:require-search searching [
  '@electron-forge/plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\plugin-webpack'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:45.522Z electron-forge:require-search testing @electron-forge/plugin-webpack
2021-09-04T04:06:46.071Z electron-forge:plugin:webpack hooking process events
2021-09-04T04:06:46.072Z electron-forge:publish triggering make
2021-09-04T04:06:46.074Z electron-forge:async-ora Process Started: Resolving Forge Config
2021-09-04T04:06:46.074Z electron-forge:project-resolver searching for project in: D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.081Z electron-forge:project-resolver electron-forge compatible package.json found in D:\a\cfa-own-electron\cfa-own-electron\package.json
2021-09-04T04:06:46.085Z electron-forge:require-search searching [
  '@electron-forge/plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\plugin-webpack'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.085Z electron-forge:require-search testing @electron-forge/plugin-webpack
2021-09-04T04:06:46.086Z electron-forge:plugin:webpack hooking process events
2021-09-04T04:06:46.087Z electron-forge:async-ora Process Succeeded: Resolving Forge Config -- after 12ms
2021-09-04T04:06:46.087Z electron-forge:require-search searching [
  '@electron-forge/maker-squirrel',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\maker-squirrel',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\maker-squirrel'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.087Z electron-forge:require-search testing @electron-forge/maker-squirrel
2021-09-04T04:06:46.178Z electron-forge:require-search searching [
  '@electron-forge/maker-zip',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\maker-zip',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\maker-zip'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.179Z electron-forge:require-search testing @electron-forge/maker-zip
2021-09-04T04:06:46.181Z electron-forge:require-search searching [
  '@electron-forge/maker-dmg',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\maker-dmg',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\maker-dmg'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.181Z electron-forge:require-search testing @electron-forge/maker-dmg
2021-09-04T04:06:46.183Z electron-forge:require-search searching [
  '@electron-forge/maker-deb',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\maker-deb',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\maker-deb'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.184Z electron-forge:require-search testing @electron-forge/maker-deb
2021-09-04T04:06:46.186Z electron-forge:require-search searching [
  '@electron-forge/maker-rpm',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\maker-rpm',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\maker-rpm'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.186Z electron-forge:require-search testing @electron-forge/maker-rpm
We need to package your application before we can make it
2021-09-04T04:06:46.189Z electron-forge:async-ora Process Started: Preparing to Package Application for arch: x64
2021-09-04T04:06:46.189Z electron-forge:project-resolver searching for project in: D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.189Z electron-forge:project-resolver electron-forge compatible package.json found in D:\a\cfa-own-electron\cfa-own-electron\package.json
2021-09-04T04:06:46.193Z electron-forge:require-search searching [
  '@electron-forge/plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\plugin-webpack',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\plugin-webpack'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:06:46.193Z electron-forge:require-search testing @electron-forge/plugin-webpack
2021-09-04T04:06:46.193Z electron-forge:plugin:webpack hooking process events
2021-09-04T04:06:46.196Z electron-forge:async-ora Process Started: Compiling Main Process Code
2021-09-04T04:06:46.196Z electron-forge:plugin:webpack:webpackconfig Config mode: production
2021-09-04T04:06:49.791Z electron-forge:async-ora Process Succeeded: Compiling Main Process Code -- after 3.5s
2021-09-04T04:06:49.791Z electron-forge:async-ora Process Started: Compiling Renderer Template
(node:1836) [DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH] DeprecationWarning: [hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)
(Use `node --trace-deprecation ...` to show where the warning was created)
2021-09-04T04:07:11.480Z electron-forge:async-ora Process Succeeded: Compiling Renderer Template -- after 21.6s
2021-09-04T04:07:11.481Z electron-forge:async-ora Process Started: Compiling Renderer Preload: main_window
2021-09-04T04:07:32.490Z electron-forge:async-ora Process Succeeded: Compiling Renderer Preload: main_window -- after 21s
2021-09-04T04:07:32.492Z electron-forge:async-ora Process Started: Compiling Renderer Preload: admin_window
2021-09-04T04:07:55.389Z electron-forge:async-ora Process Succeeded: Compiling Renderer Preload: admin_window -- after 22.8s
2021-09-04T04:07:55.391Z electron-forge:packager packaging with options {
  asar: false,
  overwrite: true,
  ignore: [Function (anonymous)],
  dir: 'D:\\a\\cfa-own-electron\\cfa-own-electron',
  arch: 'x64',
  platform: 'win32',
  afterCopy: [ [AsyncFunction (anonymous)] ],
  afterExtract: [ [AsyncFunction (anonymous)] ],
  afterPrune: [ [AsyncFunction (anonymous)] ],
  out: 'D:\\a\\cfa-own-electron\\cfa-own-electron\\out',
  electronVersion: '13.2.3',
  quiet: true
}
2021-09-04T04:08:19.219Z electron-forge:async-ora Process Succeeded: Preparing to Package Application for arch: x64 -- after 1m 33s
2021-09-04T04:08:19.225Z electron-forge:async-ora Process Started: Preparing native dependencies
2021-09-04T04:08:19.230Z electron-forge:async-ora Process Succeeded: Preparing native dependencies -- after 5ms
2021-09-04T04:08:19.230Z electron-forge:async-ora Process Started: Packaging Application
2021-09-04T04:08:44.739Z electron-forge:async-ora Process Succeeded: Packaging Application -- after 25.5s
Making for the following targets: squirrel
2021-09-04T04:08:44.743Z electron-forge:async-ora Process Started: Making for target: squirrel - On platform: win32 - For arch: x64
2021-09-04T04:16:20.636Z electron-forge:async-ora Process Succeeded: Making for target: squirrel - On platform: win32 - For arch: x64 -- after 7m 35.8s
2021-09-04T04:16:20.645Z electron-forge:project-resolver searching for project in: D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:16:20.652Z electron-forge:project-resolver electron-forge compatible package.json found in D:\a\cfa-own-electron\cfa-own-electron\package.json
2021-09-04T04:16:20.657Z electron-forge:async-ora Process Started: Resolving publish target: @electron-forge/publisher-github
2021-09-04T04:16:20.661Z electron-forge:require-search searching [
  '@electron-forge/publisher-github',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\@electron-forge\\publisher-github',
  'D:\\a\\cfa-own-electron\\cfa-own-electron\\node_modules\\@electron-forge\\publisher-github'
] relative to D:\a\cfa-own-electron\cfa-own-electron
2021-09-04T04:16:20.666Z electron-forge:require-search testing @electron-forge/publisher-github
2021-09-04T04:16:20.801Z electron-forge:async-ora Process Succeeded: Resolving publish target: @electron-forge/publisher-github -- after 144ms
2021-09-04T04:16:20.826Z electron-forge:async-ora Process Started: Searching for target release: 1.0.0-beta.17
2021-09-04T04:16:21.239Z electron-forge:async-ora Process Succeeded: Searching for target release: 1.0.0-beta.17 -- after 413ms
2021-09-04T04:16:21.239Z electron-forge:async-ora Process Started: Uploading Artifacts 0/1 to v1.0.0-beta.17
2021-09-04T04:16:21.975Z electron-forge:async-ora Process Renamed: Uploading Artifacts 0/1 to v1.0.0-beta.17  -->  Uploading Artifacts 1/1 to v1.0.0-beta.17
Error: Process completed with exit code 1.
##[debug]Finishing: publish

@stepheneb
Copy link
Author

stepheneb commented Sep 4, 2021

Is there a way to get more DEBUG logging in the Uploading Artifacts step of the publish task?

What module/package has the source for that section of code?

@malept
Copy link
Member

malept commented Sep 4, 2021

Is there a way to get more DEBUG logging in the Uploading Artifacts step of the publish task?

See #2499

@stepheneb
Copy link
Author

Hmmm ... haven't tried install a package from a branch before and got an error in the post install section.

Here's the change I made in package.json:

     "@electron-forge/maker-squirrel": "^6.0.0-beta.60",
     "@electron-forge/maker-zip": "^6.0.0-beta.60",
     "@electron-forge/plugin-webpack": "^6.0.0-beta.60",
-    "@electron-forge/publisher-github": "^6.0.0-beta.60",
+    "@electron-forge/publisher-github": "electron-userland/electron-forge#malept/feat/publisher-github/debug",
     "@marshallofsound/webpack-asset-relocator-loader": "^0.5.0",
     "autoprefixer": "^10.3.3",
     "copy-webpack-plugin": "^9.0.1",

Several sections of the log file:

11083 silly lifecycle [email protected]~postinstall: Args: [ '-c', 'rimraf node_modules/.bin/*.ps1 && ts-node tools/link-ts.ts' ]
11084 info lifecycle [email protected]~postinstall: Failed to exec postinstall script
11085 timing action:postinstall Completed in 354ms

...

11090 warn [email protected] requires a peer of acorn@^8 but none is installed. You must install peer dependencies yourself.
11091 warn [email protected] requires a peer of eslint-plugin-import@^2.22.1 but none is installed. You must install peer dependencies yourself.
11092 warn [email protected] requires a peer of eslint-plugin-node@^11.1.0 but none is installed. You must install peer dependencies yourself.
11093 warn [email protected] requires a peer of eslint-plugin-promise@^4.2.1 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
11094 verbose stack Error: [email protected] postinstall: `rimraf node_modules/.bin/*.ps1 && ts-node tools/link-ts.ts`
11094 verbose stack spawn ENOENT
11094 verbose stack     at ChildProcess.<anonymous> (/Users/stephen/.nvm/versions/node/v14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
11094 verbose stack     at ChildProcess.emit (events.js:400:28)
11094 verbose stack     at maybeClose (internal/child_process.js:1055:16)
11094 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
11095 verbose pkgid [email protected]
11096 verbose cwd /Users/stephen/dev/00-clients/rlmg/cfa-own-electron
11097 verbose Darwin 20.6.0
11098 verbose argv "/Users/stephen/.nvm/versions/node/v14.17.4/bin/node" "/Users/stephen/.nvm/versions/node/v14.17.4/bin/npm" "install" "--save-dev" "@electron-forge/publisher-github"
11099 verbose node v14.17.4
11100 verbose npm  v6.14.14
11101 error code ELIFECYCLE
11102 error syscall spawn
11103 error file sh
11104 error errno ENOENT
11105 error [email protected] postinstall: `rimraf node_modules/.bin/*.ps1 && ts-node tools/link-ts.ts`
11105 error spawn ENOENT
11106 error Failed at the [email protected] postinstall script.
11106 error This is probably not a problem with npm. There is likely additional logging output above.

@malept
Copy link
Member

malept commented Sep 6, 2021

You probably need to figure out how to install modules in a monorepo from a git branch. That syntax doesn't seem right.

@stepheneb
Copy link
Author

Haven't been able to get the the debug logging working on the windows workflow using /malept/feat/publisher-github/debug branch with the time I have available.

For now I've switched back to using the hack of separating the publish task into two separate npm invocations.

     run: |
        npm run publish-dry-run
        npm run publish-from-dry-run

Am subscribed to #2499 -- if it get's merged into a release I'll start testing this again.

My debugging work is saved in this branch: https://github.com/stepheneb/cfa-own-electron/tree/windows-workflow-publish-debug

@MarshallOfSound
Copy link
Member

Closing out as I would assume this is a bug in the GH actions runner rather than forge itself, potentially a segfault in the version of node that it embeds

jhotadhari added a commit to jhotadhari/chroco that referenced this issue Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants