KVM Page Fails to load with error "An unexpected error has occurred, please try refreshing your browser window."

Bug #1912727 reported by Elliot Lepley
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Caleb Ellis
2.9
Fix Released
High
Alberto Donato
maas-ui
Fix Released
Unknown

Bug Description

MaaS version: 2.9.1

Deployment: 1x Region+Rack Controller + 1x Rack Controller. External PostgreSQL 12 DB.

Issue seems to have came up after the restarting of the main database. All other pages in the web UI load except for the KVM page which has the error "An unexpected error has occurred, please try refreshing your browser window."

Running a grep to find any reference of the KVM page in logs returns the following:

grep -rnw /var/snap/ -e "/MAAS/r/kvm"
/var/snap/maas/common/log/regiond.log:275370:2021-01-22 03:34:17 regiond: [info] My_IP GET /MAAS/r/kvm HTTP/1.1 --> 200 OK (referrer: -; agent: Mozilla /5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0)
/var/snap/maas/common/log/regiond.log:275374:2021-01-22 03:34:20 regiond: [info] 185.216.144.10 GET /MAAS/r/kvm HTTP/1.1 --> 304 NOT_MODIFIED (referrer: -; agen t: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84. 0)
/var/snap/maas/common/log/regiond.log:296180:2021-01-22 05:36:43 regiond: [info] My_IP GET /MAAS/r/kvm HTTP/1.1 --> 304 NOT_MODIFIED (referrer: -; agen t: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84. 0)
/var/snap/maas/common/log/regiond.log:296195:2021-01-22 05:38:36 regiond: [info] My_IP GET /MAAS/r/kvm HTTP/1.1 --> 200 OK (referrer: -; agent: Mozilla /5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0)
/var/snap/maas/common/log/regiond.log:296222:2021-01-22 05:40:34 regiond: [info] My_IP GET /MAAS/r/kvm HTTP/1.1 --> 200 OK (referrer: -; agent: Mozilla /5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0)

Have tried restarting the controllers, the database and clearing any local caches. All other pages seem to load which localizes the problem to how the KVM page in the web ui is different?

Tags: ui

Related branches

tags: added: ui
Changed in maas-ui:
importance: Undecided → Unknown
Revision history for this message
John Lutheran (johnnybinator) wrote :

I have the same issue. I can recreate it easily. I have a fresh install of MAAS 2.9 running and can see the Machines page great. I add an LXD server and the machines page shows the error "Error: An unexpected error has occurred, please try refreshing your browser window."

Nothing too special about the LXD servers. Just Ubuntu built to setup an LXD cluster.

Revision history for this message
Caleb Ellis (caleb-ellis) wrote :

Can you share what shows up in the browser devtools console when the error occurs?

Revision history for this message
Derek DeMoss (derek-pdl) wrote :

Same issue here immediately upon upgrade. Using Snaps, went from 2.8->2.9.1

I got three unexpanded lines saying

```
TypeError: undefined is not an object (evaluating 'r.find')
```

Upon expanding one I see:

