Project

General

Profile

Bug #44228

mgr/dashboard: Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges

Added by Ernesto Puerta about 4 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Category:
UI
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
octopus
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

When logging out and then in (same user, for example, admin), browser (Chrome) throws the following error in the console:

Uncaught Error: Uncaught (in promise): Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
    at viewDestroyedError (core.js:28818)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:45256)
    at checkAndUpdateView (core.js:44271)
    at callWithDebugContext (core.js:45632)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:45194)
    at ViewRef_.detectChanges (core.js:31126)
    at notifications-sidebar.component.ts:102
    at ZoneDelegate.invoke (zone-evergreen.js:359)
    at Object.onInvoke (core.js:39699)
    at ZoneDelegate.invoke (zone-evergreen.js:358)
    at resolvePromise (zone-evergreen.js:797)
    at zone-evergreen.js:862
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39680)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at drainMicroTaskQueue (zone-evergreen.js:559)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:469)
    at invokeTask (zone-evergreen.js:1603)
    at XMLHttpRequest.globalZoneAwareCallback (zone-evergreen.js:1640)

This might be happening because of our using ngZone.runOutsideAngular (summaryService has weirdly diverged from what one would expect to be an API service). So if we don't want Angular to mess up our stuff for whatever (?) the reason, then I'm afraid we cannot go back and tell Angular 'hey, please detect my changes... exactly, the ones I didn't want you to know about'. Just a guess, but looks like that.


Related issues

Copied to Dashboard - Backport #44992: octopus: mgr/dashboard: Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges Resolved

History

#1 Updated by Alfonso Martínez about 4 years ago

  • Status changed from New to In Progress
  • Assignee set to Alfonso Martínez

Detailed trace:

