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: Socket Hang up when electron-builder Release on github. #4940

Open
TusharKanjariya opened this issue May 8, 2020 · 85 comments · Fixed by #6563
Open

Error: Socket Hang up when electron-builder Release on github. #4940

TusharKanjariya opened this issue May 8, 2020 · 85 comments · Fixed by #6563

Comments

@TusharKanjariya
Copy link

  • Version: 22.6.0

  • Electron Version:8.1.1

  • Electron Type (current, beta, nightly):Current

  • Target: NSIS Windows

My electron-builder.json file for configurations

{
  "appId": "com.screenshot.app",
  "copyright": "Copyright © 2019-Tushar Kanjariya",
  "productName": "Screenshot App",
  "nsis": {
    "perMachine": true,
    "oneClick": false,
    "allowToChangeInstallationDirectory": false,
    "license": "LICENSE.txt",
    "allowElevation": true
  },
  "publish": {
    "provider": "github",
    "owner": "TusharKanjariya",
    "repo": "screenshot-app-electron",
    "token": "my_token"
  }
}

When I run the command npm run publish:github then the following error will occur after the final build and uploading

image

Plz, Help to solve my Issue.

@b-zurg
Copy link
Contributor

b-zurg commented May 8, 2020

Is this consistently reproducable? This seems like it could be related: request/request#2047

Have you tried upgrading your node version?

@TusharKanjariya
Copy link
Author

@b-zurg
My Current Node version is v13.13.0.
I have tried this solution but can't able to solve the issue.

@stale
Copy link

stale bot commented Jul 10, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Jul 10, 2020
@b-zurg
Copy link
Contributor

b-zurg commented Jul 11, 2020

Question - how long does the upload take? This sort of error is something I've encountered elsewhere on long uploads

@stale stale bot removed the backlog label Jul 11, 2020
@hovancik
Copy link

I am having the same today, never had this issue before: https://travis-ci.com/github/hovancik/stretchly/jobs/362382915

@hovancik
Copy link

⨯ Cannot cleanup: 

Error #1 --------------------------------------------------------------------------------

Error: socket hang up

    at connResetException (internal/errors.js:570:14)

    at TLSSocket.socketOnEnd (_http_client.js:440:23)

    at TLSSocket.emit (events.js:228:7)

    at endReadableNT (_stream_readable.js:1185:12)

    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Error #2 --------------------------------------------------------------------------------

Error: socket hang up

    at connResetException (internal/errors.js:570:14)

    at TLSSocket.socketOnEnd (_http_client.js:440:23)

    at TLSSocket.emit (events.js:228:7)

    at endReadableNT (_stream_readable.js:1185:12)

    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Error #3 --------------------------------------------------------------------------------

Error: socket hang up

    at connResetException (internal/errors.js:570:14)

    at TLSSocket.socketOnEnd (_http_client.js:440:23)

    at TLSSocket.emit (events.js:228:7)

    at endReadableNT (_stream_readable.js:1185:12)

    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Error #4 --------------------------------------------------------------------------------

Error: socket hang up

    at connResetException (internal/errors.js:570:14)

    at TLSSocket.socketOnEnd (_http_client.js:440:23)

    at TLSSocket.emit (events.js:228:7)

    at endReadableNT (_stream_readable.js:1185:12)

    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Error #5 --------------------------------------------------------------------------------

Error: socket hang up

    at connResetException (internal/errors.js:570:14)

    at TLSSocket.socketOnEnd (_http_client.js:440:23)

    at TLSSocket.emit (events.js:228:7)

    at endReadableNT (_stream_readable.js:1185:12)

    at processTicksAndRejections (internal/process/task_queues.js:81:21)  stackTrace=

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: Cannot cleanup: 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error #1 --------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: socket hang up

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at connResetException (internal/errors.js:570:14)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.socketOnEnd (_http_client.js:440:23)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.emit (events.js:228:7)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at endReadableNT (_stream_readable.js:1185:12)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at processTicksAndRejections (internal/process/task_queues.js:81:21)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error #2 --------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: socket hang up

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at connResetException (internal/errors.js:570:14)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.socketOnEnd (_http_client.js:440:23)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.emit (events.js:228:7)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at endReadableNT (_stream_readable.js:1185:12)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at processTicksAndRejections (internal/process/task_queues.js:81:21)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error #3 --------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: socket hang up

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at connResetException (internal/errors.js:570:14)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.socketOnEnd (_http_client.js:440:23)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.emit (events.js:228:7)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at endReadableNT (_stream_readable.js:1185:12)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at processTicksAndRejections (internal/process/task_queues.js:81:21)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error #4 --------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: socket hang up

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at connResetException (internal/errors.js:570:14)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.socketOnEnd (_http_client.js:440:23)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.emit (events.js:228:7)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at endReadableNT (_stream_readable.js:1185:12)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at processTicksAndRejections (internal/process/task_queues.js:81:21)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error #5 --------------------------------------------------------------------------------

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Error: socket hang up

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at connResetException (internal/errors.js:570:14)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.socketOnEnd (_http_client.js:440:23)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at TLSSocket.emit (events.js:228:7)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at endReadableNT (_stream_readable.js:1185:12)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at processTicksAndRejections (internal/process/task_queues.js:81:21)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at throwError (/home/travis/build/hovancik/stretchly/node_modules/builder-util/src/asyncTaskManager.ts:90:11)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at checkErrors (/home/travis/build/hovancik/stretchly/node_modules/builder-util/src/asyncTaskManager.ts:53:9)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at AsyncTaskManager.awaitTasks (/home/travis/build/hovancik/stretchly/node_modules/builder-util/src/asyncTaskManager.ts:58:5)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at PublishManager.awaitTasks (/home/travis/build/hovancik/stretchly/node_modules/app-builder-lib/src/publish/PublishManager.ts:210:28)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at /home/travis/build/hovancik/stretchly/node_modules/app-builder-lib/src/index.ts:94:32

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 at executeFinally (/home/travis/build/hovancik/stretchly/node_modules/builder-util/src/promise.ts:25:9)

@b-zurg
Copy link
Contributor

b-zurg commented Jul 18, 2020

Does it happen repeatedly? Is it a one off thing?

@hovancik
Copy link

Well I tried like 10 times now and it seems always the same.

@stale
Copy link

stale bot commented Sep 17, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Sep 17, 2020
@hovancik
Copy link

Keep this opened.

@stale stale bot removed the backlog label Sep 18, 2020
@marc2332
Copy link

Hello 🖖🏻

I am also facing this issue since some weeks ago.
I now always to re-run the Github Actions until it works.

https://github.com/Graviton-Code-Editor/Graviton-App/runs/1140459243?check_suite_focus=true

Notes:

  • It fails randomly
  • Only fails in Windows and Ubuntu

@tassoevan
Copy link

Publishing is almost unusable. It is falling for me at a ratio of around one successful upload to five failed ones.

@b-zurg
Copy link
Contributor

b-zurg commented Sep 24, 2020

I have experienced socket hang ups in different contexts when there is a long running upload. It depends on the specific connection being made and if the connection is not kept alive the upload target thinks it's a dead connection and kills it.

That's what it seems like is happening here. The comments indicate that it does go through sometimes. I would bet that those times the upload happened just a bit faster.

I'm also going to guess that is it's under 2 minutes it's fine as the default connection time out for node JS is 2 minutes.

Could anyone verify these guesses?

@tassoevan
Copy link

If I'm reading this right, there is no option to set a preferred timeout and it may fail four times before rejecting the upload.

@tassoevan
Copy link

tassoevan commented Sep 25, 2020

I've noticed something else: it doesn't fail at the times my draft release is empty, i.e., when there is no need to overwrite files. Looking at all the examples you folks posted here, they all are trying to overwrite files. Is it possible that a change in GitHub API is the root cause?

@marc2332
Copy link

I've noticed something else: it doesn't fail at the times my draft release is empty, i.e., when there is no need to overwrite files. Looking at all the examples you folks posted here, they all are trying to overwrite files. Is it possible that a change in GitHub API is the root cause?

You are absolutely right, it has only been randomly failing when I had a draft matching the same version. Now I have increased the version, it does no longer match the draft's version so it now doesn't randomly fail anymore

@stale
Copy link

stale bot commented Nov 24, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Nov 24, 2020
@fspoettel
Copy link

Still relevant

@9oelM
Copy link

9oelM commented Dec 30, 2020

Screen Shot 2020-12-30 at 10 46 26 AM
yeap. still.

@gbmhunter
Copy link

Can also confirm that this is still an issue, and yes, only occurs if the version tag already exists (i.e. it is overwriting a file).

image

@flesicek
Copy link

flesicek commented Jan 4, 2021

same issue here, we are experiencing this error on-off for months :-(

@stale stale bot removed the backlog label Sep 21, 2021
@steveoh
Copy link

steveoh commented Oct 12, 2021

Same for me on a GH mac os runner.

https://github.com/agrc/api-client/runs/3873267275?check_suite_focus=true

@phanirithvij2000
Copy link

I can reproduce it still, for parallel builds

@VictorioBerra
Copy link

VictorioBerra commented Oct 30, 2021

Happening to me too, trying to deploy on Windows and Ubuntu. Deleting the release so it does not try to overwrite fixes it for me.

holic added a commit to molabsai/mo-desktop that referenced this issue Dec 13, 2021
@melroy89
Copy link

melroy89 commented Jan 3, 2022

still have this happening multiple times today.

https://github.com/lbry-foss/lbry-desktop/runs/4692765872?check_suite_focus=true#step:6:207

Is it a time-out we are hitting or?

  • Did you check for setting keepAlive: true in the http agent?

@RobertLowe
Copy link

Is it a time-out we are hitting or?

  • Did you check for setting keepAlive: true in the http agent?

If I recall correctly, this is from the github API, not the actual http client; Further, I had difficulties around this because of draft mode. Even after changing the release from draft mode, the issue remained. There is some lingering funk from draft mode, GH doesnt clean-up well there?

@melroy89
Copy link

melroy89 commented Jan 3, 2022

If there is some error coming from the github api. Electron builder should handle those errors as well. Avoiding socket closed issue. Maybe we then also see what the root cause may be.

Edit: it indeed only take place when overriding the existing file.

@baparham
Copy link
Contributor

I have these observations from trying to debug this locally:

  1. we never enter the if block where overwriteArtifact is called

if (e.statusCode === 422 && e.description != null && e.description.errors != null && e.description.errors[0].code === "already_exists") {
return this.overwriteArtifact(fileName, release).then(() => this.doUploadFile(attemptNumber, parsedUrl, fileName, dataLength, requestProcessor, release))
}

  1. the description we get back from github is not json, but plain text, so the e.description.errors[0].code in the if statement is undefined since e.description has not been parsed into an object.
  2. I do not believe this is the entirety of this problem, since I continue to also hit 502 bad gateway or other econnreset errors sometimes alongside, however this may be the root cause of the "can't overwrite an already created draft release asset" problem

I'll continue experimenting and debugging, and try and come up with a PR to fix at least this portion of these errors

the description we get back is like:

 description: 'method: POST url: https://uploads.github.com/repos/......./releases/......./assets?name=......exe\n' +
    '\n' +
    '          Data:\n' +
    '          {"message":"Validation Failed","request_id":".......","documentation_url":"https://docs.github.com/rest","errors":[{"resource":"ReleaseAsset","code":"already_exists","field":"name"}]}\n' +
    '          ',

@mmaietta mmaietta linked a pull request Jan 19, 2022 that will close this issue
@gniezen
Copy link
Contributor

gniezen commented Mar 9, 2022

I've tried electron-builder v23.0.2, which has the fix in #6563 , but unfortunately this leads to a never-ending loop on CircleCI builds (but works fine on Appveyor):

overwrite published file  file=Tidepool Uploader-2.43.0-****************-update.1-mac.zip.blockmap reason=already exists on GitHub
  **************** Request: {
  ****************   "protocol": "https:",
  ****************   "hostname": "api.github.com",
  ****************   "port": null,
  ****************   "path": "/repos/tidepool-org/uploader/releases/61378130/assets",
  ****************   "headers": {
  ****************     "accept": "application/vnd.github.v3+json",
  ****************     "authorization": "<stripped sensitive data>",
  ****************     "User-Agent": "****************",
  ****************     "Cache-Control": "no-cache"
  ****************   }
  **************** } +1ms
  **************** Response: 200 OK, request options: {
  ****************   "protocol": "https:",
  ****************   "hostname": "api.github.com",
  ****************   "port": null,
  ****************   "path": "/repos/tidepool-org/uploader/releases/61378130/assets",
  ****************   "headers": {
  ****************     "accept": "application/vnd.github.v3+json",
  ****************     "authorization": "<stripped sensitive data>",
  ****************     "User-Agent": "****************",
  ****************     "Cache-Control": "no-cache"
  ****************   }
  **************** } +155ms
  • trying to upload again  file=Tidepool Uploader-2.43.0-****************-update.1-mac.zip.blockmap reason=not found on GitHub
  **************** Request: {
  ****************   "protocol": "https:",
  ****************   "hostname": "uploads.github.com",
  ****************   "path": "/repos/tidepool-org/uploader/releases/61378130/assets?name=Tidepool%20Uploader-2.43.0-****************-update.1-mac.zip.blockmap",
  ****************   "method": "POST",
  ****************   "headers": {
  ****************     "accept": "application/vnd.github.v3+json",
  ****************     "Content-Type": "application/octet-stream",
  ****************     "Content-Length": 75743,
  ****************     "authorization": "<stripped sensitive data>",
  ****************     "User-Agent": "****************",
  ****************     "Cache-Control": "no-cache"
  ****************   }
  **************** } +25ms
  **************** Response: 422 Unprocessable Entity, request options: {
  ****************   "protocol": "https:",
  ****************   "hostname": "uploads.github.com",
  ****************   "path": "/repos/tidepool-org/uploader/releases/61378130/assets?name=Tidepool%20Uploader-2.43.0-****************-update.1-mac.zip.blockmap",
  ****************   "method": "POST",
  ****************   "headers": {
  ****************     "accept": "application/vnd.github.v3+json",
  ****************     "Content-Type": "application/octet-stream",
  ****************     "Content-Length": 75743,
  ****************     "authorization": "<stripped sensitive data>",
  ****************     "User-Agent": "****************",
  ****************     "Cache-Control": "no-cache"
  ****************   }
  **************** } +1s
  • overwrite published file  file=Tidepool Uploader-2.43.0-****************-update.1-mac.zip.blockmap reason=already exists on GitHub

@chrisdevereux
Copy link

Upgrading from 22.14 -> 23.0 fixed this for me. Thanks!

@gniezen
Copy link
Contributor

gniezen commented Mar 21, 2022

@mmaietta I think you may have closed this one in error. The fix works on Windows/Appveyor builds, but (at least for me) led to a never-ending loop on MacOS/CircleCI builds.

@MrGoro
Copy link

MrGoro commented Apr 10, 2022

I can confirm that for me the error still exists with Version 23.0.3. It randomly fails uploading to existing assets. After some reruns it works.

@Deathspike
Copy link

This definitely still occurs in 23.0.3.

@paustint
Copy link

paustint commented Jun 4, 2022

😭 just found this thread - still happening 23.0.9

@mmaietta
Copy link
Collaborator

mmaietta commented Jun 4, 2022

Reopening. I'm going to need someone else to investigate this though as I have no idea where to debug this.

@mmaietta mmaietta reopened this Jun 4, 2022
@ocavue
Copy link

ocavue commented Jun 8, 2022

GitHub's official actions/upload-artifact seems to resolve this issue by adding retries:

actions/upload-artifact#116 (comment)

Should be good now. Retries with exponential back-off have been added to all HTTP calls so any socket disconnects, timeouts, 503s or ECONNRESET errors should gracefully now retry and the artifact upload should go through (previously only a subset of HTTP calls during upload were retried). Recent updates should significantly improve reliability.

@shensven
Copy link

same problem at 23.3.1

@JustJoostNL
Copy link

Any updates on this?

@mmaietta
Copy link
Collaborator

Happy to review a PR contribution for this issue as I'm not able to devote any of my time to this ticket.

@JustJoostNL
Copy link

Can you explain why? And unfortunately I am not able to fix this, I simply don’t know how.

@Deathspike
Copy link

Not sure if this helps for your immediate problem @koningcool, but I have a workaround in place that simply deletes the release before running electron-builder. It's relatively straightforward to implement if you're using Github workflows. I also took a stab at this way back when, but I also have no idea how to reproduce the issue in a reliable way in order to fix it. For my workaround, see:

https://github.com/Deathspike/ulmas/blob/78b42f70e0c940e9731cc66fb87bdb09f687f160/.github/workflows/electron-snapshot.yml
https://github.com/Deathspike/ulmas/blob/78b42f70e0c940e9731cc66fb87bdb09f687f160/.github/scripts/electron-snapshot-prune.js

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