#1883 Could not login to https://koji.fedoraproject.org/kojihub
Closed: Invalid by tkopecek. Opened by stransky.

I'm unable to build packages at koji, it fails with:

[komat@localhost firefox]$ fedpkg -v build
Creating repo object from /home/komat/CVS/firefox
Package firefox has stream branches: ['FC-1', 'FC-2']
Initiating a koji session to https://koji.fedoraproject.org/kojihub
Logging into https://koji.fedoraproject.org/kojihub with Kerberos authentication.
[7894] 1576591415.192531: ccselect module realm chose cache KCM:1000:4294915407 with client principal stransky@FEDORAPROJECT.ORG for server principal HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG
[7894] 1576591415.192532: Getting credentials stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG using ccache KCM:1000:4294915407
[7894] 1576591415.192533: Retrieving stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG from KCM:1000:4294915407 with result: -1765328243/Matching credential not found
[7894] 1576591415.192534: Retrieving stransky@FEDORAPROJECT.ORG -> krbtgt/FEDORAPROJECT.ORG@FEDORAPROJECT.ORG from KCM:1000:4294915407 with result: 0/Success
[7894] 1576591415.192535: Starting with TGT for client realm: stransky@FEDORAPROJECT.ORG -> krbtgt/FEDORAPROJECT.ORG@FEDORAPROJECT.ORG
[7894] 1576591415.192536: Requesting tickets for HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG, referrals on
[7894] 1576591415.192537: Generated subkey for TGS request: aes256-cts/E907
[7894] 1576591415.192538: etypes requested in TGS request: aes256-cts, aes128-cts, aes256-sha2, aes128-sha2, rc4-hmac, camellia128-cts, camellia256-cts
[7894] 1576591415.192540: Encoding request body and padata into FAST request
[7894] 1576591415.192541: Sending request (987 bytes) to FEDORAPROJECT.ORG
[7894] 1576591415.192542: Resolving hostname id.fedoraproject.org
[7894] 1576591415.192543: Terminating TCP connection to https 2605:bc80:3010:600:dead:beef:cafe:fed9:443
[7894] 1576591415.192544: Terminating TCP connection to https 2604:1580:fe00:0:dead:beef:cafe:fed1:443
[7894] 1576591415.192545: Terminating TCP connection to https 2610:28:3090:3001:dead:beef:cafe:fed3:443
[7894] 1576591415.192546: Terminating TCP connection to https 2001:4178:2:1269::fed2:443
[7894] 1576591415.192547: TLS certificate name matched "id.fedoraproject.org"
[7894] 1576591415.192548: Sending HTTPS request to https 8.43.85.67:443
[7894] 1576591416.48228: Received answer (935 bytes) from https 8.43.85.67:443
[7894] 1576591416.48229: Terminating TCP connection to https 8.43.85.67:443
[7894] 1576591416.48230: Sending DNS URI query for _kerberos.FEDORAPROJECT.ORG.
[7894] 1576591416.48231: URI answer: 10 1 "krb5srv:m:kkdcp:https://id.fedoraproject.org/KdcProxy/"
[7894] 1576591416.48232: Response was from master KDC
[7894] 1576591416.48233: Decoding FAST response
[7894] 1576591416.48234: FAST reply key: aes256-cts/32ED
[7894] 1576591416.48235: TGS reply is for stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG with session key aes256-cts/9DDB
[7894] 1576591416.48236: TGS request result: 0/Success
[7894] 1576591416.48237: Received creds for desired service HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG
[7894] 1576591416.48238: Storing stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG in KCM:1000:4294915407
[7894] 1576591416.48240: Creating authenticator for stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG, seqnum 506951090, subkey aes256-cts/D110, session key aes256-cts/9DDB
Kerberos authentication fails: unable to obtain a session
Logout kojisession
Could not execute build: Could not login to https://koji.fedoraproject.org/kojihub
Traceback (most recent call last):
File "/usr/bin/fedpkg", line 11, in
load_entry_point('fedpkg==1.37', 'console_scripts', 'fedpkg')()
File "/usr/lib/python3.7/site-packages/fedpkg/main.py", line 86, in main
sys.exit(client.args.command())
File "/usr/lib/python3.7/site-packages/pyrpkg/cli.py", line 1784, in build
task_id = self._build(sets=sets)
File "/usr/lib/python3.7/site-packages/fedpkg/cli.py", line 1115, in _build
return super(fedpkgClient, self)._build(sets)
File "/usr/lib/python3.7/site-packages/pyrpkg/cli.py", line 1841, in _build
fail_fast=self.args.fail_fast)
File "/usr/lib/python3.7/site-packages/pyrpkg/init.py", line 2261, in build
build_target = self.kojisession.getBuildTarget(self.target)
File "/usr/lib/python3.7/site-packages/pyrpkg/init.py", line 263, in kojisession
self.load_kojisession()
File "/usr/lib/python3.7/site-packages/pyrpkg/init.py", line 420, in load_kojisession
self.login_koji_session(koji_config, self._kojisession)
File "/usr/lib/python3.7/site-packages/pyrpkg/init.py", line 390, in login_koji_session
raise rpkgError('Could not login to %s' % koji_config['server'])
pyrpkg.errors.rpkgError: Could not login to https://koji.fedoraproject.org/kojihub

koji hello gives me:
[komat@localhost firefox]$ koji hello
[8306] 1576591806.408785: ccselect module realm chose cache KCM:1000:4294915407 with client principal stransky@FEDORAPROJECT.ORG for server principal HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG
[8306] 1576591806.408786: Getting credentials stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG using ccache KCM:1000:4294915407
[8306] 1576591806.408787: Retrieving stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG from KCM:1000:4294915407 with result: 0/Success
[8306] 1576591806.408789: Creating authenticator for stransky@FEDORAPROJECT.ORG -> HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG, seqnum 475965134, subkey aes256-cts/46E8, session key aes256-cts/9DDB
2019-12-17 15:10:06,637 [ERROR] koji: AuthError: unable to obtain a session


[komat@localhost firefox]$ klist
Ticket cache: KCM:1000:4294915407
Default principal: stransky@FEDORAPROJECT.ORG

Valid starting Expires Service principal
12/17/2019 15:03:35 12/18/2019 14:58:45 HTTP/proxy10.fedoraproject.org@FEDORAPROJECT.ORG
12/17/2019 14:58:50 12/18/2019 14:58:45 krbtgt/FEDORAPROJECT.ORG@FEDORAPROJECT.ORG
12/17/2019 14:58:59 12/18/2019 14:58:45 HTTP/proxy01.fedoraproject.org@FEDORAPROJECT.ORG
12/17/2019 15:11:01 12/18/2019 14:58:45 HTTP/id.fedoraproject.org@FEDORAPROJECT.ORG

It is more for fedora infra, than for koji devel. Anyway, I'm able to log in to fedora's koji without any problems with current koji client (1.19.1). Did this change with some update, or is it purely infra issue?

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

