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

current issues with network #653

Open
gengjiawen opened this issue Oct 13, 2022 · 8 comments
Open

current issues with network #653

gengjiawen opened this issue Oct 13, 2022 · 8 comments

Comments

@gengjiawen
Copy link
Member

gengjiawen commented Oct 13, 2022

  • node-fetch not working on 18 (maybe only with proxy)
  • proxy only support http, sock5 not working
@aduh95
Copy link
Contributor

aduh95 commented Oct 27, 2022

This is breaking the request-ci workflow on nodejs/node: https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780

Run ./tools/actions/start-ci.sh 45179 
+ REQUEST_CI_LABEL=request-ci
+ REQUEST_CI_FAILED_LABEL=request-ci-failed
+ gh pr edit 451[7](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:8)9 --remove-label request-ci
https://github.com/nodejs/node/pull/45179
+ ci_started=yes
+ rm -f output
+ ncu-ci run 45179
+ cat output
- Validating Jenkins credentials
✔  Jenkins credentials valid
+ [ yes = no ]
- Starting PR CI job
(node:1[8](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:9)[10](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:11)) [https://github.com/node-fetch/node-fetch/issues/[11](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:12)67] DeprecationWarning: form-data doesn't follow the spec and requires special treatment. Use alternative package
(Use `node --trace-deprecation ...` to show where the warning was created)

[DEBUG] FetchError: request to https://ci.nodejs.org/job/node-test-pull-request/build failed, reason: socket hang up
    at ClientRequest.<anonymous> (file:///opt/hostedtoolcache/node/18.[12](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:13).0/x64/lib/node_modules/node-core-utils/node_modules/node-fetch/src/index.js:108:11)
    at ClientRequest.emit (node:events:525:35)
    at TLSSocket.socketCloseListener (node:_http_client:467:11)
    at TLSSocket.emit (node:events:525:35)
    at node:net:3[13](https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780#step:6:14):12
    at TCP.done (node:_tls_wrap:587:7) {
  type: 'system',
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  erroredSysCall: undefined
}
✖  Failed to start CI

@gengjiawen
Copy link
Member Author

@aduh95 Downgrade to Node 16 temporally maybe ?

In the long run, should we replace node-fetch ?

@aduh95
Copy link
Contributor

aduh95 commented Oct 27, 2022

In the long run, should we replace node-fetch ?

I'd say yes, possibly with globalThis.fetch now that it's available.

@gengjiawen
Copy link
Member Author

First issue since v18 became lts :)

@gengjiawen
Copy link
Member Author

Related node-fetch issue: node-fetch/node-fetch#1624

@richardlau
Copy link
Member

This is breaking the request-ci workflow on nodejs/node: https://github.com/nodejs/node/actions/runs/3333705931/jobs/5515914780

There's another issue here which is the breakage doesn't cause the workflow to fail. From that run the request-ci label was removed from nodejs/node#45179 but because of the issue with node-fetch no CI job was actually queued in Jenkins.

@avivnakar
Copy link

I believe the issue is deeper than node-fetch specifically
This snippet fails at 18 lts, and works with 16

http.request('http://localhost:4040/api/tunnels')
    .on('response', (res) => {
        let str = '';
        res.on('data', d => str += d);
        res.on('end', () => console.log(
            JSON.parse(str).tunnels[0].public_url
        ))
    }).end()

All of these are failing on 18 but working on 16.

node -e "require('node-fetch').default('http://localhost:4040/api/tunnels').then(res=>res.json()).then(res=>res.tunnels[0].public_url).then(console.log)"

node -e "http.request('http://localhost:4040/api/tunnels').on('response',(res)=>{let str=''; res.on('data',d=>str+=d); res.on('end',()=>console.log(JSON.parse(str).tunnels[0].public_url))}).end()"

node -e "fetch('http://localhost:4040/api/tunnels').then(res=>res.json()).then(res=>res.tunnels[0].public_url).then(console.log)"

Btw it's ngrok api, if you wish testing yourself, run ngrok http 5000 or any other port instead of 5000

@gengjiawen
Copy link
Member Author

@avivnakar better report it in nodejs/node repo with repro (ngrok has an npm module IIRC).

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

No branches or pull requests

4 participants