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

Waiting on tcp ports doesn't work in Node 18 #133

Open
paulsmithkc opened this issue Feb 3, 2023 · 4 comments
Open

Waiting on tcp ports doesn't work in Node 18 #133

paulsmithkc opened this issue Feb 3, 2023 · 4 comments

Comments

@paulsmithkc
Copy link

paulsmithkc commented Feb 3, 2023

We ran into an issue with Node 18, were wait-on would wait indefinitely for a service to start, even though it was already started.

Environment:

  • Bitbucket Pipeline
  • Node 18 image
  • Azure Function App

Test Script:

concurrently -k -s first \"wait-on tcp:7071 --timeout=60000 && jest --forceExit\" \"azurite\" \"func start\"

Bitbucket Pipeline:

image: node:18

pipelines:
  default:
    - step:
        name: Test
        caches:
          - node
        script:
          - npm install
          - npm i --location=global azure-functions-core-tools@4
          - npm i --location=global azurite@latest
          - export FUNCTIONS_WORKER_RUNTIME="node"
          - export APPINSIGHTS_INSTRUMENTATIONKEY=""
          - export AzureWebJobsStorage="UseDevelopmentStorage=true"
          - npm run test

We ended up downgrading the Bitbucket Pipeline to Node 16, to make it work for now.

@PilotConway
Copy link

I just ran into this as well on my local machine. Running node 18 on a M1 Macbook Pro. Downgrading to 16 also worked to get around it.

@metcoder95
Copy link

Did tried using explicitly 127.0.0.1?

@BrunoBernardino
Copy link

I just ran into this as well, on M1 Macbook Air, and GitHub actions CI on Ubuntu 20.04 (but not on my local Linux machine, running a variant of Ubuntu 22.04).

Using tcp:127.0.0.1:PORT did work, but not http://localhost:PORT nor tcp:localhost:PORT, so it seems related to localhost and not the protocol.

@BrunoBernardino
Copy link

BrunoBernardino commented Feb 9, 2023

So, turns out that's not exactly the issue. wait-on seems to be working fine, and I can get tcp:localhost:PORT to work, as long as that program is listening on ipv6. This is because Node changed the ipv4 preference to ipv6 from 17+.

The solution is to make those apps listen in ipv6 or wait for them on 127.0.0.1 instead (explicit ipv4).

Reference links:

Have fun digging into those!

thesocialdev added a commit to AletheiaFact/aletheia that referenced this issue Sep 8, 2023
thesocialdev added a commit to AletheiaFact/aletheia that referenced this issue Sep 9, 2023
thesocialdev added a commit to AletheiaFact/aletheia that referenced this issue Sep 9, 2023
pepermao pushed a commit to AletheiaFact/aletheia that referenced this issue Sep 30, 2023
pepermao pushed a commit to AletheiaFact/aletheia that referenced this issue Sep 30, 2023
pepermao pushed a commit to AletheiaFact/aletheia that referenced this issue Sep 30, 2023
ReoHakase added a commit to ReoHakase/reoiam-dev that referenced this issue Mar 10, 2024
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