Sounds like you have 'rdns = true' in /etc/krb5.conf or one of the configs in /etc/krb5.conf.d/*

set that to 'false', kdestroy any existing tickets and get a new one.

Sounds like you have 'rdns = true' in /etc/krb5.conf or one of the configs in /etc/krb5.conf.d/*
set that to 'false', kdestroy any existing tickets and get a new one.

No I don't have any 'rdns' entry there. I added 'rdns = false' to /etc/krb5.conf.d/fedoraproject_org
but it still fails.

This is a clean Fedora 31 install. I have an older laptop where I updated from F30 to F31 and the koji works there.

There could be also krb_rdns = true in koji.conf. But it would be weird.
I've tried clean f31 with updates in podman and it works for me out of the box.

I have at koji.conf:

authtype = kerberos
krb_rdns = false

It should work out of the box I would think...

you could also try:

dns_canonicalize_hostname = false
dns_lookup_realm = false

and make sure fedora-packager is installed? (it puts a file in /etc/krb5.conf.d/)

It should work out of the box I would think...
you could also try:
dns_canonicalize_hostname = false
dns_lookup_realm = false

There's no difference

and make sure fedora-packager is installed? (it puts a file in /etc/krb5.conf.d/)

I have fedora-packager-0.6.0.2-6.fc31.noarch

@stransky any update on this?

@stransky any update on this?

I checked it and it's still the same, I can't build packages in Koji.

I upgraded one of my test box from F30 to F31 and koji works there (as it worked on F30 before). But on my primary laptop with clean F31 install the koji fails.

Interesting, can you compare krb5.conf and koji.conf for these two envs?

Sorry, I've missed your mail with results. Can you try also krb_canon_host=True in /etc/koji.conf (and ensure, that you've python-dns installed). It it doesn't work, can you try both values for krb_rdns with this setting?

It works now although I did nothing expect some dnf updates. So closing for now, Thanks.

Metadata Update from @stransky:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

Metadata Update from @stransky:
- Issue status updated to: Open (was: Closed)

I see the issue again. I also updated by old F30 system to F32 and I see it there too.
It looks like an intermittent problem - when I run the "brew build" command twenty time, once is successful. I don't know if that's a network issue or so. I fails from my home and also from Brno office.

krb_canon_host=True in /etc/koji.conf and python-dns installed seems to be working so far.

So the krb_canon_host=True in /etc/koji.conf and python-dns do not work any more. It worked somehow (once from ten times) but I'm unable to do any builds again. I suspect it's related to office/vpn setup and it works better when I'm connected from home without vpn.

So shall I move the ticket to fedora infra?

@kevin?

infrastructure is likely the better place, but I'm happy to try and help here.

@stransky can you again share your /etc/krb5.conf and any /etc/krb5.conf.d/* files and the output of: 'KRB5_TRACE=/dev/stdout fedpkg build' ?

I know the stock files work fine, so it has to be something added/changed there....

Log when koji fails:
log-bad.txt

Log when koji works:
log-ok.txt

[komat@localhost ~]$ ll /etc/krb5.conf.d/*
lrwxrwxrwx. 1 root root 42 Feb 14 17:21 /etc/krb5.conf.d/crypto-policies -> /etc/crypto-policies/back-ends/krb5.config
-rw-r--r--. 1 root root 256 Mar 3 15:00 /etc/krb5.conf.d/fedoraproject_org
-rw-r--r--. 1 root root 494 Feb 27 04:55 /etc/krb5.conf.d/kcm_default_ccache
-rw-r--r--. 1 root root 423 May 1 2018 /etc/krb5.conf.d/krb5-redhat.conf
-rw-r--r--. 1 root root 205 Jul 31 2017 /etc/krb5.conf.d/stg_fedoraproject_org

From the log it looks like I don't get reply from koji so this line is missing in log-bad.txt:

[6183] 1583311272.592060: Read AP-REP, time 1583311271.396121, subkey aes256-cts/2EDC, seqnum 774979823

The problem is that it's doing reverse dns lookup. (Note the 'proxy01' and 'proxy10' in there). I am not sure why proxy10 works, they should both fail I would think...
It should be using 'server principal HTTP/koji.fedoraproject.org@FEDORAPROJECT.ORG'

Can you look at:

grep rdns /etc/krb5 /etc/krb5.conf.d/

It might be set to 'false' in the top level, but then set back to 'true' in the redhat one?

Also, perhaps try commenting everything in the krb5-redhat.conf one and put the default /etc/krb5.conf back in place, see if it works, then slowly uncomment and see if you can see what might break it there? It should really work out of the box...

It doesn't work even when I have only fedoraproject.org kerberos files and only fedora kerberos ticket (checked by klist). Also I don't have rdns anywhere. I also reinstalled fedpkg/fedora-maintainer packages. I don't have any problem with "fedpkg upload", only koji fails when VPN (BRQ) is on and works when VPN (BRQ) is off. It's also broken when I submit koji builds from BRQ RH office.

Thats interesting... I wonder if the vpn is providing nameservers that return different information than external ones.

Long shot, do you have a koji.conf in any of:

  • /etc/koji.conf
  • /etc/koji.conf.d/*.conf
  • ~/.koji/config.d/*.conf

with different settings?

You mentioned brew, are you using koji or brew? (I know they are likey the same thing, but I wonder if there's a config difference calling brew?)

/etc/koji.conf

yes, I have it and it comes from koji-1.20.1-1.fc32.noarch

/etc/koji.conf.d/*.conf

Yes, from fedora-packager-0.6.0.2-8.fc32.noarch

with different settings?

I didn't update any of those files, it's default config as it comes with the packages.

You mentioned brew, are you using koji or brew? (I know they are likey the same thing, but I wonder if there's a config difference calling brew?)

No, I don't have brewkoji package installed.

See #2063 for a discussion on improving this UX.

Also, "krb_rdns" is going away, see https://bugzilla.redhat.com/show_bug.cgi?id=1812702

I see this message now if that makes any difference:

/usr/lib/python3.8/site-packages/koji/util.py:53: DeprecationWarning: Please use gssapi_login instead, krb_login will be removed in koji 1.22
warnings.warn(message, DeprecationWarning)

Yeah, thats a rpkg bug: https://pagure.io/rpkg/issue/498

Metadata Update from @tkopecek:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1883

Please continue any further discussion there.

Metadata