Error: Uncaught (in promise): Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
viewDestroyedError@http://localhost:11012/vendor.js:46173:12
debugUpdateDirectives@http://localhost:11012/vendor.js:60967:15
checkAndUpdateView@http://localhost:11012/vendor.js:59982:14
callWithDebugContext@http://localhost:11012/vendor.js:61323:27
debugCheckAndUpdateView@http://localhost:11012/vendor.js:60905:12
detectChanges@http://localhost:11012/vendor.js:48043:22
ngOnInit/</<@http://localhost:11012/main.js:21925:28
invoke@http://localhost:11012/polyfills.js:368:26
onInvoke@http://localhost:11012/vendor.js:55726:33
invoke@http://localhost:11012/polyfills.js:367:52
run@http://localhost:11012/polyfills.js:133:43
scheduleResolveOrReject/<@http://localhost:11012/polyfills.js:864:36
invokeTask@http://localhost:11012/polyfills.js:400:31
onInvokeTask@http://localhost:11012/vendor.js:55707:33
invokeTask@http://localhost:11012/polyfills.js:399:60
runTask@http://localhost:11012/polyfills.js:177:47
drainMicroTaskQueue@http://localhost:11012/polyfills.js:568:35
invokeTask@http://localhost:11012/polyfills.js:478:21
invokeTask@http://localhost:11012/polyfills.js:1612:14
globalZoneAwareCallback@http://localhost:11012/polyfills.js:1649:31
EventListener.handleEvent*customScheduleGlobal@http://localhost:11012/polyfills.js:1751:43
scheduleTask@http://localhost:11012/polyfills.js:387:26
onScheduleTask@http://localhost:11012/polyfills.js:281:65
scheduleTask@http://localhost:11012/polyfills.js:381:51
scheduleTask@http://localhost:11012/polyfills.js:220:43
scheduleEventTask@http://localhost:11012/polyfills.js:246:25
makeAddListener/<@http://localhost:11012/polyfills.js:1920:35
handle/<@http://localhost:11012/vendor.js:19786:17
_trySubscribe@http://localhost:11012/vendor.js:209860:25
subscribe@http://localhost:11012/vendor.js:209846:22
call@http://localhost:11012/vendor.js:213157:23
subscribe@http://localhost:11012/vendor.js:209841:31
subscribeToResult@http://localhost:11012/vendor.js:219910:23
_innerSub@http://localhost:11012/vendor.js:215125:90
_tryNext@http://localhost:11012/vendor.js:215119:14
_next@http://localhost:11012/vendor.js:215102:18
next@http://localhost:11012/vendor.js:210404:18
subscribeToArray/<@http://localhost:11012/vendor.js:219792:20
_trySubscribe@http://localhost:11012/vendor.js:209860:25
subscribe@http://localhost:11012/vendor.js:209846:22
call@http://localhost:11012/vendor.js:215087:23
subscribe@http://localhost:11012/vendor.js:209841:31
call@http://localhost:11012/vendor.js:214392:23
subscribe@http://localhost:11012/vendor.js:209841:31
call@http://localhost:11012/vendor.js:214880:23
subscribe@http://localhost:11012/vendor.js:209841:31
refresh@http://localhost:11012/main.js:28093:42
enablePolling/</this.polling</<@http://localhost:11012/main.js:28086:26
invoke@http://localhost:11012/polyfills.js:368:26
onInvoke@http://localhost:11012/vendor.js:55726:33
invoke@http://localhost:11012/polyfills.js:367:52
run@http://localhost:11012/polyfills.js:133:43
run@http://localhost:11012/vendor.js:55585:91
enablePolling/</this.polling<@http://localhost:11012/main.js:28085:29
invokeTask@http://localhost:11012/polyfills.js:400:31
runTask@http://localhost:11012/polyfills.js:177:47
invokeTask@http://localhost:11012/polyfills.js:474:34
ZoneTask/this.invoke@http://localhost:11012/polyfills.js:463:48
timer@http://localhost:11012/polyfills.js:2659:29
setInterval handler*scheduleTask@http://localhost:11012/polyfills.js:2680:35
scheduleTask@http://localhost:11012/polyfills.js:387:26
scheduleTask@http://localhost:11012/polyfills.js:220:43
scheduleMacroTask@http://localhost:11012/polyfills.js:243:25
scheduleMacroTaskWithCurrentZone@http://localhost:11012/polyfills.js:1116:25
patchTimer/setNative</<@http://localhost:11012/polyfills.js:2695:62
patchMethod/proto[name]@http://localhost:11012/polyfills.js:1437:24
enablePolling/<@http://localhost:11012/main.js:28084:35
invoke@http://localhost:11012/polyfills.js:368:26
run@http://localhost:11012/polyfills.js:133:43
runOutsideAngular@http://localhost:11012/vendor.js:55646:91
enablePolling@http://localhost:11012/main.js:28083:21
SummaryService@http://localhost:11012/main.js:28079:14
SummaryService_Factory@http://localhost:11012/main.js:28135:153
_callFactory@http://localhost:11012/vendor.js:47473:20
_createProviderInstance@http://localhost:11012/vendor.js:47416:26
resolveNgModuleDep@http://localhost:11012/vendor.js:47375:17
get@http://localhost:11012/vendor.js:48446:16
resolveDep@http://localhost:11012/vendor.js:48977:45
createClass@http://localhost:11012/vendor.js:48825:85
createDirectiveInstance@http://localhost:11012/vendor.js:48641:33
createViewNodes@http://localhost:11012/vendor.js:59921:61
callViewAction@http://localhost:11012/vendor.js:60371:28
execComponentViewsAction@http://localhost:11012/vendor.js:60276:27
createViewNodes@http://localhost:11012/vendor.js:59950:29
createRootView@http://localhost:11012/vendor.js:59793:20
callWithDebugContext@http://localhost:11012/vendor.js:61323:27
debugCreateRootView@http://localhost:11012/vendor.js:60559:12
create@http://localhost:11012/vendor.js:47775:31
create@http://localhost:11012/vendor.js:44210:29
zone-evergreen.js:797
    Angular 18
        resolvePromise
        scheduleResolveOrReject
        invokeTask
        onInvokeTask
        invokeTask
        runTask
        drainMicroTaskQueue
        invokeTask
        invokeTask
        globalZoneAwareCallback
        (Async: EventListener.handleEvent)
    customScheduleGlobal
        scheduleTask
        onScheduleTask
        scheduleTask
        scheduleTask
        scheduleEventTask
        makeAddListener
        handle
    RxJS 18
        _trySubscribe
        subscribe
        call
        subscribe
        subscribeToResult
        _innerSub
        _tryNext
        _next
        next
        subscribeToArray
        _trySubscribe
        subscribe
        call
        subscribe
        call
        subscribe
        call
        subscribe
    refresh summary.service.ts:40
    polling summary.service.ts:32
    Angular 5
        invoke
        onInvoke
        invoke
        run
        run
    polling summary.service.ts:31
    Angular 12
        invokeTask
        runTask
        invokeTask
        invoke
        timer
        (Async: setInterval handler)
    scheduleTask
        scheduleTask
        scheduleTask
        scheduleMacroTask
        scheduleMacroTaskWithCurrentZone
        setNative
        name
    enablePolling summary.service.ts:30
    Angular 3
        invoke
        run
        runOutsideAngular
    enablePolling summary.service.ts:29
    SummaryService summary.service.ts:23
    SummaryService_Factory main.js:28135
    Angular 16
        _callFactory
        _createProviderInstance
        resolveNgModuleDep
        get
        resolveDep
        createClass
        createDirectiveInstance
        createViewNodes
        callViewAction
        execComponentViewsAction
        createViewNodes
        createRootView
        callWithDebugContext
        debugCreateRootView
        create
        create

#2 Updated by Alfonso Martínez about 4 years ago

RbdMirroringService & SummaryService are scheduling subscriptions that
are not unsubscribed on logout, so on re-login these errors arise.

#3 Updated by Alfonso Martínez about 4 years ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 34058

#4 Updated by Alfonso Martínez about 4 years ago

  • Status changed from Fix Under Review to In Progress

#5 Updated by Alfonso Martínez almost 4 years ago

  • Status changed from In Progress to Fix Under Review
  • Backport set to octopus

#6 Updated by Lenz Grimmer almost 4 years ago

  • Status changed from Fix Under Review to Pending Backport
  • Target version set to v16.0.0

#7 Updated by Alfonso Martínez almost 4 years ago

  • Copied to Backport #44992: octopus: mgr/dashboard: Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges added

#8 Updated by Nathan Cutler almost 4 years ago

  • Status changed from Pending Backport to Resolved

While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".

#9 Updated by Ernesto Puerta almost 3 years ago

  • Project changed from mgr to Dashboard
  • Category changed from 165 to UI

Also available in: Atom PDF