bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Error invoking remote method 'send-http-request': TypeError: Cannot read properties of undefined (reading 'data')

Open thegitty opened this issue 1 year ago • 20 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

Using Bruno 1.13.1. Trying to execute a POST-Request.

Getting the error (in the Response tab): "Error invoking remote method 'send-http-request': TypeError: Cannot read properties of undefined (reading 'data')"

Seems to be related to the response.

I get this error message when the server cannot be reached (e.g. missing VPN connection or not started local server and trying to access localhost).

Not a blocker, but did lead to confusion as the error message is not clear enough. Maybe this can be improved.

No message / error in console.

.bru file to reproduce the bug

No response

Screenshots/Live demo link

image

thegitty avatar Apr 17 '24 12:04 thegitty

Seems like baseUrl is undefined, so it's displayed in red. What URL is actually shown in the timeline tab?

francesconi avatar Apr 17 '24 13:04 francesconi

Seems like baseUrl is undefined, so it's displayed in red. What URL is actually shown in the timeline tab?

yes, when I took the screenshot I didn't select an according environment. I have updated the screenshot now, still having the same issue with a selected environment (timeline tab shows the complete url, no placeholder).

EDIT: I now was able to narrow it down, indeed it's not a major issue but did lead to confusion on my side. Did update the ticket.

Sorry for any inconvenience caused.

thegitty avatar Apr 17 '24 13:04 thegitty

I just installed Bruno and also getting this same error with the first endpoint that I entered (the open-ai completion endpoint).

I am not sure where "data" is being referenced, but I am using a variable for my Open AI token, although the variable is showing as green, so I guess it is reading it correctly.

logicpeters avatar Apr 18 '24 15:04 logicpeters

I think my issue ^ is related to the environment, as I was able to fix this by restarting Bruno and creating a new environment with my api token. Note that when I restarted Bruno, the initial environment that I created had disappeared. I tried to recreate the environment with the same name, and it threw an error. Only when I created a new environment with a different name did it create, and adding the api_token environment variable worked this second time.

logicpeters avatar Apr 18 '24 16:04 logicpeters

I am also getting the same error. I am running on v1.13.1 in windows.

spukkala avatar Apr 22 '24 04:04 spukkala

I have the same issue. It was caused by SSL cert validation failure (issue with ZScaler). Error message should be definitely improved.

assembler avatar Apr 22 '24 06:04 assembler

work around: disable "SSL/TLS Certificate Verification" via Bruno > Preferences > General

felixkamille avatar May 02 '24 19:05 felixkamille

work around: disable "SSL/TLS Certificate Verification" via Bruno > Preferences > General

Thanks Felix, for me it worked!

obicco avatar May 03 '24 09:05 obicco

Disabling SSL/TLS Certificate validation did not work for me. I'm still getting the error on my login request. Our certificat is old, but that is only because this is for a localhost instance. Not sure if there is another workaround. I'm getting the error for 'get' instead of 'data'

lanes100 avatar May 29 '24 19:05 lanes100

Problem is just as relevant. Disabling SSL/TLS Certificate did not help. It can be cured by restarting the application, but after 4-5 requests the error returns.

An example of a test where I have the same problem.

expect(jsonData.active[bru.getEnvVar("test")].status).to.eql("ACTIVE");

Cannot read properties of undefined (reading 'status')

Mad0Cat avatar Jun 03 '24 11:06 Mad0Cat

Same error message also appears when trying to send a https request to a http endpoint

CptnFizzbin avatar Jul 11 '24 18:07 CptnFizzbin

Faced same issue after importing postman collection which has code under Tests. Issue resolved after commenting script code under Tests.

saisnigdha93 avatar Jul 15 '24 10:07 saisnigdha93

I had some issues with Postman tests too. Removing those fixed for me as well

eudennis avatar Aug 13 '24 13:08 eudennis

i have the same issue, but it do not appear in postman, holely shit

xs-alpha avatar Aug 24 '24 13:08 xs-alpha

Same issue here. I was setting some variables in the Pre-Request section of my collection. Commenting out the script solved the problem.

As a side note: It would be nice if you could set variables on collection level.

Stitch10925 avatar Sep 11 '24 07:09 Stitch10925

I also have this issue, it's a post request and following the instructions above does not help

albinalm avatar Sep 11 '24 14:09 albinalm

I get this issue with non-ascii characters in the body JSON.

toehser avatar Sep 11 '24 17:09 toehser

Same here. It seems to happen with my domain name in particular

image

Using e.g. google.com and it works just fine

Bradleykingz avatar Sep 23 '24 07:09 Bradleykingz

also affected for http communication to localhost:

http://localhost:3500/test

GangGreenTemperTatum avatar Sep 29 '24 13:09 GangGreenTemperTatum

In my case, the problem was with the redirect of the endpoint (301). I added a pre script to disable automatic redirect and fixed. Based on https://github.com/usebruno/bruno/issues/1376#issuecomment-1888729172

thiagocavalcanti avatar Oct 01 '24 21:10 thiagocavalcanti

For me, I had a debug tool throwing a bunch of error information in the headers.

I had to go back to my RapidAPI client to actually see/get the response to see what was going on.
Disabled the debug tool and it worked in Bruno again.

It looks like my requests were successful - Bruno just couldn't handle/process the large headers of gibberish maybe? Not sure.

Screenshot 2024-10-24 at 8 27 38 AM

drewjoh avatar Oct 24 '24 13:10 drewjoh

I'm triggering this issue from a post-response script when the response is unexpectedly a 400 Bad Request. I do expect the script to fail (missing field in body), but it shouldn't prevent me from seeing the details of the bad request response.

XA21X avatar Dec 05 '24 09:12 XA21X

Error invoking remote method 'send-http-request': Error: Error: 'bruno' is not defined

Image

Can Anyone please help me above issue

prasanth687 avatar Jan 21 '25 05:01 prasanth687

Hey there, has anybody resolved this issue? I've tried all suggestions without success (I'm behind a corporate proxy):

  • I've disabled SSL/TLS Certificate Verification
  • I've setup proxy configuration

I have to mention that I can do calls from postman or from curl over a WSL terminal. I can also make calls to company internal URLs, but not external because then I get the error mentioned in this thread.

marioaae avatar Mar 14 '25 16:03 marioaae

Error invoking remote method 'send-http-request': Error: Error: 'bruno' is not defined

Image Can Anyone please help me above issue

Your script doesn't seem to be correct. For example, it should be bru.setEnvVar instead of bruno.setEnvVar. Can you update and try again?

You can refer to the documentation for reference: https://docs.usebruno.com/testing/script/getting-started

I'm triggering this issue from a post-response script when the response is unexpectedly a 400 Bad Request. I do expect the script to fail (missing field in body), but it shouldn't prevent me from seeing the details of the bad request response.

Also we are updating the post response script error logs, these will no longer effect the actual response https://github.com/usebruno/bruno/pull/4082

anusree-bruno avatar Mar 15 '25 16:03 anusree-bruno

We're also updating the timeline to display more details, including request headers, body, response headers, and more. Hopefully, this will help with debugging these issues.

anusree-bruno avatar Mar 15 '25 16:03 anusree-bruno