[2.5, UI] Error adding ssh keys for new users: TypeError: Cannot read property 'sshkeys_count' of null

Bug #1811107 reported by Björn Tillenius
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Caleb Ellis

Bug Description

Testing with 2.5.1-7489-g2f25a2cc0-0ubuntu1~18.04.1 and RBAC enabled, I often have problems getting passed the intro page. After successfully adding my ssh keys (lp:bjornt), clicking on "Go to dashboard" doesn't do anything.

Looking at the JS console, I see this error:

angular.js?v=2.5.1(7489-g2f25a2cc0-0ubuntu1~18.04.1):6 TypeError: Cannot read property 'sshkeys_count' of null
    at ChildScope.$scope.canContinue (http://10.0.8.86:5240/MAAS/static//js/bundle/maas-min.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):1:803274)
    at Array.fn0 (eval at compile (http://10.0.8.86:5240/MAAS/combo/angular.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):7:11337), <anonymous>:4:792)
    at expressionInputsWatch (http://10.0.8.86:5240/MAAS/combo/angular.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):8:5149)
    at Scope.$digest (http://10.0.8.86:5240/MAAS/combo/angular.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):8:19723)
    at ChildScope.$apply (http://10.0.8.86:5240/MAAS/combo/angular.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):8:22211)
    at HTMLButtonElement.<anonymous> (http://10.0.8.86:5240/MAAS/combo/angular.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):10:14615)
    at HTMLButtonElement.dispatch (http://10.0.8.86:5240/MAAS/combo/jquery.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):4:3874)
    at HTMLButtonElement.elemData.handle (http://10.0.8.86:5240/MAAS/combo/jquery.js?v=2.5.1(:5240/MAAS/7489-g2f25a2cc0-0ubuntu1~18.04.1):4:574)

Tags: ui
Changed in maas:
status: New → Triaged
importance: Undecided → High
milestone: none → 2.5.1
tags: added: ui
summary: - [2.5] Error adding ssh keys for new users: TypeError: Cannot read
+ [2.5, UI] Error adding ssh keys for new users: TypeError: Cannot read
property 'sshkeys_count' of null
Changed in maas:
milestone: 2.5.1 → 2.5.2
Changed in maas:
milestone: 2.5.2 → 2.5.3
summary: - [2.5, UI] Error adding ssh keys for new users: TypeError: Cannot read
- property 'sshkeys_count' of null
+ [2.5, UI, RBAC] Error adding ssh keys for new users: TypeError: Cannot
+ read property 'sshkeys_count' of null
Changed in maas:
milestone: 2.5.3 → 2.6.0beta2
Changed in maas:
milestone: 2.6.0beta2 → 2.6.0rc1
Revision history for this message
Caleb Ellis (caleb-ellis) wrote : Re: [2.5, UI, RBAC] Error adding ssh keys for new users: TypeError: Cannot read property 'sshkeys_count' of null

I cant't seem to replicate the issue, although I have set up RBAC/Candid with Ubuntu SSO. Is this still happening for you, Bjorn?

Revision history for this message
Björn Tillenius (bjornt) wrote :

I haven't tried it lately, but I could give it a try to reproduce it again next week. Note that it didn't happen all the time.

Changed in maas:
milestone: 2.6.0rc1 → 2.6.0rc2
Changed in maas:
milestone: 2.6.0rc2 → 2.7.0alpha1
Revision history for this message
Alberto Donato (ack) wrote :

FTR I could reproduce the issue without rbac enabled, just right after installing maas

summary: - [2.5, UI, RBAC] Error adding ssh keys for new users: TypeError: Cannot
- read property 'sshkeys_count' of null
+ [2.5, UI] Error adding ssh keys for new users: TypeError: Cannot read
+ property 'sshkeys_count' of null
Revision history for this message
Alberto Donato (ack) wrote :

this can easily be reproduced in master by stoppingat the "add ssh keys" page at the first user journey. it doesn't always happen, but a few page reloads should show it.

The reason for it is that the $scope.user in intro_user.js can be null, because UsersManager.loadItems calls this._loadAuthUser() but doesn't actually way for it to complete, so the _authUser can still be null when the function returns (and gets propagated as such).

Changed in maas:
assignee: nobody → Caleb Ellis (caleb-ellis)
Changed in maas:
milestone: 2.7.0b1 → 2.7.0b2
Changed in maas:
milestone: 2.7.0b2 → none
Changed in maas:
milestone: none → 2.7.0rc2
Revision history for this message
Caleb Ellis (caleb-ellis) wrote :
Changed in maas:
status: Triaged → Won't Fix
status: Won't Fix → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
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.