bruno icon indicating copy to clipboard operation
bruno copied to clipboard

bru run works in powershell fails in wsl

Open gajakannan opened this issue 1 year ago • 4 comments

I have checked the following:

  • [X] I use the newest version of bruno.
  • [X] 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 avatar Sep 29 '24 15:09 gajakannan

Hey @gajakannan ! Thanks for reporting this issue.

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

helloanoop avatar Sep 30 '24 05:09 helloanoop

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.

Pragadesh-45 avatar Sep 30 '24 07:09 Pragadesh-45

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!

gajakannan avatar Oct 01 '24 23:10 gajakannan

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

Pragadesh-45 avatar Oct 02 '24 04:10 Pragadesh-45

Closing this issue.

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

helloanoop avatar Oct 27 '24 21:10 helloanoop