Bad credentials when trying to login to accounts.fp.o directly #13645

Open
opened 2026-10-27 15:31:05 +00:00 by lecris · 23 comments

Description of request

This happens regularly to me it seems. Whenever I go directly to https://accounts.fedoraproject.org and try to login, I get a

Unauthorized: bad credentials.

If I then go to something else like bodhi and get logged in via id.fp.o, credentials works and I am golden.

I am pretty sure that then I can go back to accounts.fp.o and manage to log back in, but trying it now, it doesn't work. I am sure I do have ways to get logged in to accounts.fp.o with some weird hopping from one site to another, but I do not have one at hand to report.

Anyway, can we get the Unauthorized: bad credentials. weirdness fixed somehow?

Affected Service or System

accounts.fp.o

Deadline

No response

Additional Context or Error Logs

No response

### Description of request This happens regularly to me it seems. Whenever I go directly to https://accounts.fedoraproject.org and try to login, I get a > Unauthorized: bad credentials. If I then go to something else like bodhi and get logged in via id.fp.o, credentials works and I am golden. I am pretty sure that then I can go back to accounts.fp.o and manage to log back in, but trying it now, it doesn't work. I am sure I do have ways to get logged in to accounts.fp.o with some weird hopping from one site to another, but I do not have one at hand to report. Anyway, can we get the `Unauthorized: bad credentials.` weirdness fixed somehow? ### Affected Service or System accounts.fp.o ### Deadline _No response_ ### Additional Context or Error Logs _No response_
Member

As discussed in #admin:fedoraproject.org, this has been a very persistent problem and also very hard to track down. I can also vouch for having hit this, and also, it only seems to affect accounts.fedoraproject.org login; usually I am able to log in fine with other OIDC login prompts.

As discussed in `#admin:fedoraproject.org`, this has been a very persistent problem and also very hard to track down. I can also vouch for having hit this, and also, it _only_ seems to affect `accounts.fedoraproject.org` login; usually I am able to log in fine with other OIDC login prompts.
Owner

Yeah, we keep thinking this is gone, but then it comes back.

It's really hard to isolate. There's never any errors in noggin logs or ipa logs, but the problem has to be somewhere between those two things.

@abompard any ideas? Can we enable more logging in noggin perhaps?

Yeah, we keep thinking this is gone, but then it comes back. It's really hard to isolate. There's never any errors in noggin logs or ipa logs, but the problem has to be somewhere between those two things. @abompard any ideas? Can we enable more logging in noggin perhaps?
Member

I've tried digging through the logs, I've reached something that may be suspicious:

Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: request received
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: user query start
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: user query end: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: bind start: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: bind end: success
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: sent: 0 data: 20
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: ..sent: 20 data: 20
Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: response sent: Access-Accept
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org systemd[1]: Started ipa-otpd@1952-4161759-0.service - ipa-otpd service (PID 4161759/UID 0).
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: LDAP: ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: request received
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: user query start
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: user query end: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org
Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: bind start: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org
Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: bind end: Invalid credentials
Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: sent: 0 data: 20
Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: ..sent: 20 data: 20
Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: response sent: Access-Reject

It looks like it's IPA's OTP module that rejects the login attempt, but it sends an Access-Accept followed by an Access-Reject a second later. AI suggests that's because a login retry is attempted too fast by some component along the way and OTP tokens can't be reused, hence the failure. But I'm not finding evidence of retries being attempted by either noggin or the IPA python API.
I'm going to ask for help with the IPA folks because I don't see how I could get more info here.

I've tried digging through the logs, I've reached something that may be suspicious: ``` Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: request received Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: user query start Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: user query end: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: bind start: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: bind end: success Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: sent: 0 data: 20 Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: ..sent: 20 data: 20 Oct 27 15:24:57 ipa01.rdu3.fedoraproject.org ipa-otpd[3876342]: lecris@FEDORAPROJECT.ORG: response sent: Access-Accept Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org systemd[1]: Started ipa-otpd@1952-4161759-0.service - ipa-otpd service (PID 4161759/UID 0). Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: LDAP: ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: request received Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: user query start Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: user query end: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org Oct 27 15:24:58 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: bind start: uid=lecris,cn=users,cn=accounts,dc=fedoraproject,dc=org Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: bind end: Invalid credentials Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: sent: 0 data: 20 Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: ..sent: 20 data: 20 Oct 27 15:24:59 ipa01.rdu3.fedoraproject.org ipa-otpd[3915476]: lecris@FEDORAPROJECT.ORG: response sent: Access-Reject ``` It looks like it's IPA's OTP module that rejects the login attempt, but it sends an `Access-Accept` followed by an `Access-Reject` a second later. AI suggests that's because a login retry is attempted too fast by some component along the way and OTP tokens can't be reused, hence the failure. But I'm not finding evidence of retries being attempted by either noggin or the IPA python API. I'm going to ask for help with the IPA folks because I don't see how I could get more info here.

I hit this many times today, then after waiting about half an hour the next login worked straight away.

I hit this many times today, then after waiting about half an hour the next login worked straight away.
Contributor

@abompard I'm going to talk nonsense for a sec because I don't know anything about these systems. But I recall that recently things were switched from pointing at a single IPA server to all of them, because the load was not getting distributed across the cluster. Is it possible that the request is now getting sent n times because there are n servers configured? (Rather than just picking one randomly?) So one succeeds and one fails?

@abompard I'm going to talk nonsense for a sec because I don't know anything about these systems. But I recall that recently things were switched from pointing at a single IPA server to all of them, because the load was not getting distributed across the cluster. Is it possible that the request is now getting sent `n` times because there are `n` servers configured? (Rather than just picking one randomly?) So one succeeds and one fails?
Member

Is it possible that the request is now getting sent n times because there are n servers configured? (Rather than just picking one randomly?) So one succeeds and one fails?

Yeah I looked at that and the attempts all happened on ipa01 (with an independent request on ipa03, none on ipa02)

> Is it possible that the request is now getting sent `n` times because there are `n` servers configured? (Rather than just picking one randomly?) So one succeeds and one fails? Yeah I looked at that and the attempts all happened on ipa01 (with an independent request on ipa03, none on ipa02)
Owner

So, I did a 'ipactl restart' on ipa01 and @mwinters was able to auth multiple times in a row. So, that makes me think it's something that goes wrong over time on the ipa server end.

I looked and there's a 389-ds update pending that fixes https://redhat.atlassian.net/browse/RHEL-252645 which might be related?

So, I did a 'ipactl restart' on ipa01 and @mwinters was able to auth multiple times in a row. So, that makes me think it's something that goes wrong over time on the ipa server end. I looked and there's a 389-ds update pending that fixes https://redhat.atlassian.net/browse/RHEL-252645 which might be related?
Member

Since I first noticed this happening, something new happened today which never happened before. Sharing here in case it is useful for debugging purposes.

First, somewhere around 1:30 PM US Eastern, I got the same old message:

Screenshot of the accounts.fp.o login module, with jflory7 username and the Unauthorized: bad credentials error message.

But then, I tried again after waiting a few minutes. It hung for a while. Then I noticed the tab title changed to say IPA Error. The page appeared to still be loading. Then, it showed this page:

Screenshot of an IPA Error dialogue while I am browsing the URL for my own FAS profile in Noggin.

I waited a few minutes, since I was chatting in #admin:fedoraproject.org. I refreshed, and then everything was working. My profile page loaded normally.

Weird behavior, but thought I would share. This all would have happened in the last ~10 minutes or so before I wrote this comment.

Since I first noticed this happening, something new happened today which never happened before. Sharing here in case it is useful for debugging purposes. First, somewhere around 1:30 PM US Eastern, I got the same old message: ![Screenshot of the accounts.fp.o login module, with `jflory7` username and the `Unauthorized: bad credentials` error message.](/attachments/3bd9979c-755c-4dc8-a76f-c2692aa947e0 "Screenshot of the accounts.fp.o login module, with `jflory7` username and the `Unauthorized: bad credentials` error message.") But then, I tried again after waiting a few minutes. It hung for a while. Then I noticed the tab title changed to say `IPA Error`. The page appeared to still be loading. Then, it showed this page: ![Screenshot of an IPA Error dialogue while I am browsing the URL for my own FAS profile in Noggin.](/attachments/a07f82d8-a37b-40b3-9e70-c682a74fc080 "Screenshot of an IPA Error dialogue while I am browsing the URL for my own FAS profile in Noggin.") I waited a few minutes, since I was chatting in `#admin:fedoraproject.org`. I refreshed, and then everything was working. My profile page loaded normally. Weird behavior, but thought I would share. This all would have happened in the last ~10 minutes or so before I wrote this comment.

FWIW I saw that same IPA error once today too. That happened after I managed to log in successfully.

FWIW I saw that same IPA error once today too. That happened after I managed to log in successfully.
Owner

@jflory7 I wondering if that wasn't at the same time as @kevin was restarting the IPA.

@jflory7 I wondering if that wasn't at the same time as @kevin was restarting the IPA.
Member

I've managed to reproduce it so I've collected the logs and opened an IPA ticket: https://codeberg.org/freeipa/freeipa/issues/10104

I've managed to reproduce it so I've collected the logs and opened an IPA ticket: https://codeberg.org/freeipa/freeipa/issues/10104
Owner

Today I started seeing ipa: ERROR: cannot connect to 'ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket': and it is only happening on ipa01. Also the direct access to LDAP using ldapsearch works fine, so it's only when using ipa calls. Sometimes it goes through, sometimes it doesn't. To me that looks like some limit on requests, but I'm not sure when that would be set.

Today I started seeing `ipa: ERROR: cannot connect to 'ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket':` and it is only happening on ipa01. Also the direct access to LDAP using ldapsearch works fine, so it's only when using ipa calls. Sometimes it goes through, sometimes it doesn't. To me that looks like some limit on requests, but I'm not sure when that would be set.
Owner

@zlopez wrote in #13645 (comment):

Today I started seeing ipa: ERROR: cannot connect to 'ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket': and it is only happening on ipa01. Also the direct access to LDAP using ldapsearch works fine, so it's only when using ipa calls. Sometimes it goes through, sometimes it doesn't. To me that looks like some limit on requests, but I'm not sure when that would be set.

This was related to latest update of 389-ds package (which was done only on ipa01), I opened an issue for this https://redhat.atlassian.net/browse/RHEL-297618.

@zlopez wrote in https://forge.fedoraproject.org/infra/tickets/issues/13645#issuecomment-1369856: > Today I started seeing `ipa: ERROR: cannot connect to 'ldapi://%2Frun%2Fslapd-FEDORAPROJECT-ORG.socket':` and it is only happening on ipa01. Also the direct access to LDAP using ldapsearch works fine, so it's only when using ipa calls. Sometimes it goes through, sometimes it doesn't. To me that looks like some limit on requests, but I'm not sure when that would be set. This was related to latest update of 389-ds package (which was done only on ipa01), I opened an issue for this https://redhat.atlassian.net/browse/RHEL-297618.
Owner

I know we looked at the otp theory in a previous ticket and discarded it, but perhaps we were wrong and that is the underlying issue. It does seem like all the folks having problems do have otp's enrolled.

I know we looked at the otp theory in a previous ticket and discarded it, but perhaps we were wrong and that is the underlying issue. It does seem like all the folks having problems do have otp's enrolled.

I have had this issue and I do have OTP enrolled. Sometimes it works, sometimes it doesn’t. I’ve never found a common pattern.

I have had this issue and I do have OTP enrolled. Sometimes it works, sometimes it doesn’t. I’ve never found a common pattern.

I used to wonder if this was somehow related to OTP replay / retry behavior within the 30s window, but could never figure out why everyone would be retrying or hitting wrong codes on the first try.

Looking at the Codeberg logs though, the two ipa-otpd.socket calls are exactly 1 second apart (10:17:35 -> 10:17:36) from two different KDC worker PIDs. In MIT Kerberos (sendto_kdc.c), k5_sendto has a hardcoded 1s wait (service_fds(..., 1000)) before it tries the next transport or does a second pass.

If LDAP takes right around a second to process the preauth, kinit itself probably fires a second request. The first one already succeeded and updated the token watermark in 389-ds, so the second one immediately gets rejected as an OTP replay, and the whole login fails.

Might be worth running kinit with KRB5_TRACE=/dev/stderr in staging to see if sendto_kdc is indeed firing that 1s retransmit.

