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

Socket hang up when uploading to server #90

Open
b-zurg opened this issue May 16, 2020 · 6 comments · May be fixed by #92
Open

Socket hang up when uploading to server #90

b-zurg opened this issue May 16, 2020 · 6 comments · May be fixed by #92

Comments

@b-zurg
Copy link

b-zurg commented May 16, 2020

I've gone down a bit of a rabbit hole trying to figure out why I kept getting a socket timeout error from the electron-forge publisher.

I eventually realized that when I was doing the upload at exactly 2 minutes the upload was failing with this message:

An unhandled error has occurred inside Forge:
request to http://localhost:3030/rest/app/1/channel/eb76a4a94e2a588b9cb9302826aa796f/upload failed, reason: socket hang up
FetchError: request to http://localhost:3030/rest/app/1/channel/eb76a4a94e2a588b9cb9302826aa796f/upload failed, reason: socket hang up
    at ClientRequest.<anonymous> (D:\GitHub\brl-desktop-app\node_modules\node-fetch\dist\index.js:3190:14)
    at ClientRequest.emit (events.js:310:20)
    at ClientRequest.EventEmitter.emit (domain.js:482:12)
    at Socket.socketOnEnd (_http_client.js:453:9)
    at Socket.emit (events.js:322:22)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)

I was simulating a prod server in a local docker compose file but connecting to an actual S3 bucket to test out aspects of the prod infrastructure.

@b-zurg
Copy link
Author

b-zurg commented May 16, 2020

Does anyone know why this would be happening?

@MarshallOfSound
Copy link
Contributor

Nucleus itself doesn't have a timeout on the upload. My guess is whatever you are using as an entry point (nginx, apache, etc.) has a connection timeout set to 2 minutes

@b-zurg b-zurg changed the title 2 minute hard timeout on uploads should be configurable Socket hang up when uploading to server May 16, 2020
@b-zurg
Copy link
Author

b-zurg commented May 16, 2020

I actually am using the atlassian/nucleus docker image in a docker compose file and connecting directly through the configured port on local host. The rest of the configuration is pointing to S3 and an RDS postgres instance.

Maybe docker is the problem variable here but that would be surprising.

@MarshallOfSound
Copy link
Contributor

Looks like node has a default connection timeout of 2 minutes

https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_server_settimeout_msecs_callback

@b-zurg
Copy link
Author

b-zurg commented May 16, 2020

Oh! Interesting. I'm assuming this has to be done on the server side. I can try it out and make a pull request to either disable the timeout or make it configurable.

@b-zurg b-zurg linked a pull request May 17, 2020 that will close this issue
@b-zurg
Copy link
Author

b-zurg commented May 17, 2020

This was a very helpful find. I managed to configure the server to have a default 30 minute timeout. This worked perfectly. I tested in a similar fashion and was able to release to my s3 bucket without getting a socket hang up.

Would love any feedback :)

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