```
[Error] TypeError: undefined is not an object (evaluating 'r.find')
WS — ui.js:1
Gi — ui.js:51:58187
vs — ui.js:51:104434
cu — ui.js:51:96982
su — ui.js:51:96905
Js — ui.js:51:93931
Js
(anonymous function) — ui.js:51:45574
(anonymous function) — ui.js:59:4098
Va — ui.js:51:45521
Ka — ui.js:51:45447
eu — ui.js:51:94227
notify — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1
[native code]
d — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1
ya — ui.js:1
ka — ui.js:1
wa — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1
d — ui.js:1
f — ui.js:1
u — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1
d — ui.js:1
f — ui.js:1
u — ui.js:1
s — ui.js:1
put — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1
(anonymous function) — ui.js:1

 es (2.b95c9f9b4830ef732b2f.js:46:83130)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:46:90123)
 li (2.b95c9f9b4830ef732b2f.js:46:48549)
 Lo (2.b95c9f9b4830ef732b2f.js:46:69342)
 cu (2.b95c9f9b4830ef732b2f.js:46:97584)
 su (2.b95c9f9b4830ef732b2f.js:46:97507)
 Js (2.b95c9f9b4830ef732b2f.js:46:94499)
 Js
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:46:45841)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:53:4156)
 Va (2.b95c9f9b4830ef732b2f.js:46:45788)
 Ka (2.b95c9f9b4830ef732b2f.js:46:45722)
 eu (2.b95c9f9b4830ef732b2f.js:46:94795)
 notify (2.b95c9f9b4830ef732b2f.js:67:904064)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:904711)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:904787)
 (anonymous function)
 d (2.b95c9f9b4830ef732b2f.js:67:911477)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:969900)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:963110)
 ya (2.b95c9f9b4830ef732b2f.js:67:961029)
 ka (2.b95c9f9b4830ef732b2f.js:67:961243)
 wa (2.b95c9f9b4830ef732b2f.js:67:961086)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:963066)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:967672)
 d (2.b95c9f9b4830ef732b2f.js:67:968598)
 f (2.b95c9f9b4830ef732b2f.js:67:968105)
 u (2.b95c9f9b4830ef732b2f.js:67:968381)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:963867)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:967672)
 d (2.b95c9f9b4830ef732b2f.js:67:968598)
 f (2.b95c9f9b4830ef732b2f.js:67:968105)
 u (2.b95c9f9b4830ef732b2f.js:67:968381)
 s (2.b95c9f9b4830ef732b2f.js:67:962908)
 put (2.b95c9f9b4830ef732b2f.js:67:961960)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:984519)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:984648)
 (anonymous function) (2.b95c9f9b4830ef732b2f.js:67:1479892)
```

This is a pretty critical bug for us, we're primarily using MAAS as a KVM hypervisor management solution.

Anything else you need to help troubleshoot this?

Thank you!

Revision history for this message
Derek DeMoss (derek-pdl) wrote :

I forgot to mention that we also use an external postgresql (MAAS and PostgreSQL both live in 3 LXDs each, across 3x SuperMicro X9 blades).
PostgreSQL version 10.15, deployed via Juju.

Changed in maas:
status: New → In Progress
importance: Undecided → Critical
assignee: nobody → Caleb Ellis (caleb-ellis)
milestone: none → 2.9.x
Revision history for this message
Caleb Ellis (caleb-ellis) wrote :

Hi Derek,

Thanks for providing the logs - a `find()` error usually indicates the UI is expecting an array but it doesn't exist for some reason. I've noticed an area where `find()` is not handled well on the UI side is if a VM host does not have any storage pools, which shouldn't actually be possible but I'd like to be sure anyway.

If you run `maas $PROFILE vm-hosts read` are there any VM hosts that are either missing the `storage_pools` key or the value of `storage_pools` is `[]`?

Revision history for this message
Alberto Donato (ack) wrote :

Hi Derek,

in addition to the output asked by Caleb, could you also include output for `lxc storage list`?

Revision history for this message
Derek DeMoss (derek-pdl) wrote :

Hey Caleb!
It looks like you're right on there! Not sure how this would happen either, but...

```
root@maas-lxd-0:~# maas juju vm-hosts read | grep '"storage_pools": \[\]'
        "storage_pools": [],
        "storage_pools": [],
        "storage_pools": [],
        "storage_pools": [],
        "storage_pools": [],
        "storage_pools": [],
        "storage_pools": [],
```

What should we do about this? Do we just need to delete these KVM hosts via MAASCLI and readd them?

Hey Alberto,

```
lxc storage list
+----------+-------------+--------+---------+---------+
| NAME | DESCRIPTION | DRIVER | STATE | USED BY |
+----------+-------------+--------+---------+---------+
| lxd-pool | | zfs | CREATED | 9 |
+----------+-------------+--------+---------+---------+
```

This was a manually created zpool on a mirrored pair of Samsung 860 EVO 500GB SSDs.

Changed in maas-ui:
status: New → Fix Released
Revision history for this message
Derek DeMoss (derek-pdl) wrote :

Hey! Happy to see the Fix Release marker, though I'm not sure if I've tried to update to a fixed version correctly, can you verify?

I ran `snap refresh --channel=2.9/candidate maas` on all three LXDs, which was showing as ` 2.9/candidate: 2.9.2~rc1-9163-g.88e1421b0 2021-02-09 (11684) 150MB -` at the time I ran it.

Still seeing the same behavior and base error in my browser console `TypeError: undefined is not an object (evaluating 'r.find')`

Thank you!

Revision history for this message
Alberto Donato (ack) wrote :

@Derek, could you paste the full output of the vm-hosts read command?

does issuing a refresh on the vm-host change anything?

Changed in maas:
status: In Progress → Fix Committed
Alberto Donato (ack)
Changed in maas:
status: Fix Committed → In Progress
Changed in maas:
status: In Progress → Fix Committed
milestone: 2.9.x → 2.10-beta1
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
Alireza Nasri (sysnasri) wrote :

I can see this bug still exist on maas 3

Although I have deleted the vms, the workaround does not fixed the issue.

I should say I did the same way as the author said.

root@maas:/home/nasri# maas admin vm-hosts read
Success.
Machine-readable output follows:
[]

Revision history for this message
Alireza Nasri (sysnasri) wrote :

ui.js:56 TypeError: Cannot read property 'name' of null
    at pool (ui.js:82)
    at ia (ui.js:82)
    at ui.js:111
    at Array.forEach (<anonymous>)
    at ui.js:111
    at Array.forEach (<anonymous>)
    at ui.js:111
    at ui.js:111
    at Object.useMemo (ui.js:56)
    at t.useMemo (ui.js:48)
ns @ ui.js:56
n.payload @ ui.js:56
sa @ ui.js:56
Fo @ ui.js:56
Bs @ ui.js:56
jc @ ui.js:56
yc @ ui.js:56
gc @ ui.js:56
lc @ ui.js:56
(anonymous) @ ui.js:56
t.unstable_runWithPriority @ ui.js:64
Ui @ ui.js:56
$i @ ui.js:56
qi @ ui.js:56
uc @ ui.js:56
notify @ ui.js:82
t.notifyNestedSubs @ ui.js:82
t.handleChangeWrapper @ ui.js:82
f @ ui.js:82
(anonymous) @ ui.js:82
(anonymous) @ ui.js:82
dispatch @ ui.js:82
(anonymous) @ ui.js:82
(anonymous) @ ui.js:82
qr @ ui.js:82
Wr @ ui.js:82
$r @ ui.js:82
ai.PUT @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
m @ ui.js:82
t.cont @ ui.js:82
d @ ui.js:82
c @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
bi @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
s @ ui.js:82
put @ ui.js:82
(anonymous) @ ui.js:82
e.socket.onmessage @ ui.js:82
_handleMessage @ ui.js:125
Show 26 more frames
ui.js:56 TypeError: Cannot read property 'id' of null
    at ui.js:111
    at Array.filter (<anonymous>)
    at ui.js:111
    at eo (ui.js:56)
    at Bo (ui.js:56)
    at Po (ui.js:56)
    at Ro (ui.js:56)
    at Bs (ui.js:56)
    at jc (ui.js:56)
    at yc (ui.js:56)
ns @ ui.js:56
n.payload @ ui.js:56
sa @ ui.js:56
Fo @ ui.js:56
Bs @ ui.js:56
jc @ ui.js:56
yc @ ui.js:56
gc @ ui.js:56
lc @ ui.js:56
(anonymous) @ ui.js:56
t.unstable_runWithPriority @ ui.js:64
Ui @ ui.js:56
$i @ ui.js:56
qi @ ui.js:56
uc @ ui.js:56
notify @ ui.js:82
t.notifyNestedSubs @ ui.js:82
t.handleChangeWrapper @ ui.js:82
f @ ui.js:82
(anonymous) @ ui.js:82
(anonymous) @ ui.js:82
dispatch @ ui.js:82
(anonymous) @ ui.js:82
(anonymous) @ ui.js:82
qr @ ui.js:82
Wr @ ui.js:82
$r @ ui.js:82
ai.PUT @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
m @ ui.js:82
t.cont @ ui.js:82
d @ ui.js:82
c @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
bi @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
ai.CALL @ ui.js:82
(anonymous) @ ui.js:82
f @ ui.js:82
d @ ui.js:82
c @ ui.js:82
s @ ui.js:82
put @ ui.js:82
(anonymous) @ ui.js:82
e.socket.onmessage @ ui.js:82
_handleMessage @ ui.js:125
Show 26 more frames

Revision history for this message
Syed Mohammad Adnan Karim (karimsye) wrote :

also hit this in MAAS 2.8.7

Revision history for this message
Syed Mohammad Adnan Karim (karimsye) wrote :

can the fix be backported to 2.8 too?

no longer affects: maas (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.