Page MenuHomeSoftware Heritage

Handle annotated tag with no tagger
Open, NormalPublic

Description

Git loader errors of type psycopg2.IntegrityError: null value in column "fullname" violates not-null constraint [1] correspond to the processing of git annotated tags with no tagger, see for instance:

Due to a non null constraint to the fullname column of the person table [2], the following exception is raised
in swh-storage:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/api/server.py", line 163, in release_add
    return encode_data(get_storage().release_add(**decode_request(request)))
  File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/storage.py", line 647, in release_add
    db.release_add_from_temp(cur)
  File "/home/antoine/swh/swh-environment/swh-storage/swh/storage/db.py", line 39, in _meth
    self._cursor(cur).execute('SELECT %s()' % stored_proc)
psycopg2.IntegrityError: ERREUR:  une valeur NULL viole la contrainte NOT NULL de la colonne « fullname »
DETAIL:  La ligne en échec contient (27, null, null, null)
CONTEXT:  instruction SQL « with t as (
        select distinct author_fullname as fullname, author_name as name, author_email as email from tmp_release
    ) insert into person (fullname, name, email)
    select fullname, name, email from t
    where not exists (
        select 1
        from person p
        where t.fullname = p.fullname
    ) »
fonction PL/pgsql swh_person_add_from_release(), ligne 3 à instruction SQL
instruction SQL « SELECT swh_person_add_from_release() »
fonction PL/pgsql swh_release_add(), ligne 3 à PERFORM

Removing the non null constraint seems to fix the issue while preserving correct release identifier computation
once retrieved from the swh database.

[1] http://kibana0.internal.softwareheritage.org:5601/app/kibana#/dashboard/22195930-d36e-11e8-913b-077937c6a5ef?_g=(refreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-60d%2Cmode%3Aquick%2Cto%3Anow))

[2] https://forge.softwareheritage.org/source/swh-storage/browse/master/swh/storage/sql/30-swh-schema.sql$161

Event Timeline

anlambert triaged this task as Normal priority.