mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Can't grant access for user to any collections in organisation #792
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 @jirireischig on GitHub (Sep 2, 2020).
Subject of the issue
It's not possible to grant access only for any selected collections in organisation.
Your environment
Steps to reproduce
Go to organisation - Manage - edit some user and check option "This user can access only the selected collections" and click on Save button.
Expected behaviour
Save new options.
Actual behaviour
Got error:
"An error has occurred.
An unexpected error has occurred."
Relevant logs
From browser developer tools:
Request method PUT, URL: https://bitwarden/api/organizations/111/users/222 return status code 422
Request payload:
{"collections":[{"id":"333","readOnly":false}],"accessAll":false,"type":2}
@dani-garcia commented on GitHub (Sep 13, 2020):
Do you get a more specific error in the server logs?
@jirireischig commented on GitHub (Sep 13, 2020):
I got this when log level is debug:
Sep 13 22:23:37 bitwarden_rs[11845]: [2020-09-13 22:23:37.366][request][INFO] PUT /api/organizations/111/users/222
Sep 13 22:23:37 bitwarden_rs[11845]: [2020-09-13 22:23:37.366][request][INFO] PUT /api/organizations/111/users/1222
Sep 13 22:23:37 v bitwarden_rs[11845]: [2020-09-13 22:23:37.367][response][INFO] PUT /api/organizations/<org_id>/users/<org_user_id> (put_organization_user) => 422 Unprocessable Entity
Sep 13 22:23:37 bitwarden_rs[11845]: [2020-09-13 22:23:37.367][response][INFO] PUT /api/organizations/<org_id>/users/<org_user_id> (put_organization_user) => 422 Unprocessable Entity
@BlackDex commented on GitHub (Sep 23, 2020):
You do not have a reverse proxy infront right?
Is the certificate valid? Do you see any errors within the developer console of the browser (F12)?
@jirireischig commented on GitHub (Sep 24, 2020):
I have Apache as webserver with this virtual server conf:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /notifications/hub(.*) ws://127.0.0.1:3012/$1 [P,L]
ProxyPass / http://127.0.0.1:8000/
ProxyPreserveHost On
ProxyRequests Off
RequestHeader set X-Real-IP %{REMOTE_ADDR}s
Errors from developer console:
zone.js:1152 PUT https://bitwarden/api/organizations/111/users/222 422 (anonymous) @ zone.js:1152 t.scheduleTask @ zone.js:410 onScheduleTask @ zone.js:301 t.scheduleTask @ zone.js:404 e.scheduleTask @ zone.js:238 e.scheduleMacroTask @ zone.js:261 (anonymous) @ zone.js:1147 t @ zone.js:910 Zone.__load_patch.t.fetch @ zone.js:1146 n.nativeFetch @ api.service.ts:980 n.fetch @ api.service.ts:976 (anonymous) @ api.service.ts:1020 (anonymous) @ main.aa3935c25f8c6ad51441.js:1 (anonymous) @ main.aa3935c25f8c6ad51441.js:1 i @ main.aa3935c25f8c6ad51441.js:1 t.invoke @ zone.js:391 onInvoke @ core.js:17289 t.invoke @ zone.js:390 e.run @ zone.js:150 (anonymous) @ zone.js:889 t.invokeTask @ zone.js:423 onInvokeTask @ core.js:17280 t.invokeTask @ zone.js:422 e.runTask @ zone.js:195 y @ zone.js:601 e.invokeTask @ zone.js:502 h @ zone.js:1744 v @ zone.js:1770@jkey commented on GitHub (Oct 1, 2020):
We have the same problem here too. We use a Nginx as reverse proxy which also terminates the SSL. I get this from the log.
@BlackDex commented on GitHub (Nov 18, 2020):
@jkey and @jirireischig do you still have this issue? If so, could you please try to set the log_level to either debug or even trace and see if there is some useful information over there?
@jirireischig commented on GitHub (Nov 18, 2020):
Yes, I have.
Lines from log after I click "Save" button with LOG_LEVEL=debug in config:
@BlackDex commented on GitHub (Nov 18, 2020):
@jkey and @jirireischig i tested this exact scenario but i can't seem to be able to reproduce this.
Are you able to provide some more information using the Developer Tools of the browser like Chrome or Firefox by pressing F12.
After you have opened the Developer Console/Tools do the following.
Thanks in advance for the info, this hopefully helps us to find the issue.
@jirireischig commented on GitHub (Nov 19, 2020):
Dear @BlackDex, thank you for your instructions, but this info is already in my issue report :-)
@BlackDex commented on GitHub (Nov 20, 2020):
@jirireischig Ah sorry missed that one.
But, i have installed Apache on my dev machine and used the same config. But i'm not able to reproduce this same error at all.
Is there maybe something else globally configured in Apache2 HTTPD which could cause this?
Also, to get even more info, else i think we are not going to get to the bottom of this, is try enable LOG_LEVEL=trace.
This should also show the incoming headers.
From that trace i would like to know the following lines which are BEFORE
[response][INFO] PUT /api/organizations/<org_id>/users/<org_user_id> (put_organization_user) =>[hyper::http::h1][TRACE] try_parse([hyper::header][TRACE] raw header: "Accept-Encoding"=[hyper::header][TRACE] raw header: "content-type"=[hyper::header][TRACE] raw header: "Content-Length"=[hyper::http::h1][TRACE] Sized read, remaining=[hyper::http::h1][TRACE] Sized read:[hyper::http::h1][TRACE] Sized read, remaining=The
[hyper::http::h1][TRACE] try_parse(is the most important for me actually.If you want to decode that info i suggest to use something like https://www.rapidtables.com/convert/number/ascii-hex-bin-dec-converter.html and past all the numbers including the
,in the decimal area.From that i would like to have all as much info as you are comfortable with.
But the most important there would be the last part of that which should contains the posted data.
Because i think it breaks somewhere there.
@jirireischig commented on GitHub (Nov 20, 2020):
@BlackDex thank you for your time.
Log with LOG_LEVEL=trace after click on "Save" button is here: https://cloud.ecn.cz/index.php/s/e2fHap8E3SXoR8N
@BlackDex commented on GitHub (Nov 20, 2020):
@jirireischig,Thanks for that.
I think it is something i have missed regarding your previous posts which probably contained the right info already.
But it seems that you are using an older web-vault and a newer bitwarden_rs backend version.
The web-vault is not sending the hidden password features with it, while bitwarden_rs server needs this information.
I suggest to upgrade both to the latest version to fix your issue.
The latest web-vault for bitwarden_rs is v2.16.1: https://github.com/dani-garcia/bw_web_builds/releases/tag/v2.16.1
The latest bitwarden_rs is v1.17.0
@jirireischig commented on GitHub (Nov 20, 2020):
Dear @BlackDex you are right. I have old version of web-vault for bitwarden_rs.
I'm using https://github.com/MrMEEE/bitwarden_rs_rpm which don't update it yet.
Everything look like OK with v2.16.1 version.
Thank you very mych for your help and work.