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

​Self hosted: Cannot sign in with the default admin credentials, keeps returning to sign in #6007

Closed
1 task
H7KZ opened this issue Mar 4, 2024 · 10 comments
Closed
1 task

Comments

@H7KZ
Copy link

H7KZ commented Mar 4, 2024

What happened?

Normally I enter the IP of my VPS (not domain), then I click sign in and enter the set admin email in my docker compose file that is then deployed on docker swarm (1 replica of each service) and who would guessed it, I cannot sign in. Tried searching both internet and github issues, so far nothing found. The steps to reproduce:

  1. deploy a new docker swarm stack (the same as docker compose) with affine, redis and postgres - correct mapping, volumes & networks
  2. visit publicly accessible port 3010
  3. Sign in
  4. After Sign in it redirects back to sign in without any errors

and one detail: the cloudflare captcha shows a small label "Testing only."

Thanks for any help!

Distribution version

Linux

What browsers are you seeing the problem on if you're using web version?

Chrome

Relevant log output

2024-03-04T20:06:15.348269447Z [Nest] 133  - 03/04/2024, 8:06:15 PM     LOG [GraphQLModule] Mapped {/graphql, POST} route +125ms
2024-03-04T20:06:15.398927888Z [Nest] 133  - 03/04/2024, 8:06:15 PM     LOG [NestApplication] Nest application successfully started +50ms
2024-03-04T20:06:15.400538905Z [Nest] 133  - 03/04/2024, 8:06:15 PM     LOG [App] AFFiNE Server is running in [selfhosted] mode
2024-03-04T20:06:15.400551855Z [Nest] 133  - 03/04/2024, 8:06:15 PM     LOG [App] Listening on http://0.0.0.0:3010
2024-03-04T20:06:15.400572159Z [Nest] 133  - 03/04/2024, 8:06:15 PM     LOG [App] And the public server should be recognized as http://localhost:3010
2024-03-04T20:06:25.269232820Z [Nest] 133  - 03/04/2024, 8:06:25 PM    WARN [NextAuth] NEXTAUTH_URL

Anything else?

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@bolavefasfas
Copy link

setup the admin email and pass varibale before you deploy database this should fix it

@EYHN
Copy link
Member

EYHN commented Mar 5, 2024

Try to delete your docker image, volume and container. Then follow the tutorial https://docs.affine.pro/docs/self-host-affine to redeploy with the username and password you want to set before starting docker.

CleanShot 2024-03-05 at 15 24 48@2x

@EYHN EYHN moved this from 🆕 *Untriaged to *Waiting for Info in AFFiNE Project Mar 5, 2024
@fabiencharrasse
Copy link

I had the same error and just found why:

I had not changed the password of the DATABASE_URL environment variable in my compose file after modifying POSTGRES_PASSWORD.

The error went unnoticed because during installation, the script spammed the logs quite a bit. The connection now works.

@PhilippMolitor
Copy link

Interestingly enough, for me it has worked to remove all persistent data from the docker compose stack and re-init affine like that, even though I never changed anything about my postgres settings from the first start on.

@fabiencharrasse
Copy link

Interestingly enough, for me it has worked to remove all persistent data from the docker compose stack and re-init affine like that, even though I never changed anything about my postgres settings from the first start on.

I had to do that too

@Kerber0ss
Copy link

Kerber0ss commented Mar 5, 2024

I removed volumes, images, containers and redeployed stack in portainer several times. Nothing.

In docker-compose.yml nothing changed, add variables to email and pssword in portainer

[Nest] 110 - 03/05/2024, 10:50:27 AM WARN [NextAuth] NEXTAUTH_URL

@fabiencharrasse i try add env POSTGRES_PASSWORD to compose and then modify it in DATABASE_URL, nothing changed.

@PhilippMolitor
Copy link

@Kerber0ss i am currently running the beta version. Maybe pull the newest images and try again?

@acranglesim
Copy link

I had the same issue - and what solved it for me was SSH'ing onto the device that stored the config paths - and rm -rf'ing inside each, so when I re-pulled it was a fresh install. This fixed it up thanks @PhilippMolitor

@EYHN
Copy link
Member

EYHN commented Mar 6, 2024

It seems that many people have reported that they have found a solution.

We will improve the login process in the next version to make selfhost login easier (now bundled with a lot of affine cloud logic)

I'll close this issue first, if there are any unresolved issues please open a new one.

@EYHN EYHN closed this as completed Mar 6, 2024
@EYHN EYHN moved this from *Waiting for Info to ✅ Answered in AFFiNE Project Mar 6, 2024
@EYHN
Copy link
Member

EYHN commented Mar 6, 2024

@Kerber0ss @H7KZ
Sorry, I just noticed that our docker compose file defines that we will store configuration files in the ~/.affine/self-host/config of the host machine.

The reason why you cannot sign in must be that this place has not been cleaned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

7 participants