-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Incompatibility with loopback-connector-rest #8549
Comments
I create an example of loopback app https://github.com/Ojvar/sentry-bug-in-loopback4 in the index.ts, by calling initSentry() function, we faced with unexpected behavior :( in this example after enabling sentry curl -X 'GET' \
'http://localhost:3000/ping-get' \
-H 'accept: application/json' I received this output {
"error": {
"statusCode": 404,
"name": "Error",
"message": "{\"error\":{\"statusCode\":404,\"name\":\"NotFoundError\",\"message\":\"Endpoint \\\"POST /\\\" not found.\"}}"
}
} but, by disabling sentry, {
"greeting": "Hello from LoopBack",
"date": "2023-07-17T10:38:05.352Z",
"url": "/ping",
"headers": {
"host": "localhost:3000",
"accept": "application/json",
"content-length": "0",
"connection": "keep-alive"
}
} |
After a day of code reviewing of loopback-connector-rest package, if found that there is a incompatibility between sentry and request npm package that is used by loopback-connector-rest |
Hello, thanks for writing in. I've just checked out your reproduction, run To rule out any difference, what node version are you using? I am running Node 16, fwiw. |
Hello
I've created a pdf that contains my console screenshot
I hope that is useful
*Regards, Ojvar*
…On Wed, Jul 19, 2023 at 11:54 AM Francesco Novy ***@***.***> wrote:
Hello, thanks for writing in.
I've just checked out your reproduction, run yarn install && yarn start,
and run the GET curl you provided, and I got the correct response? So not
sure if you changed something in the repro, but I cannot reproduce any
problem?
To rule out any difference, what node version are you using? I am running
Node 16, fwiw.
—
Reply to this email directly, view it on GitHub
<#8549 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEACMK46DE3QKO2PNDWCCSTXQ6KVHANCNFSM6AAAAAA2MUZWSI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
My Node version is : v20.4.0
*Regards, Ojvar*
…On Thu, Jul 20, 2023 at 8:40 AM Amir ***@***.***> wrote:
Hello
I've created a pdf that contains my console screenshot
I hope that is useful
*Regards, Ojvar*
On Wed, Jul 19, 2023 at 11:54 AM Francesco Novy ***@***.***>
wrote:
> Hello, thanks for writing in.
>
> I've just checked out your reproduction, run yarn install && yarn start,
> and run the GET curl you provided, and I got the correct response? So not
> sure if you changed something in the repro, but I cannot reproduce any
> problem?
>
> To rule out any difference, what node version are you using? I am running
> Node 16, fwiw.
>
> —
> Reply to this email directly, view it on GitHub
> <#8549 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEACMK46DE3QKO2PNDWCCSTXQ6KVHANCNFSM6AAAAAA2MUZWSI>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
OK, that seems to be it, I can reproduce it on node 20. It works in Node 18, but not 20 for me. Now, I wonder if that is a problem on our side or in one of the dependencies... 🤔 It does seem to be related to the Http integration. While we try to figure out what's going on, you can disable the HTTP integrations like this: Sentry.init({
dsn: 'xxx',
tracesSampleRate: 1.0,
integrations: function (integrations) {
// integrations will be all default integrations
return integrations.filter(integration => integration.name !== 'Http');
},
}); That should make it run at least (but it will miss http traces/breadcrumbs - but better than nothing!) |
Thank you |
FYI I will close this in favor of #8552, which describes the same issue (request & node 20 & sentry = fail). It seems the problem is in Node 20 (or can/should be fixed there), see: nodejs/node#48921 Thank you for opening this, I suggest you watch #8552, we will keep this updated! |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
23.6.2
Framework Version
^7.58.1
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
Today, I've faced with a strange problem while using sentry in loopback framework
I defined a datasource (Rest Datasource), with a POST method on it
Without using this snippet, I can call the getToken api correctly, and I get keycloak (my remote service) data of authenticated user,
I think Sentry inner HttpWarpper module, modified original request and can't send it as it was
Is there anybody help me to solve this?
thanks ;)
Expected Result
I expect, by using Loopback-Connector-Rest in my loopback application, while using Sentry module, I could call my remote functions (with all methods GET, POST, PUSH,PUT, ...) correctly, and I receive data in json or other format
Actual Result
but, after adding that snippet, every thing was go wrong with POST, PUT, PATCH (else GET) requests
and I just receive this error:
The text was updated successfully, but these errors were encountered: