Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the repos with a broken package fails #155

Open
jelly opened this issue Apr 23, 2019 · 1 comment
Open

Updating the repos with a broken package fails #155

jelly opened this issue Apr 23, 2019 · 1 comment

Comments

@jelly
Copy link
Member

jelly commented Apr 23, 2019

Updating package cache...
  -> Querying alpm database...done
  -> Latest package: ruby-msgpack 1.2.10-1 Tue Apr 23 14:28:52 2019
  -> Updating database cache...Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
    cursor.execute(statement, parameters)
sqlite3.IntegrityError: NOT NULL constraint failed: package.arch
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "./trackerctl", line 5, in <module>
    cli.main()
  File "/usr/lib/python3.7/site-packages/flask/cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/flask/cli.py", line 412, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/srv/http/security-tracker/tracker/cli/update.py", line 44, in env
    ctx.invoke(cache)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/flask/cli.py", line 412, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/srv/http/security-tracker/tracker/cli/update.py", line 35, in cache
    update_package_cache()
  File "/srv/http/security-tracker/tracker/maintenance.py", line 94, in update_package_cache
    db.session.bulk_insert_mappings(Package, new_packages)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/scoping.py", line 162, in do
    return getattr(self.registry(), name)(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2790, in bulk_insert_mappings
    render_nulls,
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2880, in _bulk_save_mappings
    transaction.rollback(_capture_exception=True)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 129, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/session.py", line 2874, in _bulk_save_mappings
    render_nulls,
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 102, in _bulk_insert
    bookkeeping=return_defaults,
  File "/usr/lib/python3.7/site-packages/sqlalchemy/orm/persistence.py", line 1066, in _emit_insert_statements
    c = cached_connections[connection].execute(statement, multiparams)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 988, in execute
    return meth(self, multiparams, params)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/sql/elements.py", line 287, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1107, in _execute_clauseelement
    distilled_params,
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1466, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 383, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 128, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/usr/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 552, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: package.arch
[SQL: INSERT INTO package (name, base, version, "database", builddate) VALUES (?, ?, ?, ?, ?)]
[parameters: ('metasploit', 'metasploit', '5.0.9-1', 'community', 0)]
(Background on this error at: http://sqlalche.me/e/gkpj)
@jelly
Copy link
Member Author

jelly commented Apr 23, 2019

Not reproducible with the archive package, but it was corrupted on our mirror somehow (desc was not readable).

https://archive.archlinux.org/packages/m/metasploit/metasploit-5.0.9-1-x86_64.pkg.tar.xz

Purpose of the ticket is a discussion if we want to keep hard failing or handle this more gracefully.

User report (not useful) https://bugs.archlinux.org/task/62443

@jelly jelly added the bug label Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants