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

bug: force ipv4 instead of localhost #200

Merged
merged 4 commits into from
Sep 3, 2024
Merged

bug: force ipv4 instead of localhost #200

merged 4 commits into from
Sep 3, 2024

Conversation

no2chem
Copy link
Contributor

@no2chem no2chem commented Oct 26, 2022

This PR fixes an issue in Node 18+ which causes tests to never launch.

The root cause is in nodejs/node#40702 - essentially localhost is ambiguously defined as both 127.0.0.1 and ::1. Node 16 forced 127.0.0.1, whereas node 18+ just uses whatever the OS gives back as a result of getaddrinfo(3) -- on macOS it happens to be ::1 -- but the near sandbox is set to explicitly listen on ipv4 (0.0.0.0:random port).

So, this PR fixes the issue by forcing 127.0.0.1 instead of localhost for the sandbox RPC.

This PR closes #168

@idea404
Copy link

idea404 commented Oct 26, 2022

I'd suggest adding these node versions to the CI in tests-sandbox.yml to assert this feature

@no2chem
Copy link
Contributor Author

no2chem commented Oct 26, 2022

@idea404 done

Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had a similar issue with CLI, thanks @no2chem !
@ailisp do you have access to turn on "On approval" test runs in Workspaces JS? It would be cool to run tests before the merge.

@ailisp
Copy link
Member

ailisp commented Oct 27, 2022

@volovyks I don't have permissions either, let me ask Arthur

@robdefeo
Copy link

Please can this be merged and released, I spent a long time getting stuck and this looks like it's the solution. I'm sure there are many others using Mac and LTS node

@volovyks
Copy link
Collaborator

@robdefeo for some reason I can not run CI here. Created a separate PR to test Node 18, but faced a dependencie issue that is not fixed here aswell. #208

Error:

[email protected]: The engine "node" is incompatible with this module. Expected version "^16 || ^15 || ^14 || ^13 || ^12 || ^11 || ^10 || ^9 || ^8 || ^7 || ^6". Got "18.7.0"
error Found incompatible module.

Do you have the same issue?

@robdefeo
Copy link

Not sure of the exact cause though I'd suggest upgrading the version of xo. In package json is a bit old "^0.44.0" where as the current version which appears circa 2 years old. Version [0.53.1](https://www.npmjs.com/package/xo/v/0.53.1) is the latest which may have some updates. If this doesn't work then it warrants a further look.

@volovyks volovyks closed this Feb 27, 2023
@volovyks volovyks reopened this Feb 27, 2023
@volovyks
Copy link
Collaborator

Hey @no2chem ! Looks like we fixed the CI, can you please merge current "main" to your branch?

@no2chem
Copy link
Contributor Author

no2chem commented Mar 24, 2023

hi @volovyks - sorry for the delay. rebased and pushed.

@gagdiez
Copy link
Contributor

gagdiez commented Jan 25, 2024

all tests are passing, the change is clear, this LGTM @fospring

@@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest]
node-version: [14, 16]
node-version: [14, 16, 18, 20]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @no2chem! This should resolve the conflicts and we can merge the PR.

Suggested change
node-version: [14, 16, 18, 20]
node-version: [16, 18, 20]

@frol
Copy link
Contributor

frol commented Sep 3, 2024

@race-of-sloths invite

@race-of-sloths
Copy link

@frol Thank you for calling!

@no2chem Thank you for the contribution! Join Race of Sloths by simply mentioning me in your comment/PRs description and start collecting Sloth Points through contributions to open source projects.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@frol frol merged commit 46fb229 into near:main Sep 3, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

Unable to run on Node.js 17.9.0/18.2.0
9 participants