sentry icon indicating copy to clipboard operation
sentry copied to clipboard

TypeError: Cannot read properties of undefined (reading 'id')

Open mukkumayc opened this issue 1 year ago • 7 comments

Environment

self-hosted (https://develop.sentry.dev/self-hosted/)

Steps to Reproduce

Go to User Feedback page. But actually it happens only with my user.

Expected Result

It loads

Actual Result

image

Product Area

User Feedback

Link

No response

DSN

No response

Version

24.3.0

mukkumayc avatar Mar 21 '24 07:03 mukkumayc

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Mar 21 '24 07:03 getsantry[bot]

Routing to @getsentry/product-owners-user-feedback for triage ⏲️

getsantry[bot] avatar Mar 22 '24 20:03 getsantry[bot]

The url in the screen shot is funny, it's got a subdomain and also /organizations/:orgSlug, but they don't match.

But more generally it looks like we're not checking for invalid responses from the issues & events endpoints.

ryan953 avatar Mar 25 '24 16:03 ryan953

I'm having the same issue, but the error on the frontend is slightly different:

TypeError: Cannot read properties of undefined (reading 'feedback')

The 400 (Bad Request) response is:

{"detail":"Invalid statsPeriod: ''"}

I'm not sure how else I can help, but please let me know if I can provide any more info

MattPurland avatar Jun 26 '24 07:06 MattPurland

@MattPurland Are you on self hosted or saas? Can you paste the URL path + params? (omitting any project/org id/slugs)

billyvg avatar Jun 27 '24 20:06 billyvg

@MattPurland Are you on self hosted or saas? Can you paste the URL path + params? (omitting any project/org id/slugs)

I'm on self-hosted, here's the URL:

http://sentry.domain.com/api/0/organizations/star/issues-count/?end=&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aunresolved%20&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aresolved%20&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aignored%20&queryReferrer=feedback_list_page&start=&statsPeriod=&utc=

end: 
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aunresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aignored%20
queryReferrer: feedback_list_page
start: 
statsPeriod: 
utc: 

MattPurland avatar Jun 28 '24 09:06 MattPurland

Comparing this to saas I'm not sure what to make of it, but it also has the same problem initially - but manages to continue to make multiple requests to the same API endpoint and works as intended:

The first one fails, just like the self-hosted:

end: 
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aunresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aignored%20
queryReferrer: feedback_list_page
start: 
statsPeriod: 
utc: 

But continues with the following, which seems to work fine:

end: 
project: 4505958713786368
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aunresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aresolved%20
query: issue.category%3Afeedback%20is%3Aunassigned%20is%3Aignored%20
queryReferrer: feedback_list_page
start: 
statsPeriod: 14d
utc: 

Followed by variations of the above, which all return successfully

This is way beyond me, but hopefully can help

MattPurland avatar Jun 28 '24 11:06 MattPurland

The url in the screen shot is funny, it's got a subdomain and also /organizations/:orgSlug, but they don't match.

But more generally it looks like we're not checking for invalid responses from the issues & events endpoints.

Is it the lack of statsPeriod the problem @ryan953 ?

bruno-garcia avatar Jul 02 '24 17:07 bruno-garcia

Hello I think we have a related issue.

TypeError: Cannot read properties of undefined (reading 'find')

console.js:36 TypeError: Cannot read properties of undefined (reading 'find')
at At (feedbackItem.tsx:31:26)
at oa (react-dom.production.min.js:167:137)
at Re (react-dom.production.min.js:290:337)
at a (react-dom.production.min.js:280:389)
at i (react-dom.production.min.js:280:320)
at n (react-dom.production.min.js:280:180)
at pi (react-dom.production.min.js:271:88)
at va (react-dom.production.min.js:273:300)
at Kr (react-dom.production.min.js:127:105)
at react-dom.production.min.js:267:273

And a 400 on this url:

/api/0/organizations/sentry/issues-count/?end=&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aunresolved%20&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aresolved%20&query=issue.category%3Afeedback%20is%3Aunassigned%20is%3Aignored%20&queryReferrer=feedback_list_page&start=&statsPeriod=&utc=

Response is:

{"detail":"Invalid statsPeriod: ''"}

Initially thought this PR would resolve the issue but it's unrelated: https://github.com/getsentry/sentry/pull/71278

Version: Sentry self-hosted v24.5.1

Llyth avatar Jul 03 '24 09:07 Llyth

Seems like #73748 and #73802 should address this @ryan953?

billyvg avatar Jul 10 '24 16:07 billyvg