#97 fedpkg-stage cannot read koji stg-config
Closed: Fixed 6 years ago Opened 7 years ago by cqi.

This causes fedpkg-stage scratch-build can't run and reports

Could not execute scratch_build: No server defined in: /etc/koji/stg-config, /root/.koji/config

Not easy to fix even if changing option kojiconfig to /etc/koji.conf.d/stg-config.

In stg-config, the section name is stg rather than koji, that makes it impossible to read options without changing the code.

The fix is pretty simple. We just need to tell koji to use the stg profile. No need to specify a config file at all.

I tried stg profile either with koji command line and koji.read_config, without specifying a config file, e.g. /etc/koji.conf.d/stg-config, both of them can't read the configuration.

>>> import koji
>>> koji.read_config('stg')
Warning: no configuration for profile name: stg
{'use_fast_upload': False, 'upload_blocksize': 1048576, 'offline_retry': None, 'poll_interval': 6, 'ca': '', 'weburl': 'http://localhost/koji', 'offline_retry_interval': None, 'authtype': None, 'no_ssl_verify': False, 'max_retries': None, 'server': 'http://localhost/kojihub', 'anon_retry': None, 'keepalive': True, 'serverca': '', 'topurl': None, 'krb_rdns': True, 'topdir': '/mnt/koji', 'retry_interval': None, 'pkgurl': None, 'cert': '', 'timeout': None, 'use_old_ssl': False, 'krbservice': 'host'}
>>>
>>> koji.read_config('stg', user_config='/etc/koji.conf.d/stg-config')
{'use_fast_upload': False, 'upload_blocksize': 1048576, 'offline_retry': None, 'poll_interval': 6, 'ca': '', 'weburl': 'https://koji.stg.fedoraproject.org/koji', 'offline_retry_interval': None, 'authtype': 'kerberos', 'no_ssl_verify': False, 'max_retries': None, 'server': 'https://koji.stg.fedoraproject.org/kojihub', 'anon_retry': None, 'keepalive': True, 'serverca': '', 'topurl': 'https://kojipkgs.stg.fedoraproject.org/', 'krb_rdns': False, 'topdir': '/mnt/koji', 'retry_interval': None, 'pkgurl': None, 'cert': '', 'timeout': None, 'use_old_ssl': False, 'krbservice': 'host'}
$ koji --profile stg list-tags
Warning: no configuration for profile name: stg
ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /kojihub (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f58cd606750>: Failed to establish a new connection: [Errno 111] Connection refused',))

I'm not sure is there any other ways to select stg profile without specifying a config file?

Currently, reading Koji configuration happens in Commands class, and it lacks information and could not be a good place to determine whether a downstream client is a stage or not inside Commands class.

Update fedora-packager from updates-testing

Depends on https://pagure.io/rpkg/issue/187

By changing to koji.read_config, it's easy to tell koji to read configs from different profiles.

Metadata Update from @cqi:
- Issue set to the milestone: 1.29

7 years ago

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

6 years ago

Login to comment on this ticket.

Metadata