openSUSE / osc

The Command Line Interface to work with an Open Build Service
http://openbuildservice.org/
GNU General Public License v2.0
170 stars 185 forks source link

osc build fails for PMBS #1574

Closed bmwiedemann closed 5 months ago

bmwiedemann commented 5 months ago

Describe the bug osc build fails with the PackMan BuildService (PMBS) Multimedia/gmerlin package

Versions

To Reproduce Steps to reproduce the behavior:

  1. Run command osc -A https://pmbs-api.links2linux.de co Multimedia/gmerlin && cd $_
  2. osc build --clean --noservice --vm-type=kvm openSUSE_Slowroll
  3. See error

Expected behavior It should be possible to build this

Screenshots, console outputs

~/code/osc/pmbs/Multimedia/gmerlin> osc build --clean --noservice --vm-type=kvm openSUSE_Slowroll
Building gmerlin.spec for openSUSE_Slowroll/x86_64
Using local file: gmerlin.spec
Getting buildconfig from server and store to /home/bernhard/code/osc/pmbs/Multimedia/gmerlin/.osc/_buildconfig-openSUSE_Slowroll-x86_64
Getting buildinfo from server and store to /home/bernhard/code/osc/pmbs/Multimedia/gmerlin/.osc/_buildinfo-openSUSE_Slowroll-x86_64.xml
Updating cache of required packages
0.0% cache miss. 451/451 dependencies cached.

Traceback (most recent call last):
  File "/usr/bin/osc", line 33, in <module>
    sys.exit(load_entry_point('osc==1.7.0', 'console_scripts', 'osc')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/babysitter.py", line 227, in main
    sys.exit(run(commandline.OscMainCommand()))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/babysitter.py", line 70, in run
    prg.main(argv)
  File "/usr/lib/python3.11/site-packages/osc/commandline.py", line 565, in main
    exit_code = cmd.run(args)
                ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/commandline.py", line 249, in run
    return cmd.run(args)
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/commandline.py", line 509, in run
    return self.func(args.command, args, *args.positional_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/commandline.py", line 7428, in do_build
    return osc_build.main(self.get_api_url(), store, opts, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/build.py", line 1194, in main
    fetcher.run(bi)
  File "/usr/lib/python3.11/site-packages/osc/fetch.py", line 311, in run
    keyinfo = obs_api.Keyinfo.from_api(buildinfo.apiurl, prj)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/obs_api/keyinfo.py", line 33, in from_api
    return cls.from_file(response, apiurl=apiurl)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/util/models.py", line 579, in from_file
    return cls.from_xml(root, apiurl=apiurl)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/util/models.py", line 719, in from_xml
    entry = klass.from_xml(node, apiurl=apiurl)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/util/models.py", line 774, in from_xml
    obj = cls(**kwargs, _apiurl=apiurl)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/osc/util/models.py", line 405, in __init__
    raise TypeError(
TypeError: The following fields of 'KeyinfoSslcert' object are not initialized and have no default either: 'keyid', 'fingerprint'

Additional context I updated Slowroll packages to Tumbleweed 20240605 today, but I also did not build packages from PackMan BuildService (PMBS) in a while.

git bisect shows that this started to break from

commit 8b5bdb2a0176e26a365996a696550c9737e81e7b
Author: Daniel Mach <daniel.mach@suse.com>
Date:   Tue Feb 27 14:44:43 2024 +0100

    Fix 'buildinfo' command to send complete local build environment as the 'build' command does

with different traceback:

Traceback (most recent call last):
  File "/root/git/osc/osc-wrapper.py", line 9, in <module>
    osc.babysitter.main()
  File "/root/git/osc/osc/babysitter.py", line 226, in main
    sys.exit(run(commandline.OscMainCommand()))
  File "/root/git/osc/osc/babysitter.py", line 69, in run
    prg.main(argv)
  File "/root/git/osc/osc/commandline.py", line 559, in main
    cmd.run(args)
  File "/root/git/osc/osc/commandline.py", line 247, in run
    cmd.run(args)
  File "/root/git/osc/osc/commandline.py", line 503, in run
    self.func(args.command, args, *args.positional_args)
  File "/root/git/osc/osc/commandline.py", line 7411, in do_build
    return osc_build.main(self.get_api_url(), store, opts, args)
  File "/root/git/osc/osc/build.py", line 1082, in main
    bi = Buildinfo(bi_filename, apiurl, build_type, list(prefer_pkgs.keys()), binary_type)
AttributeError: 'NoneType' object has no attribute 'keys'
bmwiedemann commented 5 months ago

I found that there are two separate issues. The one from commit 8b5bdb2a0176e26a365996a696550c9737e81e7b can be worked around by providing a package with -p

and the second issue bisected to

commit 7f6c0b3f8a13858b68b9299ff270e39c9bbed9a0
Author: Daniel Mach <daniel.mach@suse.com>
Date:   Thu Mar 14 13:48:02 2024 +0100

    Migrate Fetcher.run() to obs_api.Keyinfo
hennevogel commented 5 months ago

JFYI: PMBS is 2.10

bmwiedemann commented 5 months ago
DEBUG: send: b'GET /source/openSUSE.org:openSUSE:Slowroll:Base:2/_keyinfo HTTP/1.1\r\nHost: pmbs-api.links2linux.de\r\nAccept-Encoding: identity\r\nuser-agent: osc/1.7.0\r\nAccept: applicati
on/xml\r\nAuthorization: Basic XXX\r\n\r\n'
DEBUG: reply: 'HTTP/1.1 500 Internal Server Error\r\n'
DEBUG: header: Date: Wed, 19 Jun 2024 16:42:34 GMT
DEBUG: header: Server: Apache/2.4.51 (Linux/SUSE)
DEBUG: header: X-Request-Id: 8363ea11-accd-4238-8a17-f364e556b612
DEBUG: header: X-Runtime: 0.058675
DEBUG: header: X-Powered-By: Phusion Passenger(R) 6.0.14
DEBUG: header: Content-Length: 131
DEBUG: header: Status: 500 Internal Server Error
DEBUG: header: Cache-Control: public
DEBUG: header: Connection: close
DEBUG: header: Content-Type: application/xml; charset=utf-8

DEBUG: send: b'GET /source/openSUSE.org:openSUSE:Slowroll:Base:2/_pubkey HTTP/1.1\r\nHost: pmbs-api.links2linux.de\r\nAccept-Encoding: identity\r\nuser-agent: osc/1.7.0\r\nAccept: application/xml\r\nAuthorization: Basic XXX\r\n\r\n'
DEBUG: reply: 'HTTP/1.1 404 remote error  openSUSE Slowroll Base 2  no pubkey available\r\n'
DEBUG: header: Date: Wed, 19 Jun 2024 16:42:47 GMT
DEBUG: header: Server: Apache/2.4.51 (Linux/SUSE)
DEBUG: header: Cache-Control: private, no-transform
DEBUG: header: Referrer-Policy: strict-origin-when-cross-origin
DEBUG: header: X-Permitted-Cross-Domain-Policies: none
DEBUG: header: X-XSS-Protection: 1; mode=block
DEBUG: header: X-Opensuse-Runtimes: {"view":null,"db":1.9735668320208788,"backend":0}
DEBUG: header: X-Request-Id: 50690b66-1946-4e3c-a551-ccf738e5c1f6
DEBUG: header: X-Opensuse-APIVersion: 2.10.22
DEBUG: header: X-Download-Options: noopen 
DEBUG: header: X-Runtime: 0.055804
DEBUG: header: X-Frame-Options: SAMEORIGIN
DEBUG: header: X-Content-Type-Options: nosniff
DEBUG: header: X-Powered-By: Phusion Passenger(R) 6.0.14
DEBUG: header: Content-Type: text/xml
DEBUG: header: Cache-Control: no-cache, public
DEBUG: header: Content-Length: 196

DEBUG: send: b'GET /source/Essentials/_keyinfo HTTP/1.1\r\nHost: pmbs-api.links2linux.de\r\nAccept-Encoding: identity\r\nuser-agent: osc/1.7.0\r\nAccept: application/xml\r\nAuthorization: Basic XXX\r\n\r\n'
DEBUG: reply: 'HTTP/1.1 200 OK\r\n'
DEBUG: header: Date: Wed, 19 Jun 2024 16:42:48 GMT
DEBUG: header: Server: Apache/2.4.51 (Linux/SUSE)
DEBUG: header: Cache-Control: max-age=0, private, must-revalidate
DEBUG: header: Vary: Accept-Encoding
DEBUG: header: Referrer-Policy: strict-origin-when-cross-origin
DEBUG: header: X-Permitted-Cross-Domain-Policies: none
DEBUG: header: X-XSS-Protection: 1; mode=block
DEBUG: header: X-Opensuse-Runtimes: {"view":0.10219309478998184,"db":1.9063381478190422,"backend":0}
DEBUG: header: X-Request-Id: dc887ba2-4605-42e2-8624-3b7f4bfa75e0
DEBUG: header: X-Opensuse-APIVersion: 2.10.22
DEBUG: header: X-Download-Options: noopen 
DEBUG: header: X-Frame-Options: SAMEORIGIN
DEBUG: header: X-Runtime: 0.052864
DEBUG: header: X-Content-Type-Options: nosniff
DEBUG: header: X-Powered-By: Phusion Passenger(R) 6.0.14
DEBUG: header: ETag: W/"d57fa667b749c8ec5f5f49a53d8600ba"
DEBUG: header: Status: 200 OK
DEBUG: header: Cache-Control: public
DEBUG: header: Transfer-Encoding: chunked 
DEBUG: header: Content-Type: application/xml; charset=utf-8
dmach commented 5 months ago

Since I don't have an active account (yet), I ran: osc -A https://pmbs-api.links2linux.de api /public/source/Essentials/_keyinfo but no success as the _keyinfo endpoint doesn't seem to available under the public routes

@bmwiedemann could you run osc -A https://pmbs-api.links2linux.de api /source/Essentials/_keyinfo and paste the result here?

bmwiedemann commented 5 months ago
osc -A https://pmbs-api.links2linux.de api /source/Essentials/_keyinfo
<keyinfo project="Essentials">
  <pubkey keyid="9045a0016946124b" userid="Essentials OBS Project &lt;Essentials@packman.links2linux.de&gt;" algo="rsa" keysize="2048" expires="1751213024" fingerprint="52b1 f263 223d 311d 1fd0 4140 9045 a001 6946 124b">-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)

mQENBFN0f1gBCACoujHl8kDe71p69dcKPY+n5mkGlUtcQPFh2cu6Ev2tYg01NAar
Us5uda1wnaUtwf0T8dzCMvwt8GK8MeK0JLOM0kHxLINYq8HwUQVvYhXgqBKnm8r9
KPyqgWJS7AmUoW2AtK2w6rFAGFX9/2Lvn+TqThaPg5qdMqMF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NitjZbpOWIjH5p3nTnwl+hUo=
=hfiq
-----END PGP PUBLIC KEY BLOCK-----
</pubkey>
  <sslcert serial="0xc0f54d808fedb070" subject="CN=Essentials OBS Project, emailAddress=Essentials@packman.links2linux.de" algo="rsa" keysize="2048" begins="1682093023" expires="1751213023">-----BEGIN CERTIFICATE-----
MIIDnjCCAoagAwIBAgIJAMD1TYCP7bBwMA0GCSqGSIb3DQEBCwUAMFMxHzAdBgNV
BAMMFkVzc2VudGlhbHMgT0JTIFByb2plY3QxMDAuBgkqhkiG9w0BCQEWIUVzc2Vu
dGlhbHNAcGFja21hbi5saW5rczJsaW51eC5kZTAeFw0yMzA0MjExNjAzNDNaFw0y
NTA2MjkxNjAzNDNaMFMxHzAdBgNVBAMMFkVzc2VudGlhbHMgT0JTIFByb2plY3Qx
MDAuBgkqhkiG9w0BCQEWIUVzc2VudGlhbHNAcGFja21hbi5saW5rczJsaW51eC5k
ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKi6MeXyQN7vWnr11wo9
j6fmaQaVS1xA8WHZy7oS/a1iDTU0BqtSzm51rXCdpS3B/RPx3MIy/C3wYrwx4rQk
s4zSQfEsg1irwfBRBW9iFeCoEqebyv0o/KqBYlLsCZShbYC0rbDqsUAYVf3/Yu+f
5OpOFo+Dmp0yowVGXivuWuWeN4/j92hD9gydGZmcPQ4/wpKYzwmUlwx5eTFdrzMG
pJ+vSuIW5W6p2Rn5kcvfJMDhu1Pi32kOZnHyMXFbYtONdA1OuCBDSks4l6U0hpZO
/QlZnX33YLwqPSb6+jj5+28d3NGx9Q/ojfwxxWGMfa9zNJAF4c9sBS7ONxx09JBp
PH0CAwEAAaN1MHMwDAYDVR0TAQH/BAIwADAdBgNVHQ4EFgQUgFyXyStT/kUUfQUA
nWXygmuYmrQwHwYDVR0jBBgwFoAUgFyXyStT/kUUfQUAnWXygmuYmrQwDgYDVR0P
AQH/BAQDAgKEMBMGA1UdJQQMMAoGCCsGAQUFBwMDMA0G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