Skip to content

DiscoveredPackage: "no results to fetch" #150

Description

@tdruez

From #70 (comment)

Some project error started to appear with the addition of multiprocessing, with the error message:no results to fetch

File "/opt/scancodeio/scanpipe/models.py", line 532, in save
    super().save(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 726, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 763, in save_base
    updated = self._save_table(
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 868, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/base.py", line 906, in _do_insert
    return manager._insert(
  File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1417, in execute_sql
    return [self.connection.ops.fetch_returned_insert_columns(cursor, self.returning_params)]
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/operations.py", line 185, in fetch_returned_insert_columns
    return cursor.fetchone()
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 97, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 97, in inner
    return func(*args, **kwargs)

For some reason after an insert, the inserted object cannot be fetched.

See also https://code.djangoproject.com/ticket/20161

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions