console icon indicating copy to clipboard operation
console copied to clipboard

Cannot read properties of undefined (reading 'find')

Open kjozsa opened this issue 2 years ago • 10 comments

Trying to push the create topic button on the UI after getting connected to an AWS MSK broker:

Type: TypeError

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

Stack (Decoded): find (components/pages/topics/Topic.List.tsx:402:13) tryGetBrokerConfig (components/pages/topics/Topic.List.tsx:490:42) call (../node_modules/mobx/src/core/derivation.ts:183:23) trackDerivedFunction (../node_modules/mobx/src/core/computedvalue.ts:250:18) computeValue_ (../node_modules/mobx/src/core/computedvalue.ts:218:30) trackAndCompute (../node_modules/mobx/src/core/computedvalue.ts:183:25) get (../node_modules/mobx/src/types/observableobject.ts:121:38) getObservablePropValue_ (../node_modules/mobx/src/types/observableobject.ts:701:35) key (../node_modules/mobx/src/types/observableobject.ts:182:28) get_ (../node_modules/mobx/src/types/dynamicobject.ts:30:30)

Stack (Raw): TypeError: Cannot read properties of undefined (reading 'find') at tryGetBrokerConfig (http://localhost:8081/static/js/506.8f55509e.chunk.js:1:462585) at get partitions (http://localhost:8081/static/js/506.8f55509e.chunk.js:1:464066) at trackDerivedFunction (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:820842) at ComputedValue.computeValue_ (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:818655) at ComputedValue.trackAndCompute (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:818435) at ComputedValue.get (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:817582) at ObservableObjectAdministration.getObservablePropValue_ (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:852995) at Object.get (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:858585) at ObservableObjectAdministration.get_ (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:853647) at Object.get (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:834536)

Components:

at CreateTopicModalContent (http://localhost:8081/static/js/506.8f55509e.chunk.js:1:322301)
at div
at div
at http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:339964
at div
at http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:340115
at DomWrapper (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:1027048)
at http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:1030135
at http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:341717
at div
at div
at Dialog (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:342672)
at http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:337544
at DialogWrap (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:344934)
at NoFormStyle (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:284641)
at NoCompactStyle (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:459017)
at Modal (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:346003)
at observerComponent (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:791987)
at div
at section
at http://localhost:8081/static/js/910.aa630b19.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:222225)
at Section (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:490220)
at Section
at div
at http://localhost:8081/static/js/910.aa630b19.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:222225)
at http://localhost:8081/static/js/550.374d74ba.chunk.js:2:197006
at div
at VisualElementHandler (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:308040)
at MotionComponent (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:308912)
at PageContent (http://localhost:8081/static/js/506.8f55509e.chunk.js:1:24248)
at TopicList (http://localhost:8081/static/js/506.8f55509e.chunk.js:1:462071)
at Route (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:103400)
at Switch (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:104474)
at PresenceChild (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:299730)
at AnimatePresence (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:300619)
at RouteView
at ErrorDisplay (http://localhost:8081/static/js/733.f66b3d16.chunk.js:1:24098)
at div
at observerComponent (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:791987)
at main
at http://localhost:8081/static/js/910.aa630b19.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:222225)
at Container2 (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:205300)
at div
at http://localhost:8081/static/js/910.aa630b19.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:222225)
at Grid2 (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:193348)
at Switch (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:104474)
at RequireAuth (http://localhost:8081/static/js/733.f66b3d16.chunk.js:1:39593)
at ErrorBoundary (http://localhost:8081/static/js/733.f66b3d16.chunk.js:1:746)
at EnvironmentProvider (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:65951)
at ColorModeProvider (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:62534)
at ThemeProvider (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:13006)
at ThemeProvider (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:60417)
at ChakraProvider (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:66548)
at ChakraProvider2 (http://localhost:8081/static/js/550.374d74ba.chunk.js:2:81845)
at Router (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:100260)
at BrowserRouter (http://localhost:8081/static/js/910.aa630b19.chunk.js:2:94756)
at observerComponent (http://localhost:8081/static/js/178.f9517ba1.chunk.js:2:791987)

Environment: NODE_ENV : production GIT_SHA : 1db8cedf2d9d8ac087961476cf9e885ad5e1118a GIT_REF : master BUILD_TIMESTAMP : 1694701166 PLATFORM_VERSION: v23.2 BUILT_FROM_PUSH : false

Location: Protocol: http: Path : /topics Search : Hash :

kjozsa avatar Oct 18 '23 14:10 kjozsa

Hey @kjozsa , thanks for filing the issue. What version of Console are you using? Does this happen every time or is it a transient issue?

Do you mind testing if this also happens in the latest version of Console? This is the Docker image, built yesterday: redpandadata/console-unstable:master-9da0858

weeco avatar Oct 19 '23 07:10 weeco

sure, I'm glad to help with testing this. I replaced our docker image on k8s to this redpandadata/console-unstable:master-9da0858 and get the same error upon clicking Create Topic:

`Type: TypeError

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

Stack (Decoded): find (components/pages/topics/Topic.List.tsx:429:13) tryGetBrokerConfig (components/pages/topics/Topic.List.tsx:515:42) call (../node_modules/mobx/src/core/derivation.ts:183:23) trackDerivedFunction (../node_modules/mobx/src/core/computedvalue.ts:250:18) computeValue_ (../node_modules/mobx/src/core/computedvalue.ts:218:30) trackAndCompute (../node_modules/mobx/src/core/computedvalue.ts:183:25) get (../node_modules/mobx/src/types/observableobject.ts:121:38) getObservablePropValue_ (../node_modules/mobx/src/types/observableobject.ts:701:35) key (../node_modules/mobx/src/types/observableobject.ts:182:28) get_ (../node_modules/mobx/src/types/dynamicobject.ts:30:30)

Stack (Raw): TypeError: Cannot read properties of undefined (reading 'find') at tryGetBrokerConfig (http://localhost:8081/static/js/552.80c903db.chunk.js:1:497214) at get partitions (http://localhost:8081/static/js/552.80c903db.chunk.js:1:498666) at trackDerivedFunction (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:625961) at ComputedValue.computeValue_ (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:623774) at ComputedValue.trackAndCompute (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:623554) at ComputedValue.get (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:622701) at ObservableObjectAdministration.getObservablePropValue_ (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:657796) at Object.get (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:663386) at ObservableObjectAdministration.get_ (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:658448) at Object.get (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:639337)

Components:

at CreateTopicModalContent (http://localhost:8081/static/js/552.80c903db.chunk.js:1:357855)
at div
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:181640
at section
at VisualElementHandler (http://localhost:8081/static/js/928.70352346.chunk.js:2:531047)
at MotionComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:531919)
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:159735
at div
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:165891
at div
at FocusLockUI (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:93663)
at FocusLockUICombination
at FocusLock (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:108286)
at ModalFocusScope (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:174883)
at http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:175582
at DefaultPortal (http://localhost:8081/static/js/928.70352346.chunk.js:2:368250)
at Portal
at PresenceChild (http://localhost:8081/static/js/928.70352346.chunk.js:2:522737)
at AnimatePresence (http://localhost:8081/static/js/928.70352346.chunk.js:2:523626)
at Modal (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:165271)
at observerComponent (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:597112)
at div
at section
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at Section (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:309674)
at Section
at div
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at http://localhost:8081/static/js/928.70352346.chunk.js:2:343089
at div
at VisualElementHandler (http://localhost:8081/static/js/928.70352346.chunk.js:2:531047)
at MotionComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:531919)
at PageContent (http://localhost:8081/static/js/552.80c903db.chunk.js:1:20616)
at TopicList (http://localhost:8081/static/js/552.80c903db.chunk.js:1:496700)
at Route (http://localhost:8081/static/js/928.70352346.chunk.js:2:162665)
at Switch (http://localhost:8081/static/js/928.70352346.chunk.js:2:163739)
at PresenceChild (http://localhost:8081/static/js/928.70352346.chunk.js:2:522737)
at AnimatePresence (http://localhost:8081/static/js/928.70352346.chunk.js:2:523626)
at RouteView
at observerComponent (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:597112)
at div
at observerComponent (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:597112)
at main
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at Container2 (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:150821)
at div
at http://localhost:8081/static/js/928.70352346.chunk.js:2:12610
at ChakraComponent (http://localhost:8081/static/js/928.70352346.chunk.js:2:433108)
at Grid2 (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:142275)
at Switch (http://localhost:8081/static/js/928.70352346.chunk.js:2:163739)
at RequireAuth (http://localhost:8081/static/js/439.002cc7ae.chunk.js:1:36997)
at ErrorBoundary (http://localhost:8081/static/js/439.002cc7ae.chunk.js:1:1258)
at EnvironmentProvider (http://localhost:8081/static/js/928.70352346.chunk.js:2:379932)
at ColorModeProvider (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:41915)
at ThemeProvider (http://localhost:8081/static/js/928.70352346.chunk.js:2:13006)
at ThemeProvider (http://localhost:8081/static/js/928.70352346.chunk.js:2:436719)
at ChakraProvider (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:44991)
at ChakraProvider2 (http://localhost:8081/static/js/299.ee8b8afa.chunk.js:2:45626)
at Router (http://localhost:8081/static/js/928.70352346.chunk.js:2:159525)
at BrowserRouter (http://localhost:8081/static/js/928.70352346.chunk.js:2:154054)
at observerComponent (http://localhost:8081/static/js/417.4659cf69.chunk.js:2:597112)

Environment: NODE_ENV : production GIT_SHA : 9da0858cf68ba8e0a839231db6ff99386a51834b GIT_REF : master BUILD_TIMESTAMP : 1697657019 PLATFORM_VERSION: v23.2 BUILT_FROM_PUSH : true

Location: Protocol: http: Path : /topics Search : Hash :

`

kjozsa avatar Oct 19 '23 08:10 kjozsa

oh and previously it was happening on docker.redpanda.com/redpandadata/console:v2.3.3 and I suspect it's some lack of permission issue in the background between our kubernetes cluster and AWS MSK, but even if so, you should likely refine the error message a bit.. I'll get back to you as we have more details on the reasons why this might be happening.

kjozsa avatar Oct 19 '23 08:10 kjozsa

Thanks @kjozsa , could you take a look at the network tab before you click the create topic button? Without looking into further detail I imagine what may happen here is that the describe broker configs request fails. The reason why we request the broker configs is that we can show the default values in the create topic dialogue for example for the cleanup.policy, replication factor etc.

Obviously it should still be possible to create topics, even if you can't describe the broker configs. To verify the hypothesis it would be helpful to see the network requests/responses.

weeco avatar Oct 19 '23 08:10 weeco

I'm not sure.. I see only a single failing call in the Network tab: image

kjozsa avatar Oct 19 '23 08:10 kjozsa

Well I guess this kind of explains it, from the redpanda pod logs: image

kjozsa avatar Oct 19 '23 08:10 kjozsa

Yes this supports my hypothesis, but creating topics should still be working. However, the Console experience is best when it has all the required Kafka permissions of course :-).

weeco avatar Oct 19 '23 08:10 weeco

Yes, I do agree.. you likely don't want to simply crash though in such cases :slightly_smiling_face:

kjozsa avatar Oct 19 '23 08:10 kjozsa

I'm also getting the same error when trying to click the 'Create topic' button while redpanda-console is configured to communicate with MSK Serverless:

In addition to the same issues as noted above (TypeError and /api/users/me returning a 405), the container logs also get a number of errors as follows:

{"level":"warn","ts":"2024-07-08T20:14:39.784Z","msg":"failed to describe broker config","broker_id":31,"error":"INVALID_REQUEST: Amazon MSK Serverless doesn't support fetching broker or broker-logger configurations."}
{"level":"warn","ts":"2024-07-08T20:14:39.784Z","msg":"failed to describe broker config","broker_id":13,"error":"INVALID_REQUEST: Amazon MSK Serverless doesn't support fetching broker or broker-logger configurations."}
{"level":"warn","ts":"2024-07-08T20:14:39.788Z","msg":"failed to describe broker config","broker_id":10,"error":"INVALID_REQUEST: Amazon MSK Serverless doesn't support fetching broker or broker-logger configurations."}
{"level":"warn","ts":"2024-07-08T20:14:39.790Z","msg":"failed to describe broker config","broker_id":103,"error":"INVALID_REQUEST: Amazon MSK Serverless doesn't support fetching broker or broker-logger configurations."}

Does redpanda-console not support MSK Serverless currently?

For context, I've tried both docker.redpanda.com/redpandadata/console:v2.6.0 and docker.redpanda.com/redpandadata/console:v2.4.6 with the same result

klagroix avatar Jul 08 '24 20:07 klagroix

@klagroix We don't test against MSK serverless, but we test against Redpanda Serverless which most likely has a better Kafka API support too.

weeco avatar Jul 09 '24 09:07 weeco