bru run works in powershell fails in wsl
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
but fails when the same is done in wsl (ubuntu distro in my case)
.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
Hey @gajakannan ! Thanks for reporting this issue.
@Pragadesh-45 Can you investigate this issue and see if you can reproduce it on your machine?
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.
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!
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
Closing this issue.
@gajakannan, feel free to reopen it if you need any further assistance.