Logging out on a page with a pcrud call floods browser with errors

Bug #2002693 reported by Tiffany Little
38
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
3.10
Fix Released
High
Unassigned
3.12
Fix Released
High
Unassigned

Bug Description

Seen on 3.10 master and on our almost-ready-for-production 3.10.

It seems that if you logout while in an Angular interface that does a pcrud call, the browser gets spammed with console messages saying that permacrud received a bad auth token. The number of errors seems get exponentially higher depending on how many pcrud calls are on that page.

The most egregious example I've found is in the new Angular Load MARC Order Records page. The counter for the errors got up into the hundreds, and Chrome completely froze up. This also happens if you're on one of these pages and your login times out. I encountered that one on the Angular acq PO page.

It seems worse on Chrome than on Firefox, but I've seen it happen on both.

And inexplicably, as I'm writing this bug, it's not happening now even though I saw it happen consistently over the past few days as well as just minutes ago. But I have a screenshot to prove that it's not all in my head, so I'm going to go ahead and post this bug in case someone else sees/has seen this or if it happens again and I can add more info.

Revision history for this message
Tiffany Little (tslittle) wrote :
description: updated
Changed in evergreen:
importance: Undecided → High
Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

I think I've encountered this recently in 3.9.0

Both times the login timed out and Chrome crashed (so I wasn't able to check the console). I'm pretty sure I was in Fund Administration or the acq General Search.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Are folks seeing this issue in an environment where the proposed fix for bug 1990306 is NOT installed?

Revision history for this message
Tiffany Little (tslittle) wrote :

Jeff, I checked with Chris -- we do have that proposed fix on our production server, but not on our test server and I don't have it installed on my test master server. I'm seeing the issue in all three places.

Revision history for this message
Michele Morgan (mmorgan) wrote :

I happened to have a test system with a slightly older version of master, the top commit on which is f5c8a9715d0648f946c8549e4874822af24f3880. The two commits for bug 1990306 were merged just after this.

I logged in, navigated to Acquisitions -> Load MARC Order Records

Here is a screencast that captures the console when logging out from the Load MARC Order Records page

https://www.screencast.com/t/yKHouDoVBlLU

Revision history for this message
Michele Morgan (mmorgan) wrote :

I just applied the patch for bug 1990306 to this same system and followed the same steps. The results were the same as in the screencast in comment #5

Revision history for this message
Galen Charlton (gmc) wrote :

I think bug 1940698 is also related.

Revision history for this message
Jennifer Pringle (jpringle-u) wrote :

I can replicate this on 3.11 now (on our test servers and on the Mobius bug squashing server.

Once it happens I can't log back into Evergreen until I've cleared my cookies.

Revision history for this message
Michele Morgan (mmorgan) wrote :
Download full text (9.5 KiB)

I can easily replicate this issue in Chrome on a test server running main when I log out after navigating to the Acquisitions -> Load MARC Order Records screen.

After logout, quickly close the tab to avoid killing the browser.

There seems to be a series of bad redirects and double escaping going on.

I uncommented

console.debug(`StaffComponent routing to ${routeEvent.url}`);

in Open-ILS/src/eg2/src/app/staff/staff.component.ts and captured the attached console errors when logging out.

Here's an example of a redirect url from the console:

78 StaffComponent routing to /staff/login?routeTo=%2Feg2%2Fen-US%2Fstaff%2Flogin%3FrouteTo%3D%252Feg2%252Fen-US%252Fstaff%252Flogin%253FrouteTo%253D%25252Feg2%25252Fen-US%25252Fstaff%25252Flogin%25253FrouteTo%25253D%2525252Feg2%2525252Fen-US%2525252Fstaff%2525252Flogin%2525253FrouteTo%2525253D%252525252Feg2%252525252Fen-US%252525252Fstaff%252525252Flogin%252525253FrouteTo%252525253D%25252525252Feg2%25252525252Fen-US%25252525252Fstaff%25252525252Flogin%25252525253FrouteTo%25252525253D%2525252525252Feg2%2525252525252Fen-US%2525252525252Fstaff%2525252525252Flogin%2525252525253FrouteTo%2525252525253D%252525252525252Feg2%252525252525252Fen-US%252525252525252Fstaff%252525252525252Flogin%252525252525253FrouteTo%252525252525253D%25252525252525252Feg2%25252525252525252Fen-US%25252525252525252Fstaff%25252525252525252Flogin%25252525252525253FrouteTo%25252525252525253D%2525252525252525252Feg2%2525252525252525252Fen-US%2525252525252525252Fstaff%2525252525252525252Flogin%2525252525252525253FrouteTo%2525252525252525253D%252525252525252525252Feg2%252525252525252525252Fen-US%252525252525252525252Fstaff%252525252525252525252Flogin%252525252525252525253FrouteTo%252525252525252525253D%25252525252525252525252Feg2%25252525252525252525252Fen-US%25252525252525252525252Fstaff%25252525252525252525252Flogin%25252525252525252525253FrouteTo%25252525252525252525253D%2525252525252525252525252Feg2%2525252525252525252525252Fen-US%2525252525252525252525252Fstaff%2525252525252525252525252Flogin%2525252525252525252525253FrouteTo%2525252525252525252525253D%252525252525252525252525252Feg2%252525252525252525252525252Fen-US%252525252525252525252525252Fstaff%252525252525252525252525252Flogin%252525252525252525252525253FrouteTo%252525252525252525252525253D%25252525252525252525252525252Feg2%25252525252525252525252525252Fen-US%25252525252525252525252525252Fstaff%25252525252525252525252525252Flogin%25252525252525252525252525253FrouteTo%25252525252525252525252525253D%2525252525252525252525252525252Feg2%2525252525252525252525252525252Fen-US%2525252525252525252525252525252Fstaff%2525252525252525252525252525252Flogin%2525252525252525252525252525253FrouteTo%2525252525252525252525252525253D%252525252525252525252525252525252Feg2%252525252525252525252525252525252Fen-US%252525252525252525252525252525252Fstaff%252525252525252525252525252525252Flogin%252525252525252525252525252525253FrouteTo%252525252525252525252525252525253D%25252525252525252525252525252525252Feg2%25252525252525252525252525252525252Fen-US%25252525252525252525252525252525252Fstaff%25252525252525252525252525252525252Flogin%25252525252525252525252525252525253FrouteTo%25252525252525252525252...

Read more...

Revision history for this message
Michele Morgan (mmorgan) wrote :

Here is a branch that prevents the errors for me when logging out from the Acq Load MARC Order Records interface:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/LP2002693_avoid_flood_of_pcrud_errors_on_logout

user/mmorgan/LP2002693_avoid_flood_of_pcrud_errors_on_logout

Not sure it fixes all the issues described here, but I was unable to cause the flood of errors upon logout from any interface with this patch in place.

tags: added: pullrequest
Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I think something like this is happening: When the user logs out, the client broadcasts a logout and attempts to redirect to the login page. Presumably this initializes the StaffNavComponent, which sends off an open-ils.pcrud.search.i18n_l request. Since there's no valid authtoken after logout, the pcrud call fails with a 401 status, which in turn emits an authExpired event (see net.service.ts). The StaffComponent subscribes to these events; it broadcasts a logout (since the event wasn't *directly* emitted by the local tab, I guess?) and attempts to redirect to the login page, at which point the StaffNavComponent is initialized and calls open-ils.pcrud.search.i18n_l, which fails ...

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Sorry Michele, I missed your update! I'll test your branch.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Working branch user/jeffdavis/LP2002693_avoid_flood_of_pcrud_errors_on_logout has my signoff for Michele's fix.

tags: added: signedoff
Changed in evergreen:
milestone: none → 3.11.2
Revision history for this message
Garry Collum (gcollum) wrote :

Pushed to rel_3_10, rel_3_11, and main

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
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.