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

puma-dev and ruby Curb gem doesn't play well together in WSL #10175

Closed
1 of 2 tasks
rogeraraujo90 opened this issue Jun 8, 2023 · 3 comments
Closed
1 of 2 tasks

puma-dev and ruby Curb gem doesn't play well together in WSL #10175

rogeraraujo90 opened this issue Jun 8, 2023 · 3 comments

Comments

@rogeraraujo90
Copy link

Windows Version

Microsoft Windows [Version 10.0.22621.1702]

WSL Version

1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu-22.04

Other Software

rails: 3.2.0
puma-dev: 0.18.3 (go1.20.1)
curb: curb (0.9.10, 0.9.8)

Repro Steps

I'm using puma-dev to run a rails app under a custom domain. For instance, my app is running under the host: https://myapp.localhost. Through the browser, I can access my application using this URL and everything works fine. My headache starts when I try to connect with this app from another app (both running on WSL and in the same Ubuntu instance).

My second app is not under puma-dev and is running on localhost:3000, we use the CURB library to connect via code with the application on myapp.localhost but in that case, I get this error message:

Couldn't resolve host name: Could not resolve host: myapp.localhost

I'm asking the puma-dev team about this issue too but it's important to mention this is just happening on WSL. My colleagues don't use WSL and they don't have this issue.

Any tip about what might be causing this issue specifically for the WSL environment?

Expected Behavior

The apps should be able to connect as happens in non WSL environments.

Actual Behavior

The apps can't connect. Curl error happens:

Curl::Err::HostResolutionError: Couldn't resolve host name: Could not resolve host: myapp.localhost

Diagnostic Logs

No response

@OneBlue
Copy link
Collaborator

OneBlue commented Jun 8, 2023

Thanks for reporting this @rogeraraujo90. How does puma-dev actually expose this custom domain name ? Is it running a custom DNS server, or editing /etc/hosts maybe ?

I would imagine that the issue is that the DNS configuration is different between your two environments.

@rogeraraujo90
Copy link
Author

Thanks for reporting this @rogeraraujo90. How does puma-dev actually expose this custom domain name ? Is it running a custom DNS server, or editing /etc/hosts maybe ?

I would imagine that the issue is that the DNS configuration is different between your two environments.

I'm not into the puma-dev code but I can confirm it doesn't edit the /etc/hosts file.

If I can access the URL through the browser (and ping it using the Ubuntu console) but can't by using the rails curl, does that means it might be a DNS problem?

@OneBlue
Copy link
Collaborator

OneBlue commented Jun 9, 2023

Unfortunately I don't have any rails or puma-dev knowledge so I can't answer this question. I.

I see that you raised the issue on puma-dev, which I think is the best place since we'd need inside knowledge of how puma-dev works to root cause this.

Closing since this doesn't appear to be a WSL issue.

@OneBlue OneBlue closed this as completed Jun 9, 2023
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

2 participants