#2835 hub doesn't check for rpmsig uniqueness
Closed: Fixed 2 years ago by tkopecek. Opened 2 years ago by mikem.

If a duplicate rpmsig is added, the hub will try to insert and a db error results.

2021-04-25 14:42:17,496 [WARNING] m=addRPMSig u=autobot-radas-stage p=626304 r=10.19.192.41:41866 koji.xmlrpc: Traceback (most recent call last):
  File "/usr/share/koji-hub/kojixmlrpc.py", line 253, in _wrap_handler
    response = handler(environ)
  File "/usr/share/koji-hub/kojixmlrpc.py", line 277, in handle_rpc
    return self._dispatch(method, params)
  File "/usr/share/koji-hub/kojixmlrpc.py", line 314, in _dispatch
    ret = koji.util.call_with_argcheck(func, params, opts)
  File "/usr/lib/python3.6/site-packages/koji/util.py", line 271, in call_with_argcheck
    return func(*args, **kwargs)
  File "/usr/share/koji-hub/kojihub.py", line 11761, in addRPMSig
    return add_rpm_sig(an_rpm, base64.b64decode(data))
  File "/usr/share/koji-hub/kojihub.py", line 7470, in add_rpm_sig
    _dml(insert, locals())
  File "/usr/share/koji-hub/kojihub.py", line 5210, in _dml
    c.execute(operation, values)
  File "/usr/lib/python3.6/site-packages/koji/db.py", line 142, in execute
    ret = self.cursor.execute(operation, parameters)
psycopg2.IntegrityError: duplicate key value violates unique constraint "rpmsigs_no_resign"
DETAIL:  Key (rpm_id, sigkey)=(13657782, 37036783) already exists.

We should either check beforehand, or catch this error and return something friendlier to the client.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.26

2 years ago

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

2 years ago

Metadata Update from @mfilip:
- Issue tagged with: testing-done

2 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #2909 Merged 2 years ago