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
Update to 3.8 fails with relation "customuserattribute_seq" already exists
#3447
Comments
Are you sure, it fails? I guess it does not If the sequence already exist, we simply output this information. So it should not fail or stop.
a 2nd time should not result in an error - even if the sequence exist. Please check, a) if the sequence exists and Running online Note: In version 3.6 or 3.7 pi-manage did not create the customeruserattribute_seq. Maybe the nixos-install method did. Waiting for your comment, before closing this issue. |
(note: will comment in a week, currently on vacation) |
OK, just took another look. It is correct that if the creation of the
However, we're in a failed transaction then and psycopg2 refuses to continue:
Finally, when committing, an exception will be thrown (and not caught, hence the calltrace) and thus
When checking the current version of alembic in my test VM I get:
This is a migration version from 3.7 which I deployed before into that test VM. That means that the entire migration transaction upon the 3.8 upgrade is not committed and thus Hope this helps! |
Hi @Ma27 |
@plettich may I ask how you did it? As described in https://github.com/privacyidea/privacyidea#setup? Also, on which distro (and version)? Asking because I'd like to check if I can get a reproducer on the setup you used (or if I find an error on my side while doing so :p) |
@Ma27 mostly like described there.
|
So tl;dr it is still reproducible for me. Used components:
What I did:
The last commit fails with the error I reported above, i.e.:
Did I miss something here or did I do something wrong during the upgrade procedure? |
Ok, i could reproduce this now and found the issue. Please use |
Yup that fixes the issue, thank you! %) |
Fixes db migration on 3.8. See also privacyidea/privacyidea#3447
Fixes db migration on 3.8. See also privacyidea/privacyidea#3447
Fixes db migration on 3.8. See also privacyidea/privacyidea#3447
Fixes db migration on 3.8. See also privacyidea/privacyidea#3447
Fixes db migration on 3.8. See also privacyidea/privacyidea#3447
Top-level intent
I tried to upgrade my PI instance from 3.7.4 to 3.8.
Steps to reproduce
pi-manage db upgrade
Expected outcome
Upgrade working fine without any issues.
Actual outcome
DB migration failed like this:
Context
This was probably introduced by #3384 which also creates the db sequence
customuserattribute_seq
even though the corresponding data-structures seem to exist since 3.6 which seems questionable on its own already.I just installed another instance of PrivacyIDEA at version 3.7.4 and on that instance the sequence
customuserattribute_seq
also existed already, so updating this test instance to 3.8 would cause the same problem.Configuration
services.privacyidea
Log file
n/a
The text was updated successfully, but these errors were encountered: