mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #390] Icon caching problem or time out fetching icon #228
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#228
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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 @BobWs on GitHub (Feb 10, 2019).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/390
I have a similar problem with icon caching. This happened a few updates ago. I don't know exactly when. But when I check the log this is what I see.
} stdout 12:53:12 [2019-02-10 12:53:12][bitwarden_rs::api::icons][ERROR] Error downloading icon: ReqError. stdout 12:53:12 [CAUSE] Error { stdout 12:53:12 kind: Io( stdout 12:53:12 Custom { stdout 12:53:12 kind: WouldBlock, stdout 12:53:12 error: StringError( stdout 12:53:12 "timed out" stdout 12:53:12 ) stdout 12:53:12 } stdout 12:53:12 ), stdout 12:53:12 url: Some( stdout 12:53:12 "https://www.oneplus.com/favicon.ico" stdout 12:53:12 ) stdout 12:53:12 }Also when looking in the icon_cache folder I see the missing icons named like this:
www.oneplus.com.png.missAny idea how to fix this?
Originally posted by @BobWs in https://github.com/dani-garcia/bitwarden_rs/issues/292#issuecomment-462132916
@dani-garcia commented on GitHub (Feb 10, 2019):
It seems to load fine for me, the problem might be that with the recent change to icons we reduced the timeout of the requests to 5 seconds (from a default of 30) to avoid keeping the clients waiting a long time. If you have a slow connection with the icon server, you might get a timeout error like you did. Do other icons load fine?
@mprasil commented on GitHub (Feb 11, 2019):
I think we should make this timeout configurable, 5s might be way to low for some users. (or websites)
@BobWs: just to explain the *.miss file. This is used by negative cache - when *.miss file exists for a domain, bitwarden_rs won't try to fetch it for ICON_CACHE_NEGTTL seconds - by default 259200 seconds. (3 days) The point of this is so that pages that constantly fail providing icons won't be queried on every single request. You can delete the *.miss file to force bitwarden_rs to attempt downloading the icon again when it's requested next time.
@mprasil commented on GitHub (Feb 11, 2019):
BTW, there is also a problem of Vault spinning tons of requests at once for the favicons. Last time I saw it discussed here. Now rocket is not async (yet) so we're technically limited by number of workers to serve the requests. By default we set it to 10 which (in combination with bitwarden_rs having to fetch the external resources) might be too low to handle hundreds of requests (one for each password) if the icons aren't already cached. Connecting directly is probably not really a problem, browser will wait, but I wonder if proxy might be a bit impatient and drop the "non responsive" backend in your case? Try to delete the icon cache and set the
ROCKET_WORKERSto some higher number?@BobWs commented on GitHub (Feb 11, 2019):
Some icons load just fine but the majority doesn’t load. I don’t have a slow internet connection to be clear (200Mb/20Mb)
@mprasil commented on GitHub (Feb 11, 2019):
When you say doesn't load, do you mean you get these timeout errors?
@BobWs commented on GitHub (Feb 12, 2019):
Yes I get these errors. And I see only the default globe
@mprasil commented on GitHub (Feb 12, 2019):
Does this happen for all icons or just some?
@BlackDex commented on GitHub (Feb 12, 2019):
I will go and create a configurable timeout, which we discussed about already :).
@BlackDex commented on GitHub (Feb 12, 2019):
Well this should be fixed in #394 . You can now change the timeout value if needed.
It is also changed from 5 to 10 seconds.
@mprasil commented on GitHub (Feb 12, 2019):
The image is just being built, in about an hour you can use
mprasil/bitwarden:latestthat will have the timeout set to 10 and you can experiment with raising the value even higher. See if the problem still persists with that.@BobWs commented on GitHub (Feb 13, 2019):
So how do I change the timeout? Where can I find the setting?
So far I have updated the build and some of the icon which didn’t load before are now loading, but there are a few who still doesn’t load.
And the error message mentioned above I haven’t seen it anymore in the logs..
@mprasil commented on GitHub (Feb 13, 2019):
Okay, so try to delete the
*.missfiles, that should letbitwarden_rstry again. Alternatively delete whole icon cache if you feel like trying to download all icons again. 😉Just try the new image as it is, it's already set to 10 seconds timeout.
@BobWs commented on GitHub (Feb 13, 2019):
Okay so I deleted the
*missFiles but after login in bitwarden they reappear.So after further investigation I found out that changing the domain the icons start loading. e.g. if I have a domain like this
https://account.protonvpn.com/login/the icons don’t seem to load but after changing the domain toprotonvpn.comthe icons starts to load.This is very strange because it was working before.
@BlackDex commented on GitHub (Feb 13, 2019):
what does the log say for account.protonvpn.com??
it works for me btw.
@BobWs commented on GitHub (Feb 14, 2019):
Sorry for the delay, I found this in the logs:
2019-02-13 21:21:27,stdout,[2019-02-13 21:21:27][bitwarden_rs::api::icons][ERROR] Error downloading icon: Empty response. Empty response 2019-02-13 21:21:27,stdout,[2019-02-13 21:21:27][bitwarden_rs::api::icons][INFO] Download failed for https://www.account.protonvpn.com/favicon.ico 2019-02-13 21:21:17,stdout,[2019-02-13 21:21:17][bitwarden_rs::api::icons][INFO] Downloading icon for www.account.protonvpn.com via https://www.account.protonvpn.com/favicon.ico... 2019-02-13 19:03:56,stdout,[2019-02-13 19:03:56][bitwarden_rs::api::icons][ERROR] Error downloading icon: Empty response. Empty response 2019-02-13 19:03:56,stdout,[2019-02-13 19:03:56][bitwarden_rs::api::icons][INFO] Download failed for https://www.noip.com/favicon.ico 2019-02-13 19:03:56,stdout,[2019-02-13 19:03:56][bitwarden_rs::api::icons][ERROR] Error downloading icon: Empty response. Empty response 2019-02-13 19:03:56,stdout,[2019-02-13 19:03:56][bitwarden_rs::api::icons][INFO] Download failed for https://account.synology.com/favicon.ico@BlackDex commented on GitHub (Feb 14, 2019):
Well, www.account.protonvpn.com doesn't work, so that isn't strange.
But www.noip.com and account.synology.com both work for me.
I suggest to increase the timeout a bit more.
This can be done a few ways.
-e ICON_DOWNLOAD_TIMEOUT 20This timeout is also used for fetching the main page of the website to extract all the icon URL's, so if fetching that takes longer it would also timeout.
@mprasil commented on GitHub (Feb 22, 2019):
@BobWs did you try increasing the timeout? Did that resolve your issue?
@mprasil commented on GitHub (Feb 26, 2019):
I'm going to close this with hope that @BobWs has resolved his issue. Feel free to reopen if it's still a problem.
@BobWs commented on GitHub (Feb 28, 2019):
It is partly solved. Some days I have all the icons an some days the icons are gone and I have the default globe. Even when I clear out the cache folder. So I can’t figure out the problem.
@mprasil commented on GitHub (Feb 28, 2019):
Thanks for update. I suspect the failures are happening for some network-related reason. Maybe you could improve the situation by setting the
ICON_CACHE_TTL=0which will keep the already downloaded icons forever (standard is 30 days) so once it succeeds, it will keep them forever.You can also lower the
ICON_CACHE_NEGTTLto something like86400(one day in seconds, default is 3 days) so that it will attempt to download the icons at least once a day.Over time you should build pretty solid cache with very few outstanding icon misses. See here for brief description of the settings.
@BobWs commented on GitHub (Mar 4, 2019):
Thanks I will give it a try. Could you please tell me what the command is for changing these settings. I’m not that familiar with docker yet.
Thanks for the effort
@mprasil commented on GitHub (Mar 4, 2019):
Just restart your container with the variables set. The usual
docker stop ...; docker rm ...; docker run ...;, but remember to provide your variables. Alternatively you can set these in the admin interface.@BobWs commented on GitHub (Mar 25, 2019):
I have set the variables as you suggested
ICON_CACHE_TTL=0andICON_CACHE_NEGTTL=86400This is working the icons are all showing, but When the container/image is updated these variables are gone and I have to start over again.Any suggestions how to keep them permanently set?
@BlackDex commented on GitHub (Mar 25, 2019):
How did you set these variables?
Did you do that
docker run ... -e ICON_CACHE_TTL=0 -e ICON_CACHE_NEGTTL=86400 ...Or via the
/adminpanel?Because if you use the environment option, you need to do that always at every
docker runwhen you have updated it.@BobWs commented on GitHub (Mar 25, 2019):
I'm using the docker GUI of Synology (See attachment)
@BlackDex commented on GitHub (Mar 25, 2019):
Well, i have no idea how that works.
Maybe also try to add it via the admin panel then, that will override the other settings.
@BobWs commented on GitHub (Mar 25, 2019):
What Admin panel? Where can I find it? When login to the Webpage of bitwarden I don't see a admin panel.
@BobWs commented on GitHub (Mar 25, 2019):
I'm using this script to auto update the bitwarden image every week:
docker pull mprasil/bitwarden:latest docker stop bitwarden docker rm bitwarden docker run -d --name bitwarden -v /volume1/docker/bitwarden/bw-data/:/data/ -p 81:80 mprasil/bitwarden:latestCan I implement to set the variables in this script when updating the image? How do I do that?
@dani-garcia commented on GitHub (Mar 25, 2019):
You can either add the options in that
docker runcommand like this:Or you can enable the admin panel and set the options from there, which is permanent:
And then the admin panel should be available from
your_domain/admin.@BlackDex commented on GitHub (Mar 25, 2019):
Ah, if you go to the URL of your bitwarden_rs location https://bwrs.example.com/admin
You will see the admin panel.
You need to give a token before you can access this.
That token can be set via the "environment" by setting
ADMIN_TOKEN.Make it a long string of random numbers and letters.
@BobWs commented on GitHub (Mar 25, 2019):
Okay I will give it a try
@BobWs commented on GitHub (Mar 25, 2019):
Okay it is set! I have enabled the Admin page and set the variables, so now it should be permanent even after an update..right!?
Thank you all for your support
@mprasil commented on GitHub (Mar 25, 2019):
It should create config file in the data directory. If that file is preserved, so will be the configuration.
@labaland commented on GitHub (Aug 15, 2020):
i installed this image today: bitwardenrs/server:latest in docker on my synology nas.
Works good but it cant download any icons:
Tested all settings from post above, then it did not try to download any icons. Sorry for my bad english.
Imported passwords from lastpass, and new added logins dont get icons too.
@BlackDex commented on GitHub (Aug 16, 2020):
@labaland This issue has already been closed, please create a new one, or even better go to the forum https://bitwardenrs.discourse.group/
Also, the "latest" tag isn't the latest any more, please us the tag "testing".
And try to check the "/admin/diagnostics" page to see if you have internet at all.
If you still need help, please go to the forums.
@labaland commented on GitHub (Aug 16, 2020):
Thank you for answering me :)
using testing now. see picture :
https://imgur.com/Z7oPSS5