8000 After upgrade from 0.61.1 to 0.77.3, existing users can't log in through Google · Issue #7271 · outline/outline · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

After upgrade from 0.61.1 to 0.77.3, existing users can't log in through Google #7271

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

Closed
alexislefebvre opened this issue Jul 18, 2024 · 4 comments
Labels
bug self-hosted Issues related to self-hosting the code

Comments

@alexislefebvre
Copy link
Contributor
alexislefebvre commented Jul 18, 2024

We duplicated our instance of Outline and upgraded it from 0.61.1 to 0.77.3, existing users can't log in through Google.

We followed this documentation to generate new credentials for the new sub-domain bound to this new instance: https://docs.getoutline.com/s/hosting/doc/google-hOuvtCmTqQ

To Reproduce
Steps to reproduce the behavior:

  1. Open Outline
  2. Log in through Google
  3. Get an error about the Google auth

Expected behavior
Log in should work.

Logs

{"label":"http","level":"info","message":"  <-- GET /auth/google.callback?state=[…]&code=[…]&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=1&hd=[…]&prompt=consent"}
{"error":"Validation error","level":"error","message":"Error during authentication","stack":"Error\n    at Query.run (/opt/outline/node_modules/sequelize/lib/dialects/postgres/query.js:50:25)\n    at /opt/outline/node_modules/sequelize/lib/sequelize.js:315:28\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async PostgresQueryInterface.insert (/opt/outline/node_modules/sequelize/lib/dialects/abstract/query-interface.js:308:21)\n    at async User.save (/opt/outline/node_modules/sequelize/lib/model.js:2490:35)\n    at async user.create (/opt/outline/node_modules/sequelize/lib/model.js:1362:12)\n    at async userProvisioner (/opt/outline/build/server/commands/userProvisioner.js:176:18)\n    at async accountProvisioner (/opt/outline/build/server/commands/accountProvisioner.js:79:12)"}
{"label":"http","level":"info","message":"  --> GET /auth/google.callback?state=[…]&code=[…]&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&authuser=1&hd=[…]&prompt=consent 302 264ms 69b"}
{"label":"http","level":"info","message":"  <-- GET /?notice=auth-error"}

Formatted stack trace

Error
at Query.run (/opt/outline/node_modules/sequelize/lib/dialects/postgres/query.js:50:25)
at /opt/outline/node_modules/sequelize/lib/sequelize.js:315:28
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PostgresQueryInterface.insert (/opt/outline/node_modules/sequelize/lib/dialects/abstract/query-interface.js:308:21)
at async User.save (/opt/outline/node_modules/sequelize/lib/model.js:2490:35)
at async user.create (/opt/outline/node_modules/sequelize/lib/model.js:1362:12)
at async userProvisioner (/opt/outline/build/server/commands/userProvisioner.js:176:18)
at async accountProvisioner (/opt/outline/build/server/commands/accountProvisioner.js:79:12)

Is it trying to create one user? This account already exists in the database.

Screenshots
.

Outline (please complete the following information):

  • Install: self hosted
  • Version: 0.77.3

Desktop (please complete the following information):

  • OS: Ubuntu 22.04.4 LTS
  • Browser: Mozilla Firefox
  • Version: 128.0
Copy link
linear bot commented Jul 18, 2024

@alexislefebvre alexislefebvre changed the title After upgrade from 0.61.1 to 0.77.3, users can't log in through Google After upgrade from 0.61.1 to 0.77.3, existing users can't log in through Google Jul 18, 2024
@tommoor tommoor added the self-hosted Issues related to self-hosting the code label Jul 18, 2024
@alexislefebvre
Copy link
Contributor Author
alexislefebvre commented Jul 18, 2024

I check the data which was used to check if the user existed, and after some research, it looked for the correct email but the wrong team. We removed the team which had no user. And now we have an error:

{"level":"warn","message":"\nThis version of Outline cannot start until a data migration is complete.\nBackup your database, run the database migrations and the following script:\n(Note: script run needed only when upgrading to any version between 0.54.0 and 0.61.1, including both)\n\n$ node ./build/server/scripts/20210226232041-migrate-authentication.js\n"}

We initially copy-pasted the whole database with rsync, we'll try to transfer the database with the export / import function to see if that fixes the issue.

We restored the database from the 0.61.1 version and it looks like we are missing some migrations:

outline=# SELECT * FROM "SequelizeMeta" WHERE name LIKE '20210226%';
                    name                    
--------------------------------------------
 20210226232041-authentication-providers.js
(1 row)

outline=# SELECT * FROM "SequelizeMeta" WHERE name = '20210226232041-migrate-authentication.js';
 name 
------
(0 rows)

Actually the table from this migration exists in our database.

@alexislefebvre
Copy link
Contributor Author
alexislefebvre commented Jul 18, 2024

We fixed the issue by removing one team that was bound to the Slack auth, that we don't use anymore:

outline=# SELECT * FROM authentication_providers;
       id     |  name  | providerId | enabled |  teamId      |         createdAt          
--------------+--------+------------+---------+--------------+----------------------------
 2e4ba4d7-[…] | google | […]        | t       | ef4e6cf1-[…] | 2022-01-19 12:37:45.01+00
 aaf01e1f-[…] | slack  | T02[…]     | t       | 330e03c8-[…] | 2022-01-19 12:37:45.098+00
(2 rows)

outline=# DELETE FROM authentication_providers WHERE id = 'aaf01e1f-[…]';
DELETE 1

outline=# DELETE FROM events WHERE "teamId" = '330e03c8-[…]';
DELETE 3

outline=# DELETE FROM teams WHERE id = '330e03c8-[…]';
DELETE 1

And now we can authenticate through Google.

@tommoor
Copy link
Member
tommoor commented Jul 18, 2024

Thanks for documenting, I'm glad you got this working. In self-hosted mode there should never be more than a single team in the database, the behavior can be unpredictable if that ends up being the case.

There is another issue here #7201 where we're trying to get to the bottom of how that can occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug self-hosted Issues related to self-hosting the code
Projects
None yet
Development

No branches or pull requests

2 participants
0