I used to wonder if this was somehow related to OTP replay / retry behavior within the 30s window, but could never figure out why everyone would be retrying or hitting wrong codes on the first try. Looking at the Codeberg logs though, the two `ipa-otpd.socket` calls are exactly 1 second apart (10:17:35 -> 10:17:36) from two different KDC worker PIDs. In MIT Kerberos (`sendto_kdc.c`), `k5_sendto` has a hardcoded 1s wait (`service_fds(..., 1000)`) before it tries the next transport or does a second pass. If LDAP takes right around a second to process the preauth, `kinit` itself probably fires a second request. The first one already succeeded and updated the token watermark in 389-ds, so the second one immediately gets rejected as an OTP replay, and the whole login fails. Might be worth running `kinit` with `KRB5_TRACE=/dev/stderr` in staging to see if `sendto_kdc` is indeed firing that 1s retransmit.
Owner

I don't have any problem with kinit anywhere, so I'm not sure if this will show the problem. Also I didn't hear from people about any issue on staging. This is happening only on production and only when the request is not going through ipsilon. But what you found looks interesting. I wonder why they are two KDC workers.

I don't have any problem with `kinit` anywhere, so I'm not sure if this will show the problem. Also I didn't hear from people about any issue on staging. This is happening only on production and only when the request is not going through ipsilon. But what you found looks interesting. I wonder why they are two KDC workers.
Owner

Just tested it out in staging and I can't reproduce it there, but that could be caused by the amount of data in database. In production we have a lot more users and groups than on staging.

Just tested it out in staging and I can't reproduce it there, but that could be caused by the amount of data in database. In production we have a lot more users and groups than on staging.
Member

I don't have any problem with kinit anywhere, so I'm not sure if this will show the problem.

The kinit is done by the IPA API on the same machine, it's possible that it takes a different path (unix socket maybe?).

> I don't have any problem with `kinit` anywhere, so I'm not sure if this will show the problem. The kinit is done by the IPA API on the same machine, it's possible that it takes a different path (unix socket maybe?).
Member

I am still hitting this issue. My usual way of breaking through is brute-forcing. It varies, but if I keep trying enough in a 5-minute window with enough 2FA codes, I will eventually get through. It does feel like somewhere, there is a bad server in the cluster. I feel like @sheikhlimon has a plausible theory to explore, but this also may not be related to Kerberos either.

I am still hitting this issue. My usual way of breaking through is brute-forcing. It varies, but if I keep trying enough in a 5-minute window with enough 2FA codes, I will eventually get through. It does feel like somewhere, there is a bad server in the cluster. I feel like @sheikhlimon has a plausible theory to explore, but this also may not be related to Kerberos either.

I use Kerberos tickets on my laptop and I don't run into this issue when acquiring the ticket, I do run into it on machines that I don't use a ticket on. I just keep trying until I get in. I've never seen a common set of conditions when it is happening.

I use Kerberos tickets on my laptop and I don't run into this issue when acquiring the ticket, I do run into it on machines that I don't use a ticket on. I just keep trying until I get in. I've never seen a common set of conditions when it is happening.

@jflory7 The bad server might just be ipa01 (where those journal logs were from). If so, brute-forcing probably just ends up eventually landing you on ipa02 or ipa03 instead.

@jflory7 The bad server might just be ipa01 (where those journal logs were from). If so, brute-forcing probably just ends up eventually landing you on ipa02 or ipa03 instead.
Owner

So just to clarify since more folks are seeing this over time.

(These are all what I think to be true)

  1. It only seems to affect people who have a otp enrolled.
  2. clearing cookies doesn't help any really
  3. waiting a bit and retrying works
  4. It is all the ipa cluster members, not just ipa01 as far as I can tell

Our current guess is that it's the communication around ipa-otpd. (Thats what the upstream freeipa bug @abompard filed is about).

I'll see if I can get more attention on the upstream bug next week.

So just to clarify since more folks are seeing this over time. (These are all what I think to be true) 1. It only seems to affect people who have a otp enrolled. 2. clearing cookies doesn't help any really 3. waiting a bit and retrying works 4. It is all the ipa cluster members, not just ipa01 as far as I can tell Our current guess is that it's the communication around ipa-otpd. (Thats what the upstream freeipa bug @abompard filed is about). I'll see if I can get more attention on the upstream bug next week.
Sign in to join this conversation.
No milestone
No project
No assignees
9 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
infra/tickets#13645
No description provided.