#3941 build task: nonexistent buildtarget with opts.repo_id breaks policy check in make_task
Closed: Fixed by tkopecek. Opened by julian8628.

When build params with buildtarget and opts.repo_id, the buildtarget is destination tag.

We should set target to None in policy_data.


Metadata Update from @julian8628:
- Custom field Size adjusted to None
- Issue tagged with: easyfix

Is there an example traceback?

here it is:
the request is:

  'request': ['cli-build/1669130929.185414.nCFXvxNI/module-build-macros-0.1-1.scrmod+el8.1.1+9886+73cfa316.src.rpm',
              'scrmod-73cfa3162b21da70+9904',
              {'mbs_artifact_name': 'module-build-macros',
               'mbs_module_target': 'scrmod-73cfa3162b21da70+9904',
               'skip_tag': True,
               'repo_id': 123}]

traceback on hub:

[Fri Nov 10 15:09:03.321813 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003] 2023-11-10 15:09:03,321 [WARNING] m=makeTask u=yzhu p=3263701 r=10.72.112.73:53003 koji.xmlrpc: Traceback (most recent call last):
[Fri Nov 10 15:09:03.321880 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojixmlrpc.py", line 265, in _wrap_handler
[Fri Nov 10 15:09:03.321884 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     response = handler(environ)
[Fri Nov 10 15:09:03.321886 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojixmlrpc.py", line 292, in handle_rpc
[Fri Nov 10 15:09:03.321888 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     return self._dispatch(method, params)
[Fri Nov 10 15:09:03.321890 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojixmlrpc.py", line 329, in _dispatch
[Fri Nov 10 15:09:03.321892 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     ret = koji.util.call_with_argcheck(func, params, opts)
[Fri Nov 10 15:09:03.321894 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/koji/util.py", line 271, in call_with_argcheck
[Fri Nov 10 15:09:03.321895 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     return func(*args, **kwargs)
[Fri Nov 10 15:09:03.321897 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojihub.py", line 10535, in makeTask
[Fri Nov 10 15:09:03.321899 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     return make_task(*args, **opts)
[Fri Nov 10 15:09:03.321901 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojihub.py", line 666, in make_task
[Fri Nov 10 15:09:03.321903 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     policy_data.update(policy_data_from_task_args(method, arglist))
[Fri Nov 10 15:09:03.321911 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojihub.py", line 9958, in policy_data_from_task_args
[Fri Nov 10 15:09:03.321913 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     policy_data['target'] = get_build_target(target, strict=True)['name']
[Fri Nov 10 15:09:03.321915 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]   File "/usr/lib/python3.6/site-packages/kojihub/kojihub.py", line 3323, in get_build_target
[Fri Nov 10 15:09:03.321917 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003]     raise koji.GenericError('No such build target: %s' % info)
[Fri Nov 10 15:09:03.321919 2023] [wsgi:error] [pid 3263701] [client 10.72.112.73:53003] koji.GenericError: No such build target: scrmod-73cfa3162b21da70+9904

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.34.1

Metadata Update from @julian8628:
- Issue tagged with: testing-ready

Metadata Update from @relias-redhat:
- Issue tagged with: testing-done

Commit aa94ecb0 fixes this issue

Commit 1d02394c fixes this issue

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

Please continue any further discussion there.

Metadata
Related Pull Requests