Skip to content
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

[Bug]: Error: Cannot read properties of undefined (reading 'name') #1724

Open
1 of 3 tasks
breisfeld opened this issue Jan 13, 2025 · 9 comments
Open
1 of 3 tasks

[Bug]: Error: Cannot read properties of undefined (reading 'name') #1724

breisfeld opened this issue Jan 13, 2025 · 9 comments
Labels
bug Something isn't working triage Needs triage

Comments

@breisfeld
Copy link

breisfeld commented Jan 13, 2025

Current Behavior

I have created a widgets.json file mirroring an example in the documentation (https://docs.waveterm.dev/customwidgets).

When I run it, I get the following error

Error: Cannot read properties of undefined (reading 'name')

TypeError: Cannot read properties of undefined (reading 'name')
    at SingleLinePlot (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:98650:24)
    at Nh (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:12960:10)
    at Vk (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15903:14)
    at Uk (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15597:15)
    at Tk (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15591:27)
    at Ik (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15576:9)
    at Nk (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15307:10)
    at Gk (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:15243:62)
    at J2 (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:9975:22)
    at MessagePort.R2 (file:///opt/Wave/resources/app.asar/dist/frontend/assets/index-DfyGA07g.js:10003:17)

Expected Behavior

I expect that my output would be similar to that in the documentation

Steps To Reproduce

  1. Create a widgets.json file with the following contents:
{
    "all-cpu" : {
        "icon": "chart-scatter",
        "label": "all-cpu",
        "blockdef": {
            "meta": {
                "view": "sysinfo",
                "sysinfo:type": "All CPU"
            }
        }
    }
}
  1. Click the all-cpu button in the toolbar.

Wave Version

Client Version 0.10.4 (202412210242)

Platform

Linux

OS Version/Distribution

Linux Mint 21.3: Kernel 6.8.0-51-generic #52~22.04.1-Ubuntu

Architecture

x64

Anything else?

Changing sysinfo:type from ALL CPU to CPU + Mem works as documented.

As per the instructions, I installed Wave through snap

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@breisfeld breisfeld added bug Something isn't working triage Needs triage labels Jan 13, 2025
@esimkowitz
Copy link
Member

That's very strange, I am unable to reproduce on Ubuntu (I don't have Mint installed). To confirm, is this the exact contents of your widgets.json file? Could you send us your logs? You can find them at wsh wavepath log

@breisfeld
Copy link
Author

First, thank you for responding to my ticket.

To confirm, the widgets.json file is exactly as noted above.

Now, since restarting my machine, I am experiencing new behavior. Clicking the all-cpu button brings up what looks like a plot for a single cpu. When I click on sysinfo and select as the plot type ALL CPU, I get the error shown above.

I am attaching my logfile. I deleted it to start fresh and and then restarted wave to try a few things. Hopefully there is some useful info in there.
waveapp.log

@esimkowitz
Copy link
Member

Wow that's a lot of CPUs! Are you running a Threadripper?

@breisfeld
Copy link
Author

I wish. It's just an HP Z8 G4 workstation with 2x Xeon Golds.

@oneirocosm
Copy link
Member

I think I have an idea of where the .name access is happening, but I'm not sure what's causing it to get in a state where it causes an error. Could you try the following:

  1. right click the header (top of the sysinfo block) and click Copy BlockId
  2. in a terminal run, wsh getmeta -b <paste block id here> (paste the block id you got from step 1 in that spot)

It should spit out a few of the block properties. For instance, the output when i run it looks like

{
  "graph:metrics": [
    "cpu:0",
    "cpu:1",
    "cpu:2",
    "cpu:3",
    "cpu:4",
    "cpu:5",
    "cpu:6",
    "cpu:7",
    "cpu:8",
    "cpu:9",
    "cpu:10",
    "cpu:11"
  ],
  "sysinfo:type": "All CPU",
  "view": "sysinfo"
}

@breisfeld
Copy link
Author

breisfeld commented Jan 15, 2025

This is what I get when trying the procedure for the block that shows the errors:

$ wsh getmeta -b 4470c10a-8396-4e60-a84b-d04068dd4f0b                                                                                                      1 ↵
{
  "graph:metrics": [
    "cpu:0",
    "cpu:1",
    "cpu:2",
    "cpu:3",
    "cpu:4",
    "cpu:5",
    "cpu:6",
    "cpu:7",
    "cpu:8",
    "cpu:9",
    "cpu:10",
    "cpu:11",
    "cpu:12",
    "cpu:13",
    "cpu:14",
    "cpu:15",
    "cpu:16",
    "cpu:17",
    "cpu:18",
    "cpu:19",
    "cpu:20",
    "cpu:21",
    "cpu:22",
    "cpu:23",
    "cpu:24",
    "cpu:25",
    "cpu:26",
    "cpu:27",
    "cpu:28",
    "cpu:29",
    "cpu:30",
    "cpu:31",
    "cpu:32",
    "cpu:33",
    "cpu:34",
    "cpu:35",
    "cpu:36",
    "cpu:37",
    "cpu:38",
    "cpu:39",
    "cpu:40",
    "cpu:41",
    "cpu:42",
    "cpu:43",
    "cpu:44",
    "cpu:45",
    "cpu:46",
    "cpu:47"
  ],
  "sysinfo:type": "All CPU",
  "view": "sysinfo"
}

Here's what I get for the sysinfo, ALL CPU (my widget), and CPU + Mem graph blocks:


$ wsh getmeta -b 13c40b75-b419-4dfd-88b5-7fe37664fc9b
{
  "view": "sysinfo"
}

$ wsh getmeta -b 72f7fa4a-5a90-4a8d-9d31-06deebcfc871                                    
{
  "sysinfo:type": "ALL CPU",
  "view": "sysinfo"
}

$ wsh getmeta -b 4470c10a-8396-4e60-a84b-d04068dd4f0b                                    
{
  "graph:metrics": [
    "cpu",
    "mem:used"
  ],
  "sysinfo:type": "CPU + Mem",
  "view": "sysinfo"
}

@oneirocosm
Copy link
Member

I wouldn't expect an all caps ALL CPU to work, so that part doesn't surprise me. But the regular All CPU failing does surprise me. I'm wondering if there's a timing issue happening. I'll see if I can resolve the .name issue for the next release and see if that takes care of it.

@breisfeld
Copy link
Author

breisfeld commented Jan 15, 2025

Thank you for looking into this. The all caps ALL CPU was taken from here. Using "sysinfo:type": "All CPU" in my widgets.json also leads to the above name error.

oneirocosm added a commit that referenced this issue Jan 16, 2025
While it is rare, we have had users report an error where the access of
`.name` in SingleLinePlot causes a bug. The only time this could happen
would be a null `yvalMeta`. This makes it so the .name check is skipped
if yvalMeta is null. Addresses #1724.
@breisfeld
Copy link
Author

After updating to Client Version 0.11.0 (202501250008), the All CPU functionality is working.

Thank you to all those involved in this fix and in the development of wave in general!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs triage
Projects
None yet
Development

No branches or pull requests

3 participants