Project

General

Profile

Actions

tickets #170044

open

Login to idm.o.o sometimes returns "InvalidState"

Added by crameleon 15 days ago. Updated 11 days ago.

Status:
New
Priority:
Normal
Assignee:
Category:
FreeIPA/Kanidm
Target version:
-
Start date:
2024-11-18
Due date:
% Done:

0%

Estimated time:

Description

Sometimes after entering correct username and passphrase, it redirects to https://idm.infra.opensuse.org/ui/oauth2/resume which returns the following message:

Error
An unrecoverable error occured. Please contact your administrator with the details below.
Error Code: InvalidState
Operation ID: a1c7426b-49af-4e96-821b-abe12e7b6f00

Refreshing the page changes the ID.

In the kanidmd output I find some lines with

   โ”โ” ๐Ÿšจ [error]: Failed to unmarshal JWT from headers: InvalidSignature
   โ”•โ” ๐Ÿšจ [error]: unable to resume session, no auth_req was found in the cookie

along with the request, not sure if they are related.

Removing the path from the URL (i.e. going directly to https://idm.o.o/) again, shows the logged in Apps page.

Other times it works just fine.


Files

InvalidState.png (57.4 KB) InvalidState.png crameleon, 2024-11-18 10:53

Related issues 1 (1 open0 closed)

Related to openSUSE admin - tickets #170020: sudo sometimes does not accept passphraseNewfirstyear2024-11-16

Actions
Actions #1

Updated by crameleon 15 days ago

Actions #2

Updated by crameleon 15 days ago

  • Assignee set to firstyear
Actions #3

Updated by firstyear 15 days ago

I think this and the sudo ticket are actually linked - this error is because the challenge-response session setup is failing as the connection moved from one node to the other. This indicates that:

  • The instances are restarting frequently which breaks the chal-rep session establishment
  • That the load balancer is not correctly performing sticky sessions
  • That something in the load balancer is altering the content of the cookie-jwt which triggers signature failure.

Have there been any changes to the load balancer configuration recently? That would be the first place to look here.

Actions #4

Updated by firstyear 15 days ago

It could be that we're missing the directives below in haproxy (specifically hash-type).

balance source
hash-type consistent

Alternately, we can define a primary/secondary relationship between the pair.

Actions #5

Updated by crameleon 14 days ago

Thanks for the input.

No, there weren't any changes on hel{1,2}, neither in configuration

https://progress.opensuse.org/projects/opensuse-admin/repository/salt/revisions/production/show/pillar/cluster/hel

nor in software since June

crameleon@hel1:/home/crameleon> sudo grep haproxy /var/log/zypp/history|tail -n1
2024-06-21 21:06:51|install|haproxy|2.8.6+git0.f6bd011dc-150600.1.5|x86_64||repo-oss|f6a41993804ab436ab0657eb636158b743d208b18ed8afa3d3e2ee92dea8bacffe3f678d7fd0a45d66200e82a8ea757cef15bd8f099afce8f03a734714d753f0|

balance is already configured correctly: https://progress.opensuse.org/projects/opensuse-admin/repository/salt/revisions/production/entry/pillar/cluster/hel/init.sls#L33.
We can add hash-type.

I think it would be preferable to keep/repair the active/active setup given it worked in the past as well?

Actions #7

Updated by crameleon 14 days ago

  • Related to tickets #170020: sudo sometimes does not accept passphrase added
Actions #8

Updated by firstyear 14 days ago

Yeah, from my reading balance source isn't deterministic without the hash-type being added.

Actions #10

Updated by firstyear 13 days ago ยท Edited

I'm going to need to add some more debugging here, because this still points to a load balancer issue - not a Kanidm issue. Do you have multiple ipv6 private ip's for example?

Can we configure haproxy with x-forward-for?

EDIT: I'm an idiot, it's not ip. It's oauth2. I'm going to follow that path now.

Actions #11

Updated by firstyear 13 days ago

Can you clear your page cookies and retry?

I think I've found the issue now. Sorry for sending you down the complete wrong path.

Actions #12

Updated by firstyear 13 days ago

In the mean time, clear your page cookies and re-try.

Actions #13

Updated by crameleon 11 days ago

For me it's working now, but also I did not encounter it so often before.
Do you still have it happening, @hennevogel ?

Actions

Also available in: Atom PDF