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

Switch destination hasura url config to 127.0.0.1 to avoid ipv6 #343

Merged
merged 1 commit into from Mar 20, 2024

Conversation

thomas-gerber
Copy link
Contributor

Description

It appears that Node 18, which we recently moved to, favors IPv6 resolution. Given that Airbyte spawns sources and destinations as containers that run outside the Faros CE compose, this causes issues when the destination tries to connect to hasura on ::1:8080 instead of 127.0.0.1:8080. Not sure exactly why - more docker networking expertise needed.

So the current fix is just to switch from localhost to an explicit IPv4 127.0.0.1 in the destination settings, which works.

I am not touching other localhosts in the environment variables, as this behavior appears to be specific to code running on Node in a container. I also check that the mock-data scripts are unaffected (they do not run in a container).

Type of change

(Delete what does not apply)

  • Bug fix (non-breaking change which fixes an issue)

Checklist

(Delete what does not apply)

  • Have you checked that there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

@thomas-gerber
Copy link
Contributor Author

Note that I am not a big fan of that fix, it just looks painful to turn ipv6 on for docker (seems off by default currently)

@tovbinm tovbinm merged commit 511d67d into main Mar 20, 2024
2 checks passed
@tovbinm tovbinm deleted the localhost_ipv6_issue branch March 20, 2024 23:03
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2024
@ogusak
Copy link
Contributor

ogusak commented Mar 20, 2024

@thomas-gerber - this looks more of an issue of the host OS rather than Node's preference. The new version of Node just does not sort the list of entries returned for localhost name. That is, the first entry is picked from the list of IPs returned by the host OS in whatever order it prefers them to be.

@thomas-gerber
Copy link
Contributor Author

@thomas-gerber - this looks more of an issue of the host OS rather than Node's preference. The new version of Node just does not sort the list of entries returned for localhost name. That is, the first entry is picked from the list of IPs returned by the host OS in whatever order it prefers them to be.

Not sure: here is my /etc/hosts

thomasgerber@Thomass-MacBook-Pro-3 faros-community-edition % cat /etc/hosts                                     
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
# Added by Docker Desktop
# To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal
# End of section

It should have resolved it to 127.0.0.1.

@ogusak
Copy link
Contributor

ogusak commented Mar 21, 2024

The order is determined by the code that returns that list. And we'd need to test it from the docker container where node runs. ping localhost from that container should show the IP.
nodejs/node#40537 (comment)
https://stackoverflow.com/a/74216410

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

Successfully merging this pull request may close these issues.

None yet

3 participants