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

LDAP Sync "oncall-user-sync" AttributeError: 'Engine' object has no attribute 'execute' #390

Open
BillyAB opened this issue Mar 27, 2023 · 0 comments

Comments

@BillyAB
Copy link
Contributor

BillyAB commented Mar 27, 2023

With a freshly built docker container (built 2023-03-27) when trying to run on-call-user-sync to sync LDAP users the following error is encountered

AttributeError: 'Engine' object has no attribute 'execute'

Full error:
# env/bin/oncall-user-sync /home/oncall/config/config.yaml
2023-03-27 21:55:18,341 INFO oncall.metrics Loaded metrics handler dummy
2023-03-27 21:55:18,341 INFO oncall.metrics Loaded metrics handler dummy
2023-03-27 21:55:18,342 INFO root Starting user sync loop at 1679954118.3424478
2023-03-27 21:55:18,342 INFO root Starting user sync loop at 1679954118.3424478
Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "/home/oncall/env/lib/python3.8/site-packages/oncall/user_sync/ldap_sync.py", line 446, in main
    sync(config, engine)
  File "/home/oncall/env/lib/python3.8/site-packages/oncall/user_sync/ldap_sync.py", line 299, in sync
    for row in engine.execute(users_query):
AttributeError: 'Engine' object has no attribute 'execute'
2023-03-27T21:55:18Z <Greenlet at 0x7f40f8e47360: main({'server': {'host': 'localhost', 'port': 8080}, 'd)> failed with AttributeError

From research it turns out that this is due to a breaking change in SQLAlchemy v2.

I have managed to resolve this by pinning SQLAlchemy to less than 2.0.0 in setup.py

sqlalchemy<2.0.0

Thought it was worth brining to your attention so you can pin it in the repo, or updating the sync script to work with the newer version of SQLAlchemy

@BillyAB BillyAB changed the title LDAP Sync "oncall-user-sync" LDAP Sync "oncall-user-sync" AttributeError: 'Engine' object has no attribute 'execute' Mar 27, 2023
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

No branches or pull requests

1 participant