juju / juju-gui

Juju-GUI is a web-based GUI for Juju <https://jujucharms.com/>.
Other
182 stars 85 forks source link

SAAS Support - UI crash when viewing SAAS relations #4023

Closed LucidNeko closed 4 years ago

LucidNeko commented 4 years ago
$ juju --version
2.7.0-xenial-amd64
$ chromium-browser --version
Chromium 78.0.3904.108 Built on Ubuntu , running on Ubuntu 16.04

Cloud Provider: https://catalystcloud.nz (openstack)

Application layout is cs:mediawiki-19 in one model, and cs:mysql-58 in another. With the mysql model offering, and the mediawiki model consuming the db relation.

Slug: /gui/u/admin/test/i/inspector/mediawiki Issue: Clicking relations on the inspector for mediawiki causes part of the UI to dissapear.

TypeError: Cannot read property 'serviceName' of undefined
    at l._generateRelationLabel (init-pkg.js:formatted:68403)
    at l.<anonymous> (init-pkg.js:formatted:68431)
    at Array.forEach (<anonymous>)
    at l._generateRelations (init-pkg.js:formatted:68425)
    at l.render (init-pkg.js:formatted:68509)
    at Ma (init-pkg.js:formatted:34780)
    at Pa (init-pkg.js:formatted:34770)
    at ja (init-pkg.js:formatted:34946)
    at Pr (init-pkg.js:formatted:36283)
    at Mr (init-pkg.js:formatted:36309)
init-pkg.js:formatted:68403 Uncaught TypeError: Cannot read property 'serviceName' of undefined
    at l._generateRelationLabel (init-pkg.js:formatted:68403)
    at l.<anonymous> (init-pkg.js:formatted:68431)
    at Array.forEach (<anonymous>)
    at l._generateRelations (init-pkg.js:formatted:68425)
    at l.render (init-pkg.js:formatted:68509)
    at Ma (init-pkg.js:formatted:34780)
    at Pa (init-pkg.js:formatted:34770)
    at ja (init-pkg.js:formatted:34946)
    at Pr (init-pkg.js:formatted:36283)
    at Mr (init-pkg.js:formatted:36309)

This happens in _generateRelationLabel because the far end of the relation is undefined, and as such has no serviceName.

It doesn't look like juju gui supports SAAS at all, so an understandable bug. Is adding SAAS support in the works? This might be better as a feature request.

LucidNeko commented 4 years ago

As a follow up to this I just ran

$ juju destroy-model -y -t0 test
Destroying modelERROR timeout after 0s timeout
$ juju destroy-model -y -t0 test2
Destroying modelERROR timeout after 0s timeout

test and test2 being the models for mediawiki and mysql respectively.

Both models are now gone, but juju gui is even more broken. Breaks in visually the same way (but on a different error) by simply going to /gui/u/admin or /gui/u/admin/gitlab (a valid model).

I'm speculating that running destroy-model on a model with a relation to a SAAS application leaves some hanging resources?

init-pkg.js:34 TypeError: Cannot read property 'id' of undefined
    at init-pkg.js:70
    at Array.reduce (<anonymous>)
    at u._generateModels (init-pkg.js:70)
    at u.render (init-pkg.js:70)
    at Ma (init-pkg.js:34)
    at Pa (init-pkg.js:34)
    at ja (init-pkg.js:34)
    at Pr (init-pkg.js:34)
    at Mr (init-pkg.js:34)
    at ei (init-pkg.js:34)
init-pkg.js:70 Uncaught TypeError: Cannot read property 'id' of undefined
    at init-pkg.js:70
    at Array.reduce (<anonymous>)
    at u._generateModels (init-pkg.js:70)
    at u.render (init-pkg.js:70)
    at Ma (init-pkg.js:34)
    at Pa (init-pkg.js:34)
    at ja (init-pkg.js:34)
    at Pr (init-pkg.js:34)
    at Mr (init-pkg.js:34)
    at ei (init-pkg.js:34)
hatched commented 4 years ago

Hi @LucidNeko thanks for reporting this issue.

Unfortunately the current GUI does not support cross model relations. We're working on a new Dashboard to replace this one and we don't have plans to add support for CMR to this GUI.

As far as the second issue. It appears that it's still trying to parse CMR data. Juju must still be sending some invalid data to it. Sorry I don't have a better answer for you at this time but we are working hard on getting the new Dashboard ready to go for early in the new year.