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

sqlalchemy >= 1.4 breaks the cleanup cli #94

Open
david-caro opened this issue Aug 31, 2022 · 1 comment · May be fixed by #93
Open

sqlalchemy >= 1.4 breaks the cleanup cli #94

david-caro opened this issue Aug 31, 2022 · 1 comment · May be fixed by #93

Comments

@david-caro
Copy link

We are getting the following error after upgrading sqlalchemy:

# backy2 cleanup
    INFO: [backy2.logging] $ /usr/bin/backy2 cleanup
    INFO: [backy2.logging] Deleting false positives...
/usr/lib/python3/dist-packages/backy2/meta_backends/sql.py:569: SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
  self.session.query(DeletedBlock.uid).filter(DeletedBlock.uid.in_(self.session.query(Block.uid).distinct(Block.uid).filter(Block.uid.isnot(None)).subquery())).filter(DeletedBlock.time < (inttime() - dt)).delete(synchronize_session=False)
   ERROR: [backy2.logging] subject table for an INSERT, UPDATE or DELETE expected, got Column('uid', String(length=32), table=<deleted_blocks>).
   ERROR: [backy2.logging] Backy failed.


# python3 -c 'import sqlalchemy; print(sqlalchemy.__version__)'
1.4.23

Version 1.4 introduced some extra restrictions to the old api, and a whole new api, and those seem to be breaking that specific contstruct.

@david-caro david-caro linked a pull request Aug 31, 2022 that will close this issue
@SinisterCrayon
Copy link

Anyone else having this same problem, I can confirm the patch @david-caro posted fixes the issue.

wmfgerrit pushed a commit to wikimedia/operations-puppet that referenced this issue Sep 14, 2023
Without this patch the 'cleanup' feature is broken.

This patch is attached to this upstream issue:

https: //github.com/wamdam/backy2/issues/94

Change-Id: I99a49d07651a5e4abc0a4557f8de5ab6f64cca4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants