mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-05-22 16:14:20 -05:00
Adding existing user to Organization fails #179
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dirtycajunrice on GitHub (Jan 7, 2019).
When adding an existing user to an organization, the email sends properly, but the link fails with "please ask admin to send another invite". When resending the invite, the logging states there is no invite. So its a circular failure :/
Relevant logging:
That has the send, the try, and the resend
@njfox commented on GitHub (Jan 7, 2019):
The logs indicate that the invite token is invalid for some reason, although I just tried and was not able to reproduce this. Does the user belong to any other organizations or were they invited originally from the /admin page?
Also we've found the issue that is preventing you from reinviting the user and will try to fix that today.
@dirtycajunrice commented on GitHub (Jan 7, 2019):
They were originally added with /admin + env for disallowing signups. They are a brand new (as of the log) 5 minute old account. Do either of the above cause the issue? Also, wonderful. I love an active project!
@dani-garcia commented on GitHub (Jan 7, 2019):
The resend bug should be fixed just now in
21b85b78. Having brand new users shoudn't affect anything, I don't think, but I'll try to test it.@dirtycajunrice commented on GitHub (Jan 7, 2019):
Awesome. let me know what happens with the test. I can test the new push, but to make sure im pulling changes, does the master branch immediately update the automatic build for mprasil/bitwarden? (i ask because the commit is only 2 hours old but the last build is 3+ hours old)
@dani-garcia commented on GitHub (Jan 7, 2019):
No, those builds are triggered manually by @mprasil, and it'll take about an hour after he does that for them to build.
@dirtycajunrice commented on GitHub (Jan 7, 2019):
So i did further testing, and trying to create a user directly from the org without them existing already creates the same error!
I am starting to lean towards the possibility that its having an issue reaching an endpoint through reverse proxy...
nginx config:
Bitwarden resolves internally as its a docker network (just for clarity)
Nginx access log for the 500 error call (if relevant):
@njfox commented on GitHub (Jan 7, 2019):
Just to confirm, do you have the
DOMAINenvironment variable set to an externally resolving hostname? E.g.-e DOMAIN=https://password.foo.com@dirtycajunrice commented on GitHub (Jan 7, 2019):
i do. Relevant docker-compose.yaml snippit:
and the email wouldnt create the link to the instance properly if domain was set improperly or not at all, correct?
@njfox commented on GitHub (Jan 7, 2019):
Right, it would still generate a link, it would just point to http://localhost:8000 (I think) which would be useless to an external user
@dirtycajunrice commented on GitHub (Jan 7, 2019):
Yeah. so after multiple tests with more visibility, it looks like although i can create organizations, i cannot add users regardless of new or otherwise. So organization usage is borked whatsoever. all organization additions end with the same console out of
and this with the registration using the above link
That was creating a brand new org "test" and using my test alternate email for addition.
@njfox commented on GitHub (Jan 7, 2019):
Can you go through the invite/registration flow with the browser dev console open (f12)? You should be able to see the traffic under the Network tab. Once you do that, can you compare the POST to
/accounts/registerand/or/acceptand confirm that the token parameter in the body is exactly the same as the one that shows up in the invite link in the logs? It's a longshot, but I'm curious if the SMTP provider is mangling the token somehow@dirtycajunrice commented on GitHub (Jan 7, 2019):
Absolutely!
https://hastebin.com/<redacted>That includes the invite post, the link, the link get, and the registration post :)
@dirtycajunrice commented on GitHub (Jan 7, 2019):
AHA! ive found it. In the console, the email sent shows
with the token as
Yet the link recieved in the email is:
The difference is
%0D%20That is injected towards the end. I dont know why that is being injected either. I cant find it happening in the mail server as its already that as its sent@dirtycajunrice commented on GitHub (Jan 7, 2019):
Further testing has shown connecting directly to gsuite instead of my postfix proxy does not mangle the link. That objectively defines my proxy as the point of failure. Ill look into that on my side. That just leaves the other thing thats actually a bug!Update for notation:
Further conversation with the devs and they established that smtp has a max line limitation of 998 characters.
Leaving this open for both bugs <3
@dani-garcia commented on GitHub (Jan 7, 2019):
I pushed
50eeb4f65, which should remove any strange whitespace added, I tested it adding those characters you mention and it seems to work now. This would make the links work, at least.@dirtycajunrice commented on GitHub (Jan 7, 2019):
Woot! I’ll monitor for the docker build
@mprasil commented on GitHub (Jan 7, 2019):
Just triggered it :) Should be ready in about an hour.
@njfox commented on GitHub (Jan 8, 2019):
@DirtyCajunRice have you had a chance to test whether this resolves the issue?
@dirtycajunrice commented on GitHub (Jan 8, 2019):
Sorry been on a bender with a sql install at work. Testing now
On Mon, Jan 7, 2019 at 9:11 PM Nick Fox notifications@github.com wrote:
@dirtycajunrice commented on GitHub (Jan 8, 2019):
As of the docker build from 6 hours ago it is still an issue.
@dirtycajunrice commented on GitHub (Jan 8, 2019):
In fact there are more things going oddly than before. Before if i removed the unicode i could use the link. Now it always says "Registration not allowed". I removed signups=false and then no matter what the new account could not be created. That includes deleting and adding the account over
@dani-garcia commented on GitHub (Jan 8, 2019):
Did you try deleting the invited account from the admin panel before inviting the user again?
@dani-garcia commented on GitHub (Jan 8, 2019):
Note that there was an error in the reinvite logic that was just fixed by
f1161c65f@dani-garcia commented on GitHub (Jan 10, 2019):
This should be fixed now