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

bru run works in powershell fails in wsl #3223

Closed
2 tasks done
gajakannan opened this issue Sep 29, 2024 · 5 comments
Closed
2 tasks done

bru run works in powershell fails in wsl #3223

gajakannan opened this issue Sep 29, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@gajakannan
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

I have .bru files in subfolders...
bru run

works fine in powershell

image

but fails when the same is done in wsl (ubuntu distro in my case)

image

.bru file to reproduce the bug

one of the .bru file content below

meta {
name: activities
type: http
seq: 1
}

get {
url: http://localhost:5000/api/static-references/activities
body: none
auth: none
}

Screenshots/Live demo link

already provided above in the description of the bug

@gajakannan gajakannan added the bug Something isn't working label Sep 29, 2024
@helloanoop
Copy link
Contributor

Hey @gajakannan ! Thanks for reporting this issue.

@Pragadesh-45 Can you investigate this issue and see if you can reproduce it on your machine?

@Pragadesh-45
Copy link
Contributor

Hey @gajakannan!

I've set up a test collection and test API to check this, and I got the same ECONNREFUSED error you mentioned. This is likely due to the API configuration or your firewall settings.

The ECONNREFUSED error happens because WSL and Windows operate in different network environments. By default, using localhost or 127.0.0.1 might not work across them. Instead, you can connect using the Windows host IP, which you can find using cat /etc/resolv.conf in WSL.

Try accessing the API by specifying the nameserver IP (10.255.255.83 in my case) like this:

curl http://<Windows_IP_address>:<port>

Another fix is setting the server to listen on 0.0.0.0.

If this works in your case, try running bru run again. Kindly report back if you still have the same issue. I'll update my findings if I discover more.

@gajakannan
Copy link
Author

You are correct this is NOT a bru issue, just local networking issue between windows and wsl... I havent been able to solve with workaround you mentioned. nevertheless, you pointed me towards the right path. I shall figure out the solution and post back. Thanks!

@Pragadesh-45
Copy link
Contributor

Sure, Once you have the API configuration set up correctly, try connecting to the Windows localhost as mentioned :

curl http://<Windows_IP_address>:<port>

If this works, you will be able to test your API using Bruno. If I come across any workaround, I will update it here

@helloanoop
Copy link
Contributor

Closing this issue.

@gajakannan, feel free to reopen it if you need any further assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants