Unable to view images bigger than 40MB (Seahub)

Hi all,

As mentioned in the title, it seems that Clients/outsourcers/users are unable to view images that are bigger than ~40MB from the web portal.

I have looked through the Nginx configuration and the Seahub_settings.py but couldn’t find anything that would make it so that they could view files bigger than said size.

I have dwindled it down to a HTTP/S issue as downloading the images, you are able to view them as expected.

Any help would be much appreciated!

Kind regards,
Mitch

@daniel.pan @Jonathan

Is there any in-sight you can give on it?

Is this a limitation of Nginx or Seahub? The customer is pressing me for an update, but I can’t seem to find anything in the settings and I have also updated all of my nginx locations to include:

proxy_max_temp_file_size 0;
proxy_buffering off;

So any assistance would be greatly appreciated!

For reference:

All of the files without thumbnails are unviewable

Bump for reply ^

I suspect some of the more technical readers will want to know if the logs offer any hints. Can you take a look at those for Seahub and Nginx, for example?

If memory serves, many/most of the problems relating to file size limitations refer to configuration issues. Can you post your configurations files? Again, this is for the technically minded readers. It’s always good to try to meet them half way.

-Thank you

Nginx:

log_format seafileformat '$http_x_forwarded_for $remote_addr [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_response_time';

server {
    listen       80;
    server_name  ##;
    rewrite ^ https://$http_host$request_uri? permanent;    # Forced redirect from HTTP to HTTPS

    server_tokens off;      # Prevents the Nginx version from being displayed in the HTTP response header

}

server {
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/##/fullchain.pem;    # Path to your fullchain.pem
    ssl_certificate_key /etc/letsencrypt/live/##/privkey.pem;  # Path to your privkey.pem
    server_name ##;
    server_tokens off;

    location / {
        proxy_pass         http://127.0.0.1:8000;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_read_timeout 1200s;

        proxy_set_header   X-Forwarded-Proto https;
        proxy_max_temp_file_size 0;
        proxy_buffering off;

        client_body_buffer_size 0;
        client_max_body_size 0;
}

    location /seafdav {
        proxy_pass http://127.0.0.1:8080/seafdav;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $server_name;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 1200s;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;

           access_log      /var/log/nginx/seafdav.access.log;
           error_log       /var/log/nginx/seafdav.error.log;
}

# If you are using [FastCGI](http://en.wikipedia.org/wiki/FastCGI),
# which is not recommended, you should use the following config for location `/`.
#
#    location / {
#         fastcgi_pass    127.0.0.1:8000;
#         fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
#         fastcgi_param   PATH_INFO           $fastcgi_script_name;
#
#         fastcgi_param  SERVER_PROTOCOL     $server_protocol;
#         fastcgi_param   QUERY_STRING        $query_string;
#         fastcgi_param   REQUEST_METHOD      $request_method;
#         fastcgi_param   CONTENT_TYPE        $content_type;
#         fastcgi_param   CONTENT_LENGTH      $content_length;
#         fastcgi_param  SERVER_ADDR         $server_addr;
#         fastcgi_param  SERVER_PORT         $server_port;
#         fastcgi_param  SERVER_NAME         $server_name;
#         fastcgi_param   REMOTE_ADDR         $remote_addr;
#        fastcgi_read_timeout 36000;
#
#         client_max_body_size 0;
#
#         access_log      /var/log/nginx/seahub.access.log;
#        error_log       /var/log/nginx/seahub.error.log;
#    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
        proxy_request_buffering off;
        proxy_http_version 1.1;
    }


    location /media {
        root /opt/seafile/seafile-server-latest/seahub;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;
    }
    # static files
    location ^~ /browser {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Host $http_host;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;

    }

    # WOPI discovery URL
    location ^~ /hosting/discovery {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Host $http_host;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;

    }

    # Capabilities
    location ^~ /hosting/capabilities {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Host $http_host;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;
    }

    # main websocket
    location ~ ^/cool/(.*)/ws$ {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $http_host;
        proxy_read_timeout 36000s;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;
    }

    # download, presentation and image upload
    location ~ ^/(c|l)ool {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Host $http_host;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;
    }

    # Admin Console websocket
    location ^~ /cool/adminws {
        proxy_pass https://127.0.0.1:9980;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $http_host;
        proxy_read_timeout 36000s;
        client_body_buffer_size 0;
        client_max_body_size 0;
        proxy_request_buffering off;
    }
}

Seahub:

# -*- coding: utf-8 -*-
SECRET_KEY = "##"
SERVICE_URL = "https://##/"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub_db',
        'USER': 'seafile',
        'PASSWORD': 'laiXeev6',
        'HOST': '127.0.0.1',
        'PORT': '3306',
        'OPTIONS': {'charset': 'utf8mb4'},
    }
}


CACHES = {
    'default': {
        'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
        'LOCATION': '127.0.0.1:11211',
    },
    'locmem': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    },
}
COMPRESS_CACHE_BACKEND = 'locmem'

EMAIL_USE_TLS                       = True
EMAIL_HOST                          = '##'
EMAIL_HOST_USER                     = '##'
EMAIL_HOST_PASSWORD                 = '##'
EMAIL_PORT                          = '587'
DEFAULT_FROM_EMAIL                  = EMAIL_HOST_USER
SERVER_EMAIL                        = EMAIL_HOST_USER

TIME_ZONE                           = 'Europe/Berlin'
SITE_BASE                           = '##'
SITE_NAME                           = '##'
SITE_TITLE                          = '##'
SITE_ROOT                           = '/'
ENABLE_SIGNUP                       = False
ACTIVATE_AFTER_REGISTRATION         = False
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER  = True
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True
CLOUD_MODE                          = False
FILE_PREVIEW_MAX_SIZE               = 100 * 1024 * 1024
SESSION_COOKIE_AGE                  = 60 * 60 * 24 * 7 * 2
SESSION_SAVE_EVERY_REQUEST          = False
SESSION_EXPIRE_AT_BROWSER_CLOSE     = False

SERVICE_URL                         = 'https://##/'
FILE_SERVER_ROOT                    = 'https://##/seafhttp'

# From 6.1.0 CE version on, Seafile support viewing/editing **doc**, **ppt**, **                                                                                                                                 xls** files via LibreOffice
# Add this setting to view/edit **doc**, **ppt**, **xls** files
OFFICE_SERVER_TYPE = 'CollaboraOffice'

# Enable LibreOffice Online
ENABLE_OFFICE_WEB_APP = True

# Url of LibreOffice Online's discovery page
# The discovery page tells Seafile how to interact with LibreOffice Online when                                                                                                                                  view file online
# You should change `https://collabora-online.seafile.com/hosting/discovery` to                                                                                                                                  your actual LibreOffice Online server address
OFFICE_WEB_APP_BASE_URL = 'https://##/hosting/discovery'

# Expiration of WOPI access token
# WOPI access token is a string used by Seafile to determine the file's
# identity and permissions when use LibreOffice Online view it online
# And for security reason, this token should expire after a set time period
WOPI_ACCESS_TOKEN_EXPIRATION = 30 * 60   # seconds

# List of file formats that you want to view through LibreOffice Online
# You can change this value according to your preferences
# And of course you should make sure your LibreOffice Online supports to preview
# the files with the specified extensions
OFFICE_WEB_APP_FILE_EXTENSION = ('odp', 'ods', 'odt', 'xls', 'xlsb', 'xlsm', 'xl                                                                                                                                 sx','ppsx', 'ppt', 'pptm', 'pptx', 'doc', 'docm', 'docx')

# Enable edit files through LibreOffice Online
ENABLE_OFFICE_WEB_APP_EDIT = True

# types of files should be editable through LibreOffice Online
OFFICE_WEB_APP_EDIT_FILE_EXTENSION = ('odp', 'ods', 'odt', 'xls', 'xlsb', 'xlsm'                                                                                                                                 , 'xlsx','ppsx', 'ppt', 'pptm', 'pptx', 'doc', 'docm', 'docx')

In addition to:

# Online preview maximum file size, defaults to 30M.
# Note, this option controls files that can be previewed online, like pictures, txt, pdf.
# In pro edition, for preview doc/ppt/excel/pdf, there is another option max-size
# in seafevents.conf that controls the limit of files that can be previewed.
FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024

which you have already, I have the following:

# Enable or disable thumbnails
ENABLE_THUMBNAIL = True

# Seafile only generates thumbnails for images smaller than the following size.
THUMBNAIL_IMAGE_SIZE_LIMIT = 30 # MB

# Enable or disable thumbnail for video. ffmpeg and moviepy should be installed first.
# For details, please refer to https://manual.seafile.com/deploy/video_thumbnails.html

# NOTE: since version 6.1
ENABLE_VIDEO_THUMBNAIL = False

# Use the frame at 5 second as thumbnail
THUMBNAIL_VIDEO_FRAME_TIME = 5

# Absolute filesystem path to the directory that will hold thumbnail files.
THUMBNAIL_ROOT = ‘{Path_to_Seafile_svr}/seahub-data/thumbnail/thumb/’

# Default size for picture preview. Enlarge this size can improve the preview quality.
THUMBNAIL_SIZE_FOR_ORIGINAL = 1024

If any of these configs look interesting or useful you should check them against the current version of the Manual.

While running the current version of Seafile CE (11.0.6), the server has been around for a long time and probably has some things from the ancient past still included that are not useful or necessary.

@mercury

Sorry for the delay, but still don’t get anything for those settings after putting them into my Seahub_settings.py.
(Please let me know if this is the wrong place).

Any further ideas that you think might help?

@daniel.pan @Jonathan Anything that you would be able to help me with, with this?

It’s curious that you cannot view or prepare thumbnails for the large images. That seems to point in the direction of the server and/or the image files themselves.

Is there any sort of system limitation(s) that would account for this? Memory, for example?

What exactly is the error you receive when trying to access a large file?

Are all the image files prepared in the same way before uploading?

How about the logs? Does Nginx or Seafile offer any hints here?

-Thank you

Server resource usage is minimal and the images are no different to the rest. I believe it’s a setting somewhere because if using the drive you are able to view it, or if you download it then you can view it. So in my head it’s either a Seahub setting or Nginx restriction (but I have turned the buffering and size limit off)

There are no errors, just that you can’t preview the file. The only difference in the files being that they are over 30MB which looking through all of the default settings for Seahub, would link to that.

I’ll have a look through log files tomorrow and update when I can!

Kind regards,
Mitch

If the lack of thumbnails is any indicator your problem might relate to these cases reported earlier. For example:

There are some proposed fixes and even a manual patch/workaround described.

Thanks for sending these through.

I’ll give these a try and let you know if there’s still any issues!