pydio / cells

Future-proof content collaboration platform
https://pydio.com
GNU Affero General Public License v3.0
1.83k stars 181 forks source link

Last-Modified time format is invalid when synchronizing image files/photos using reverse proxy. #578

Closed JMarcosHP closed 3 months ago

JMarcosHP commented 3 months ago

Hi, I'm having trouble when I try to sync my photos from Cells Server to my pc.

My Cells server is through an Nginx Reverse Proxy using Nginx Proxy Manager.

Nginx Proxy Manager custom config:

# Allow any size file to be uploaded
    client_max_body_size 0;
    # Disable buffering
    proxy_buffering off;

location / {
        proxy_pass_request_headers on;
        expires 30d;
         add_header last-modified $date_gmt;
        if_modified_since exact;
        if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://192.168.1.100:8080;
        }
        proxy_pass https://192.168.1.100:8080;
 }

location /cool/ {
        proxy_pass https://192.168.1.100:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

location /ws/ {
        proxy_pass https://192.168.1.100:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

CellsSync error log:

2024-08-01T15:01:29.558-0600    ERROR  sync-task  Status: Error while transferring file (Last-Modified time format is invalid, failed with unable to parse  in any of the input formats: [Mon, 2 Jan 2006 15:04:05 GMT Mon, _2 Jan 2006 15:04:05 GMT Mon, _2 Jan 06 15:04:05 GMT]) - retrying...
2024-08-01T15:01:29.584-0600    ERROR  sync-task  Cannot get reader on source {"job": "create", "path": "{very long file path/IMG-20240605-WA0056.jpg}", "error": "Last-Modified time format is invalid, failed with unable to parse  in any of the input formats: [Mon, 2 Jan 2006 15:04:05 GMT Mon, _2 Jan 2006 15:04:05 GMT Mon, _2 Jan 06 15:04:05 GMT]"}
2024-08-01T15:01:29.584-0600    ERROR  sync-task  Error while transferring file   {"NodePath": "{very long file path}/IMG-20240605-WA0056.jpg", "target": "fs:///D:/My Photos"}

On different file formats like .mp4 and txt works like a charm. My TZ config is America/Mexico_City on the server and docker compose nginx file.

My server is running Debian 12

Curl output:

curl -I https://cells.website.com
HTTP/2 200
date: Fri, 02 Aug 2024 04:07:53 GMT
content-type: text/html; charset=utf-8
alt-svc: h3=":443"; ma=86400
x-xss-protection: 1; mode=block
expires: Sun, 01 Sep 2024 04:07:53 GMT
cache-control: max-age=2592000
last-modified: Friday, 02-Aug-2024 04:07:53 GMT
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=UGFcjTFpen6VsDGqWDI6mzeqwD5Q091%2FORZ%2Br8XQ%2FeHoOjZ%2FkjWrdN%2BGBYmnf61d5OwbhZop%2Bo5xSYCp%2FT87rwWYUty0L0lAeHXQXhhrxuEhThJng0FDYWhlXr1qdKDjcLGv8fgYIkcVCyiovWbyXKQ0mVSUgDJ%2F"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 8acb341d3ccd7c62-LAX

I manually added last-modified header to nginx config, but the issue persist.

JMarcosHP commented 3 months ago

Downloading a photo from the website doesn't return the Last-Modified header:

image

Downloading a file, for example a PDF, it return the Last-Modified header:

image

JMarcosHP commented 3 months ago

So I think, CellsSync is trying to get the value of Last-Modified when syncronizing image files, but not exists, because the api is not returning a value for Last-Modified header.

JMarcosHP commented 3 months ago

Solved this isssue by disabling the "Cache Assets" option on Nginx Proxy Manager configuration.

Source

JMarcosHP commented 3 months ago

This is my current Nginx Proxy Manager config to get Pydio Cells working through reverse proxy:

image

image

Put this in advanced config:

# Allow any size file to be uploaded.
client_max_body_size 0;

# Disable buffering.
proxy_buffering off;

location / {
        grpc_read_timeout 300s;
        grpc_send_timeout 300s;
        grpc_socket_keepalive on;

       # Enable CellsSync support.
        if ($http_content_type = "application/grpc") {
            grpc_pass grpcs://192.168.1.100:8080;
        }
        proxy_pass https://192.168.1.100:8080;
 }

# Enable support for collabora.
location /cool/ {
        proxy_pass https://192.168.1.100:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }

# Enable websocket support.
location /ws/ {
        proxy_pass https://192.168.1.100:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
    }