-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Explain how to set/use Accounts_AvatarStoreType
#978
Comments
Changing the type to |
Accounts_AvatarStoreType
options and use cases
Accounts_AvatarStoreType
options and use casesAccounts_AvatarStoreType
So using the docker-compose setup out of the box i'd for sure not recommend using fileSystem storage at all. If it actually works it'll be in the container. When you goto upgrade the rocket.chat container for a new version your files will be gone. You need to add a volume in your docker-compose file and map a folder inside the container to outside. Something like:
As far as the types of storage used I agree these do need documented or a dropdown. |
Got it. Is using |
I just want to echo that out of the box the GridFS setup for avatars and docker does not work for me either. |
Running out-of-the box with docker-compose I don't see avatar changes with GridFS (default) or with FileSystem. Is there anything else you changed mhkeller? |
after updating the latest neither are working for me either. On Sun, Oct 11, 2015 at 5:51 PM, Andrew M. C. Dawes <
@mhkeller |
Confirmed. Upload appears to have worked, Rocket.Chat renders the balloon notification stating the avatar change was successful, and I can see the changed avatar. However, the change doesn't survive a page refresh, logout, nor a reboot of the server. Before (I can see the avatar): <div class="avatar-image" style="background-image:url(/avatar/admin.jpg?_dc=478);"> After (I cannot see the avatar image, only the initials): <div class="avatar-image" style="background-image:url(/avatar/admin.jpg?_dc=0);"> Running default docker-compose out of the box, auto-starting on boot with init script. EDIT: I tried adding the volume definition to docker-compose.yml. No joy.
|
We also noticed the exact same problem with avatars today. (using docker, too) Then I mounted "/var/www/rocket.chat/uploads/avatar/" to the host system (also because this default path did not exist in the docker container) and checked the if the avatars are uploaded there (container and host). There were not. |
I had to change the path that RocketChat uses, current I am mounting $PWD/avatarstore:/avatarstore and using /avatarstore inside rocketchat for the avatar storage path. |
Correction: I was mistaken. The problem persists under v0.7.1891. If I enable resizing, any operation with avatars causes a hard fault / crashes the server. Avatars are not surviving through to a new session. |
That didn't fix it for me. Now when I upload an avatar the App crashes with this.
EDIT: EDIT 2: EDIT 3: |
UPDATE / WORK-AROUND: In the chat admin panel, click on Accounts. Find "Accounts_AvatarStorePath" and remove any path in the field. Save it as a blank field. Currently, rocketchat looks for any string in this field, and sets it as the avatar store path. Since we now know that the pre-populated path in that field is buggy due to permissions, by removing all content and saving it as empty field causes rocketchat to use by default |
@MuhClaren
|
I too had every single one of those problems, using the docker automated build image, which is basically bleeding edge code that is built into a docker image every time a repository commit is made. After performing the steps I've illustrated above, every one of those problems are gone, including the crashing when avatar resize is on. The images display as they should now, and persist when changed by the user. I'm finishing up my guide and will have it published to the wiki in a few hours. I encourage anyone struggling with these issues to check it out. Kind regards. |
That's interesting. I even tried to empty the "Accounts_AvatarStorePath" you mentioned and had the 3 issues I described in the post above. Some minutes ago I just tried it again with this configuration:
And now it seems to work correctly, so I can
I don't know why this works now (Maybe there were some broken caches?) but your workaround seems to be working perfectly! I'll try this on our docker environment on Monday to see if this can be fixed there as well. (probably using your guide) :) Many thanks and best regards |
@Dbzman Glad it's working for you! |
Has anyone been using the heroku deploy method and running into issues? I just spun one up and can't set custom avatars. |
I just tried it again on our docker environment. (Using this docker image: "https://hub.docker.com/r/rocketchat/rocket.chat/") EDIT: After playing around with FileSystem and GridFS I see crashes everytime. :( EDIT 2: After re-creating the container the Avatars with GridFS work as before... EDIT 3: Ok, GridFS is broken again. Avatars are not persisted anymore. At least not shown. When I open the image directly I can see my avatar but in the application it is still wrong. Clearing the caches also does not help. This only occurs on Safari. The app and Chrome work perfectly. |
Check to make sure your root_url is set. |
@mhkeller |
I was able to get the avatar upload working with the following settings (but I'd like to say that the errors / server crashing / lack of logging feedback leave a lot to be desired in terms of debugging this issue):
|
@blaskovicz I also have to find a writable folder which can be used. (I don't like to use "/tmp") I guess in the Dockerfile such a folder should be created. |
Again I tried it with the docker container. |
I'm using heroku deploy now with |
using the below configuration does indeed allow me to upload the image, and I can find it stored under ~/uploads
I can notice the html works when set as: PS: on Ubuntu 14.04 |
Somehow the issue has resolved itself. |
The We need to fine tune this setting, so the cache only persist for that session, so by the time the |
We fixed the cache problem, now it should persist for the user on refresh :) can anyone test it? |
@engelgabriel: I can confirm it to be fixed on my own instance. 👍 |
Added
and
to Dockerfile and made it the default path |
Please test the latest docker image rocketchat/rocket.chat It now should save avatar files across restart, even if you changed to Accounts_AvatarStoreType to FileSystem for storage. Let us know if it works for you. Thanks. |
@Sing-Li Tested in a freshly rolled docker instance on Ubuntu 14.04 - x64, using all default settings, including GridFS and no path defined in the admin UI. After I purged the browser cache, it worked as intended. Avatars stuck and survived session changes, reboots, etc. 👍 Nice work! |
When running through docker-compose, I can't upload an image as an avatar. I'm not sure how to ssh into the docker vm to see if that directory exists but happy to help debug. I do get a notification that the upload and image change was successful, however.
The text was updated successfully, but these errors were encountered: