Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Postgresql backend error when deleting empty collection #528

Closed
leplatrem opened this issue Oct 30, 2015 · 0 comments
Closed

Postgresql backend error when deleting empty collection #528

leplatrem opened this issue Oct 30, 2015 · 0 comments
Assignees
Labels

Comments

@leplatrem
Copy link
Contributor

2015-10-30 11:24:32,387 ERROR [venusian][waitress] "DELETE /v1/buckets/test_bucket/collections/test_collection/records" ? (? ms) (psycopg2.ProgrammingError) syntax error at or near ")"
LINE 3:          WHERE object_id IN ();
                                     ^
 [SQL: '\n        DELETE FROM access_control_entries\n         WHERE object_id IN %(object_id_list)s;'] [parameters: {'object_id_list': ()}] lang=None; uid=298c0fb10533de015eaf3379861d02293a3e2775ebd5ed1fda507a9128aac07d; errno=None; agent=python-requests/2.4.3 CPython/2.7.9 Linux/3.19.0-31-generic; authn_type=BasicAuth; collection_id=record; collection_timestamp=1446200672385
2015-10-30 11:24:32,390 CRITI [venusian][waitress] "DELETE /v1/buckets/test_bucket/collections/test_collection/records" ? (? ms) (psycopg2.ProgrammingError) syntax error at or near ")"
LINE 3:          WHERE object_id IN ();
                                     ^
 [SQL: '\n        DELETE FROM access_control_entries\n         WHERE object_id IN %(object_id_list)s;'] [parameters: {'object_id_list': ()}] lang=None; exception=Traceback (most recent call last):
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
    response = handler(request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
    response = view_callable(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 596, in __call__
    return view(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 329, in attr_view
    return view(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 305, in predicate_wrapper
    return view(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 245, in _secured_view
    return view(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 355, in rendered_view
    result = view(context, request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/pyramid/config/views.py", line 501, in _requestonly_view
    response = view(request)
  File "/home/mathieu/Code/Mozilla/kinto/.venv/local/lib/python2.7/site-packages/cornice/service.py", line 571, in wrapper
    response = view_()
  File "/home/mathieu/Code/Mozilla/cliquet/cliquet/resource/__init__.py", line 295, in collection_delete
    deleted = self.model.delete_records(filters=filters)
  File "/home/mathieu/Code/Mozilla/cliquet/cliquet/resource/model.py", line 266, in delete_records
    self.permission.delete_object_permissions(*perm_ids)
  File "/home/mathieu/Code/Mozilla/cliquet/cliquet/permission/postgresql/__init__.py", line 315, in delete_object_permissions
    conn.execute(query, dict(object_id_list=tuple(object_id_list)))
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/mathieu/Code/Mozilla/cliquet/cliquet/storage/postgresql/client.py", line 51, in connect
    raise exceptions.BackendError(original=e)
BackendError: ProgrammingError: (psycopg2.ProgrammingError) syntax error at or near ")"
LINE 3:          WHERE object_id IN ();
                                     ^
 [SQL: '\n        DELETE FROM access_control_entries\n         WHERE object_id IN %(object_id_list)s;'] [parameters: {'object_id_list': ()}]; uid=298c0fb10533de015eaf3379861d02293a3e2775ebd5ed1fda507a9128aac07d; errno=None; agent=python-requests/2.4.3 CPython/2.7.9 Linux/3.19.0-31-generic; authn_type=BasicAuth; collection_id=record; collection_timestamp=1446200672385
@leplatrem leplatrem added the bug label Oct 30, 2015
@leplatrem leplatrem self-assigned this Oct 30, 2015
leplatrem added a commit that referenced this issue Oct 30, 2015
Fix PostgreSQL error when deleting an empty collection (fixes #528)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant