-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Upgrading from 2.3.0 to 2.4.0 raises JSONDecodeError and psycopg.errors.UndefinedColumn #1471
Comments
Did you do a `manage.py migrate`?
…On Thu, Aug 29, 2024 at 5:20 PM Jonathan Miller ***@***.***> wrote:
*Describe the bug*
I am attempting to update from 2.3.0 to 2.4.0. I have updated the package
and begun to test my endpoints.
To start I am trying to exchange a username and password for a token. This
is the most basic and important of my endpoints.
Upon submitting a username and pw in JSON format through the built in REST
GUI I am greeted with:
JSONDecodeError at /authentication/token/ Expecting value: line 1 column 1
(char 0)
When I dig into this error it's much more complicated and odd.
psycopg.errors.UndefinedColumn: column
oauth2_provider_application.hash_client_secret does not exist LINE 1: ...",
"oauth2_provider_application"."client_secret", "oauth2_pr...
I interpret this to be saying:
The table oauth2_provider_application is missing the field
hash_client_secret. I can confirm that this is true in looking at my
database.
But I thought this was handled by the migration I ran to upgrade to 2.0.0?
This has been running just fine on 2.0, 2.1, 2.2, and 2.3.
Reading through the changelog I don't see anything relating to this that
has changed and I can't seem to find any upgrade guide, which I sort of
remember, but might be getting confused with another package.
*To Reproduce*
My only settings are:
OAUTH2_PROVIDER = { 'PKCE_REQUIRED': False, 'ACCESS_TOKEN_EXPIRE_SECONDS':
2592000 # 30 days, }
I am aware PKCE defaults to True now and I am working on moving in that
direction.
*Version*
2.4.0
- I have tested with the latest published release and it's still a
problem.
- I have tested with the master branch and it's still a problem.
—
Reply to this email directly, view it on GitHub
<#1471>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBHS522J6GLDTFURBUZ2I3ZT6GADAVCNFSM6AAAAABNLHWVOGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TKNJZG43TCOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I did not, but I did |
showmigrations will show if any are pending
…On Thu, Aug 29, 2024 at 5:39 PM Jonathan Miller ***@***.***> wrote:
Did you do a manage.py migrate?
I did not, but I did manage.py makemigrations and it didn't find anything
to migrate related to oauth (just two tiny field edits I made to other
models).
—
Reply to this email directly, view it on GitHub
<#1471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBHS5ZO6NLLNP3BYPKYBQ3ZT6IIFAVCNFSM6AAAAABNLHWVOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJZGA3DSOBUGA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
All oauth2_provider migrations look to be done. That lines up with what I saw in the docs. |
@iamjonmiller I'm not sure why but
|
Yep, that is definitely missing. No idea why it's not showing up. I think we should probably do a better job of highlighting when a migration is required in a update, just as a warning. |
Did you find that migration in the installed package's oauth2_provider/migrations? If not I'm not sure why it's missing for you. Agreed about breaking changes. Going forward anything that changes models will become a new major release to highlight the breaking change. Still, I don't understand why the migration is missing for you. It's definitely present in the wheel on pypi:
and when I removed my DB it shows up:
Please investigate on your end and report what you find. Thanks. |
I uninstalled and then reinstalled and now I am seeing incomplete migrations
|
Completed migrations and everything works fine. If you encounter this error try reinstalling the package! Thanks @n2ygk |
Describe the bug
I am attempting to update from 2.3.0 to 2.4.0. I have updated the package and begun to test my endpoints.
To start I am trying to exchange a username and password for a token. This is the most basic and important of my endpoints.
Upon submitting a username and pw in JSON format through the built in REST GUI I am greeted with:
JSONDecodeError at /authentication/token/ Expecting value: line 1 column 1 (char 0)
When I dig into this error it's much more complicated and odd.
psycopg.errors.UndefinedColumn: column oauth2_provider_application.hash_client_secret does not exist LINE 1: ...", "oauth2_provider_application"."client_secret", "oauth2_pr...
I interpret this to be saying:
The table
oauth2_provider_application
is missing the fieldhash_client_secret
. I can confirm that this is true in looking at my database.But I thought this was handled by the migration I ran to upgrade to 2.0.0? This has been running just fine on 2.0, 2.1, 2.2, and 2.3.
Reading through the changelog I don't see anything relating to this that has changed and I can't seem to find any upgrade guide, which I sort of remember, but might be getting confused with another package.
To Reproduce
My only settings are:
OAUTH2_PROVIDER = { 'PKCE_REQUIRED': False, 'ACCESS_TOKEN_EXPIRE_SECONDS': 2592000 # 30 days, }
I am aware PKCE defaults to True now and I am working on moving in that direction.
Version
2.4.0
The text was updated successfully, but these errors were encountered: