Error while uploading large files

1. The problem I’m having:

I am using Caddy in one of my projects and uploading large files in size on server. But getting error while uploading it.

2. Error messages and/or full log output:

[uwsgi-body-read] Error reading 19840 bytes. Content-Length: 388008724 consumed: 250000000 left: 138008724 message: Client closed connection

3. Caddy version:

2.4.6

4. How I installed and ran Caddy:

Using it on pods, the framework has installed it.

a. System environment:

OS: Ubuntu 20.04
K8s pods

d. My complete Caddy config:

# Global configuration
{
   servers {
    timeouts {
        read_body 300s
        read_header 300s
    }
    }    
}

# proxy directive snippet (with logging) to be used as follows:
#
#     import proxy "containername:port"
(proxy) {
    log {
        output stdout
        format filter {
            wrap json
            fields {
                common_log delete
                request>headers delete
                resp_headers delete
                tls delete
            }
        }
    }

    reverse_proxy {args.0} {
        header_up X-Forwarded-Port 443
    }
}

test.in{$default_site_port} {
    @favicon_matcher {
        path_regexp ^/favicon.ico$
    }
    rewrite @favicon_matcher /theming/asset/images/favicon.ico

    request_body {
        max_size 800MB
    }

    import proxy "cms:8000"

    
}

How to increase this timeout and get these large files uploaded?

Please help.

Please try with the latest version first.

Hello @francislavoie,

Thanks for your quick response but the software or stack I am using it bing with the 2.4.6 version of Caddy. I can’t change it.

And 2.4.6 is a year-old release, can you please let me know if any particular fix is made in the latest or in b/w to take timeout issues for large file read?

If yes, then maybe I can tweak some configurations and test it with my stack.

Again, Thanks!

Yes! That’s why we always ask to use the latest version. :slight_smile: Lots of great and relevant fixes since then.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.