Avatar + CSS + media problems

So I managed to setup seafile 7.1.4 via docker and after logging in I see a broken image instead of my avatar.

Google chrome reveals:

failed to load SourceMap: Could not load content for https://mydomain.tld/media/css/seafile-ui.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

so I enter the docker container and check:

docker exec -ti seafile bash

cat /etc/nginx/sites-enabled/seafile.nginx.conf

shows

location /media {
root /opt/seafile/seafile-server-latest/seahub;
}

and checking that locations shows there is no css folder:

ls -al /opt/seafile/seafile-server-latest/seahub
total 194
drwxr-xr-x 15 root root    35 May 11 07:06 .
drwxr-xr-x 10 root root    34 May 14 02:28 ..
drwxr-xr-x  2 root root     4 Mar 20 06:18 bin
-rwxr-xr-x  1 root root  1012 Mar 20 06:18 code-check.sh
-rw-r--r--  1 root root   555 Mar 20 06:18 CONTRIBUTORS
-rw-r--r--  1 root root   115 Mar 20 06:18 dev-requirements.txt
drwxr-xr-x  2 root root     5 Mar 20 06:18 fabfile
drwxr-xr-x  5 root root    10 May 11 07:09 frontend
drwxr-xr-x  3 root root     3 Mar 20 06:18 .github
-rw-r--r--  1 root root   841 Mar 20 06:18 .gitignore
-rw-r--r--  1 root root  2644 Mar 20 06:18 HACKING
-rwxr-xr-x  1 root root  3318 Mar 20 06:18 i18n.sh
-rw-r--r--  1 root root 69540 Mar 20 06:18 LICENSE-thirdparty.txt
-rw-r--r--  1 root root   555 Mar 20 06:18 LICENSE.txt
drwxr-xr-x 54 root root    54 Mar 20 06:18 locale
-rw-r--r--  1 root root   979 Mar 20 06:18 Makefile
-rwxr-xr-x  1 root root   249 Mar 20 06:18 manage.py
drwxr-xr-x 11 root root    13 Jul 27 13:27 media
-rw-r--r--  1 root root  9063 Mar 20 06:18 pylintrc
-rw-r--r--  1 root root  9064 Mar 20 06:18 pylintrc.template
-rw-r--r--  1 root root   101 Mar 20 06:18 pytest.ini
-rw-r--r--  1 root root  1418 Mar 20 06:18 README.markdown
-rw-r--r--  1 root root   277 May 11 07:06 requirements.txt
-rwxr-xr-x  1 root root    48 Mar 20 06:18 run-seahub.sh.template
drwxr-xr-x 43 root root    57 Jul 27 13:27 seahub
-rwxr-xr-x  1 root root   310 Mar 20 06:18 send_user_notifications.sh.template
-rw-r--r--  1 root root   224 Mar 20 06:18 setenv.sh.template
drwxr-xr-x  2 root root     6 Mar 20 06:18 sql
drwxr-xr-x  4 root root     4 Mar 20 06:18 static
-rw-r--r--  1 root root    66 Mar 20 06:18 test-requirements.txt
drwxr-xr-x  6 root root    11 May 11 07:09 tests
drwxr-xr-x 79 root root    83 May 14 02:28 thirdpart
drwxr-xr-x  2 root root     9 Mar 20 06:18 tools
-rw-r--r--  1 root root  1412 Mar 20 06:18 .travis.yml.bak
drwxr-xr-x  2 root root     3 May 11 07:06 .tx

OK, sorry, let me correct myself. /media points to /opt/seafile/seafile-server-latest/seahub and there is a media subfolder but this still doesn’t work :frowning:

the file is indeed missing:

ls -al /opt/seafile/seafile-server-latest/seahub/media/css/
total 182
drwxr-xr-x  6 root root     12 May 11 05:06 .
drwxr-xr-x 11 root root     13 Jul 31 11:30 ..
-rw-r--r--  1 root root   1906 Mar 20 04:18 bootstrap.popover.min.css
drwxr-xr-x  2 root root      5 Mar 20 04:18 font
-rw-r--r--  1 root root  17961 Mar 20 04:18 jquery-ui.datepicker.min.css
-rw-r--r--  1 root root    149 Mar 20 04:18 print_for_md_file_view.css
drwxr-xr-x  2 root root      8 Mar 20 04:18 seafile-editor-font
-rw-r--r--  1 root root 282986 Mar 20 04:18 seafile-ui.css
-rw-r--r--  1 root root  44240 May 11 05:06 seahub.css
-rw-r--r--  1 root root  22786 May 11 05:06 seahub_react.css
drwxr-xr-x  2 root root      6 Mar 20 04:18 sf_font2
drwxr-xr-x  2 root root      9 May 11 05:06 sf_font3

Have you tried this: Avatars do not work in Seafile CE 7.0.0

thanks, I looked at that thread but:

  1. I can’t seem to find a /tmp/seahub_cache folder
  2. entering the seafile container there really is no seafile-ui.map file present inside: /opt/seafile/seafile-server-latest/seahub/media/css/
  3. I tried this solution but it didn’t help: Avatar in share dialog missing

any more advice?
do you have that file present?

Hi Ovidiu,

too bad!

But let me ask you these questions:
a.) Does the file default.png exist in …/media/avatars/?
b.) What happens when you click on the links https://cloud.local … / media/avatars/default.png? Does the file open?

If the avatar picture opens, please empty your browser cache and try again.

If not, please check the permissios for the file/the folder in your docker container. Is the owner the same user that runs Seafile?

Another idea: Can you purge your memcached cache if you use memcached?

Thanks for the pointers.

a) default.png does exist.

here is a quick check in both these folders mentioned:

root@seafile:/opt/seafile# ls -al /opt/seafile/seafile-server-latest/seahub/media/css/
total 182
drwxr-xr-x  6 root root     12 May 11 05:06 .
drwxr-xr-x 11 root root     13 Aug  4 13:50 ..
-rw-r--r--  1 root root   1906 Mar 20 04:18 bootstrap.popover.min.css
drwxr-xr-x  2 root root      5 Mar 20 04:18 font
-rw-r--r--  1 root root  17961 Mar 20 04:18 jquery-ui.datepicker.min.css
-rw-r--r--  1 root root    149 Mar 20 04:18 print_for_md_file_view.css
drwxr-xr-x  2 root root      8 Mar 20 04:18 seafile-editor-font
-rw-r--r--  1 root root 282986 Mar 20 04:18 seafile-ui.css
-rw-r--r--  1 root root  44240 May 11 05:06 seahub.css
-rw-r--r--  1 root root  22786 May 11 05:06 seahub_react.css
drwxr-xr-x  2 root root      6 Mar 20 04:18 sf_font2
drwxr-xr-x  2 root root      9 May 11 05:06 sf_font3

root@seafile:/opt/seafile# ls -al /opt/seafile/seafile-server-latest/seahub/media/avatars/
total 75
drwxrwxr-x 3 root root    5 Aug  4 13:50 .
drwxr-xr-x 5 root root    5 Jul 27 11:55 ..
-rw-r--r-- 1 root root 3869 Mar 20 04:18 default-non-register.jpg
-rw-r--r-- 1 root root 7642 Mar 20 04:18 default.png
drwxrwxr-x 2 root root    3 Jan 16  2020 groups

b) gives error 403 forbidden
https://mydomain.tld/media/avatars/default.png

talking about permissions, since I didn’t find any documentation about changing the user seafile runs as I assume it runs as root. so when I created my docker-compose.yml I mounted a folder as a volume to save my persistent data like this:

volumes:
  - /local/path/seafile/data:/shared

so everything in there is owned by root and this seems ok as all the content was created by the seafile container anyway.

ls -al /local/path/seafile/data/seafile/seahub-data/avatars/
total 75
drwxrwxr-x 3 root root    5 Aug  4 17:50 .
drwxr-xr-x 5 root root    5 Jul 27 15:55 ..
-rw-r--r-- 1 root root 3869 Mar 20 07:18 default-non-register.jpg
-rw-r--r-- 1 root root 7642 Mar 20 07:18 default.png
drwxrwxr-x 2 root root    3 Jan 16  2020 groups

I do use memcached but since I have started this thread I have stopped and removed, recreated these countainers a couple of times and memcached does not use persistent data so this should not help at all.

could someone maybe share this file? seafile-ui.map

I’d like to see what happens if I place it in the folder its supposed to be but I can’t find it anywhere.

Hi,

please edit conf/ccnet.conf SERVICE_URL to domain without port. the map error stays but the icon is loaded. i had the same problem with a fresh installation of seafile pro on docker.