Kavita icon indicating copy to clipboard operation
Kavita copied to clipboard

BUG - Unable to create User accounts

Open Eikfo opened this issue 1 year ago • 15 comments

Describe the bug Further to full reset of Kavita (deletion of existing containers, including database) & update towards 0.5.4.0, user account creation returns an error 400.

Bogus email is used, no link provided.

To Reproduce Steps to reproduce the behavior:

  1. Go to Admin Dashboard
  2. Click on Invite
  3. Write E-mail [random letters]
  4. Select Roles: Download; Libraries All
  5. Click Invite

Expected behavior Link provided to create account without sending registration e-mail

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: OMV 5.6.26-1(Usul) / Docker 5:20.10.17~3-0~debian-buster / Portainer 2.14.0
  • Browser Chrome
  • Version 0.5.4.0

Additional context _kavita-kavita-1_logs (1).txt error400

Eikfo avatar Jul 09 '22 21:07 Eikfo

I think you were the user from discord support, but I will double confirm there are no edge cases in our flow where the link doesn't show.

majora2007 avatar Jul 14 '22 13:07 majora2007

Yes indeed, that was me.

An additional info: I noted that if I cancel the process while it's trying to generate a link, a pending invite is created. There's however no way to obtain a new link from this pending invite.

Eikfo avatar Jul 14 '22 19:07 Eikfo

There is a way actually. You should go to Admin Dashboard -> System -> Actions -> Download logs. Open latest log and find link by searching for e-mail you have tried to send invitation to. However this link doesn't allow to register new user. No matter what you write into forms User, Email, Password - you will get a error

400
The email does not match the registered email

even if it does. So at this moment there is no way to add new user without setting up email server. Sad...

Entmatix avatar Jul 16 '22 18:07 Entmatix

@Entmatix that is not correct. Per my system, you can create a user by going through invite user flow. In all cases a link should appear in logs and on screen. The admin can click the link and continue the registration process.

Hence why there is a ticket to investigate inconsistencies in some users systems.

majora2007 avatar Jul 16 '22 19:07 majora2007

Update:

I could create an account in the following way:

  • Create account with [random name] as the e-mail
  • Get into the logs to retrieve the invitation e-mail
  • Proceed with account creation with a pseudo different than [random name]

I could reproduce the process a couple of times, but it also failed a couple of times with the error 400 mentioned by Entmatix. As far as I could see, the variable seems to be how quick I cancel the invite (before error message is shown). If the error is showing, I cannot use the link, if it's before that, it seems to work.

Eikfo avatar Jul 16 '22 21:07 Eikfo

Thanks for the tip @Eikfo. I created a user while error message had not appeared. Still it's just a workaround. Would be nice to have a fix for that.

Entmatix avatar Jul 17 '22 08:07 Entmatix

See I'm not able to reproduce. I just tested on my local and dev server and everything is working correctly. image

Steps:

  1. Invite User
  2. Type email (valid or not)
  3. Select at least one library
  4. Press Invite and wait
  5. This screen pops up. I can then use the link or the url to finish setup.

Are you guys doing anything different? Can someone please clear their logs, do the flow, then upload via (System -> Task -> Download Logs) in the UI their logs?

The logs attached are copy/pasted and not having anything important in them.

majora2007 avatar Jul 17 '22 14:07 majora2007

@majora2007, hope it will help.

Log - https://0x0.st/o1IJ.log Quick demo - https://0x0.st/o1Iy.mov

Entmatix avatar Jul 17 '22 14:07 Entmatix

The mov was not available, but @Entmatix are you on the nightly by any chance? I implemented some code to help streamline this process and wondered if it would fix your issue (or at least be a solid workaround)?

https://github.com/Kareadita/Kavita/pull/1381

majora2007 avatar Jul 17 '22 15:07 majora2007

@majora2007 , I'm on latest image from hub.docker.com.

Sorry, I don't use public clouds or video platforms. Try this one - https://file.io/VvOyYqJJaX3k

Thanks for quick fix. I'll try it a bit later if it will be available in docker.

Entmatix avatar Jul 17 '22 15:07 Entmatix

Okay interesting, it doesn't ever finish. I wonder what could be happening. Can you help enlighten me on the url you're accessing kavita on? Is it publicly available and hence would Kavita be trying to send an email?

Latest is stable, so you wont get this fix for some time. This is def not fixed by the current change, so I need more information. The logs don't actually show anything out of the ordinary.

majora2007 avatar Jul 17 '22 16:07 majora2007

@majora2007, here are the logs after:

  • deleting previous logs & restarting container
  • Creating user with all roles, letting run to error
  • Creating user with no roles, letting run to error
  • Creating user with download role, cancellation & account creation from link retrieved in the logs.

kavita_logs_07_17_2022 (1).zip

I followed the same process as what was in the movie of Entmatix, but I didn't bother with an "@bogusdomain.something" on the fake email.

Eikfo avatar Jul 17 '22 16:07 Eikfo

@majora2007, the url is not publicly available. My scheme is:

public domain -> private ip (home lan) -> reverse proxy (nginx-proxy-manager) -> docker container

Kavita's container is able to connect anything outside including anything outside my lan.

root@nas:/kavita# dig github.com +short
140.82.121.3
root@nas:/kavita# ping github.com -c 4
PING github.com (140.82.121.4) 56(84) bytes of data.
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=1 ttl=54 time=52.3 ms
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=2 ttl=54 time=53.0 ms
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=3 ttl=54 time=52.3 ms
64 bytes from lb-140-82-121-4-fra.github.com (140.82.121.4): icmp_seq=4 ttl=54 time=52.2 ms

--- github.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 52.163/52.451/53.040/0.345 ms

The above commands were executed from inside of the container.

UPD. A bit more information about url. Here how it looks like:

kavita.mydomain.xyz -> 10.33.0.2 (nas ip) -> nginx-proxy-manager -> 10.33.0.2:62002 -> docker container with published port 62002:5000

Entmatix avatar Jul 17 '22 17:07 Entmatix

@Entmatix sorry for taking so long, can you try pinging our email service from your container?

GET https://email.kavitareader.com/api/email/test

you should get a true/false back

I'm thinking maybe there is some double NAT stuff going on and maybe and edge case is being triggered, that I can't reproduce as I have a simple reverse proxy -> kavita situation.

majora2007 avatar Aug 09 '22 12:08 majora2007

@majora2007

docker exec -i kavita curl https://email.kavitareader.com/api/email/test
true

docker exec -i kavita ping -c 4 email.kavitareader.com
PING email.kavitareader.com (188.114.96.0) 56(84) bytes of data.
64 bytes from 188.114.96.0 (188.114.96.0): icmp_seq=1 ttl=54 time=47.9 ms
64 bytes from 188.114.96.0 (188.114.96.0): icmp_seq=2 ttl=54 time=48.0 ms
64 bytes from 188.114.96.0 (188.114.96.0): icmp_seq=3 ttl=54 time=50.8 ms
64 bytes from 188.114.96.0 (188.114.96.0): icmp_seq=4 ttl=54 time=48.3 ms

--- email.kavitareader.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 47.899/48.738/50.760/1.173 ms

Entmatix avatar Aug 10 '22 05:08 Entmatix

I haven't forgotten about this issue, just not sure how to proceed.

majora2007 avatar Aug 15 '22 13:08 majora2007

@majora2007 I'd like to help. If you need any info, ask me. I'm not an expert neither in docker nor programming, but I can perform user tests and share results.

Entmatix avatar Aug 15 '22 15:08 Entmatix

I just confirmed with a user that was facing similar issues and the fixes I put in nightly fixed it for them. The next stable is about to release, so I would suggest trying on that (v0.5.5) and letting me know.

majora2007 avatar Aug 15 '22 19:08 majora2007

@majora2007 good to know, thanks!

Entmatix avatar Aug 15 '22 19:08 Entmatix

Hi All, with v0.5.5 out, can you please let me know if this solved it for you?

majora2007 avatar Aug 21 '22 20:08 majora2007

Joining the conversation late, but I'm experiencing this issue on docker from 0.5.5.1

Same steps taken as listed above by other users

djolker avatar Aug 23 '22 01:08 djolker

This issue is very elusive, I'm not sure I'll be able to fix alone. I may need to have a call with one of you and have you setup the actual dev environment to find the underlying issue and debug it via discord call. If any of you is interested, please let me know.

majora2007 avatar Aug 23 '22 13:08 majora2007

Hi I just tried the first time to use Kavita on my Synology under Docker and I have the exact same issue like it is described here. So I attach myself also to this discussion here

Additional Info: I changed the config so that it passes trough my reverse proxy and is accessible from the internet instead of only locally and with that I can invite someone.

ISeeTWizard avatar Aug 23 '22 13:08 ISeeTWizard

I attempted rolling back versions going as far as 0.5.2 but was still experiencing the same issue (following the same steps: 1. Invite user through the UI, 2. Download logs to get the latest invite token link 3. Provide username email and Password on registration link page 4. Receive error). I wonder if this may be specific to our configurations some how.

djolker avatar Aug 23 '22 16:08 djolker

I'm also experiencing this issue on Kavita version 0.5.5.1 Setup = Proxmox VE 7.2-3 -> Ubuntu Server 20.04 LTS (VM) -> Docker 20.10.17 -> Kavita 0.5.5.1

ZestMyu avatar Aug 23 '22 21:08 ZestMyu

@majora2007 , thanks for new release, but unfortunately bug still exists in 0.5.5.1.

Entmatix avatar Aug 24 '22 05:08 Entmatix

Hi guys, I have an auth rework planned in v0.5.7. I'm going to move this issue there. The offer still stands if anyone can run the dev build (via VS or Rider) and hop on a call with me, I will prioritize this bug. But it's been me testing over and over trying to reproduce and not having much luck.

majora2007 avatar Aug 24 '22 20:08 majora2007

Is anyone here on the nightly releases? I think I found a way to nail this issue down, but need some tester. Please let me know and if so, I will package a build out.

majora2007 avatar Aug 30 '22 13:08 majora2007

Just confirmed with a user in same boat that the root cause is correct and we were able to move ahead. For users with this issue, you will be able to invite users, but the email service might not work due to unique network connections. This will be fixed in v0.5.6 (which is coming next weekish)

majora2007 avatar Aug 30 '22 13:08 majora2007

Hello, I just pulled from the docker nightly release located at https://hub.docker.com/r/kizaing/kavita/tags

When creating a new instance of Kavita and inviting a new user, The email service does not work, nor does the link from the docker logs to register the account.

Upon attempted registration, i receive the error "The email does not match the registered email" despite having not changed the 'email' field on the registration form from the autofilled email address.

Does the docker nightly not reflect changes made here?

djolker avatar Aug 30 '22 13:08 djolker