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

TokenOwner migration fails with token with multiple realms #1485

fredreichbier opened this Issue Mar 5, 2019 · 0 comments


None yet
1 participant
Copy link

fredreichbier commented Mar 5, 2019

Steps to reproduce:

  • Check out 466d562 (a revision before the tokenowner migration)
  • Create one internal resolver int, create a user hallo
  • Create two realms realm1 and realm2, both with resolver int
  • Enroll a token for hallo, add both realms as token realms
  • Check out current master
  • Run pi-manage db stamp 4f32a4e1bf33, pi-manage db upgrade

At the very end:

Failed to migrate token assignment data!
'unicode' object has no attribute '_sa_instance_state'

This is due to this line:

reso_realms = session.query(ResolverRealm).filter(ResolverRealm.resolver == token.resolver).all()

that requires ResolverRealm.resolver (which should be a Resolver object) to be equal to token.resolver (which is a string).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.