Skip to content
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

[BUG] upstream prematurely closed connection while reading upstream (Nextcloud bigdata download) #1901

Open
2 tasks done
Ghosty01 opened this issue Jan 14, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@Ghosty01
Copy link

What happened?

Hey :),

when i try to download big files over nextcloud this happens the stream/download got disconnedted (dee log)

How to reproduce?

bunnkerweb 1.5.1.2 revers proxy -> linuxserver/nextcloud, share big data more then 1GB

Configuration file(s) (yaml or .env)

#Nextcloud
      - xxx_USE_MODSECURITY=no
      - xxx_USE_MODSECURITY_CRS=no
      - xxx_REVERSE_PROXY_URL=/
      - xxx_REVERSE_PROXY_HOST=http://nextcloud
      - xxx_USE_LIMIT_REQ=no
      - xxx_USE_LIMIT_CONN=no
      - xxx_MAX_CLIENT_SIZE=20G
      - xxx_ALLOWED_METHODS=
GET|POST|HEAD|COPY|DELETE|LOCK|MKCOL|MOVE|PROPFIND|PROPPATCH|PUT|UNLOCK|OPTIONS
      - xxx_X_FRAME_OPTIONS=SAMEORIGIN
      - xxx_BAD_BEHAVIOR_STATUS_CODES=400 401 403 405 444
      - xxx_REVERSE_PROXY_CONNECT_TIMEOUT=1200s
      - xxx_REVERSE_PROXY_READ_TIMEOUT=1200s
      - xxx_REVERSE_PROXY_SEND_TIMEOUT=1200s
	  
#MAIN
	  - SERVE_FILES=no
      - DISABLE_DEFAULT_SERVER=yes
	  - USE_CLIENT_CACHE=yes
      - USE_GZIP=yes
      - USE_REVERSE_PROXY=yes
      - USE_REAL_IP=yes
      - REAL_IP_HEADER=CF-Connecting-IP
      - REAL_IP_RECURSIVE=yes
      - REAL_IP_FROM_URLS=https://www.cloudflare.com/ips-v4/ https://www.cloudflare.com/ips-v6

Relevant log output

2025/01/14 22:30:14 [error] 156#156: *786 upstream prematurely closed connection while reading upstream, client: xxx, server: xxx, request: "GET /s/dowmWB66n57Lmxa/download?path=%2F&files=<FILE>&downloadStartSecret=p1cvpdcr1q8 HTTP/2.0", upstream: "http://10.20.30.3:80/s/dowmWB66n57Lmxa/download?path=%2F&files=<FILE>&downloadStartSecret=p1cvpdcr1q8", host: "xxx", referrer: "https://xxx/s/dowmWB66n57Lmxa"
2025/01/14 22:27:25 [warn] 156#156: *786 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000010 while reading upstream, client: xxx, server: xxx, request: "GET /s/dowmWB66n57Lmxa/download?path=%2F&files=<FILE>&downloadStartSecret=p1cvpdcr1q8 HTTP/2.0", upstream: "http://10.20.30.3:80/s/dowmWB66n57Lmxa/download?path=%2F&files=<FILE>&downloadStartSecret=p1cvpdcr1q8", host: "xxx", referrer: "https://xxx/s/dowmWB66n57Lmxa"
2025/01/14 22:26:45 [warn] 156#156: *769 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000009 while reading upstream, client: xxx, server: xxx, request: "GET /apps/activity/js/Activity.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/activity/js/Activity.chunk.mjs", host: "xxx"
2025/01/14 22:26:44 [warn] 151#151: *855 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000008 while reading upstream, client: xxx, server: xxx, request: "GET /apps/recommendations/js/recommendations-main.js?v=96ea537c-9 HTTP/2.0", upstream: "http://10.20.30.3:80/apps/recommendations/js/recommendations-main.js?v=96ea537c-9", host: "xxx", referrer: "https://xxx/apps/files/"
2025/01/14 22:26:44 [warn] 156#156: *786 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000007 while reading upstream, client: xxx, server: xxx, request: "GET /apps/files_downloadlimit/js/index-CaJn5nuV.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/files_downloadlimit/js/index-CaJn5nuV.chunk.mjs", host: "xxx", referrer: "https://xxx/apps/files_downloadlimit/js/files_downloadlimit-main.mjs?v=96ea537c-9"
2025/01/14 22:26:44 [warn] 156#156: *786 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000006 while reading upstream, client: xxx, server: xxx, request: "GET /apps/files_downloadlimit/js/_plugin-vue2_normalizer-DB3hhwPC.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/files_downloadlimit/js/_plugin-vue2_normalizer-DB3hhwPC.chunk.mjs", host: "xxx", referrer: "https://xxx/apps/files_downloadlimit/js/files_downloadlimit-main.mjs?v=96ea537c-9"
2025/01/14 22:24:05 [warn] 151#151: *189 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000005 while reading upstream, client: xxx, server: xxx, request: "GET /apps/notifications/js/BrowserStorage-CGmIGy5r.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/notifications/js/BrowserStorage-CGmIGy5r.chunk.mjs", host: "xxx"
2025/01/14 22:24:05 [warn] 151#151: *189 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000004 while reading upstream, client: xxx, server: xxx, request: "GET /apps/notifications/js/_plugin-vue2_normalizer-BU0IC95A.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/notifications/js/_plugin-vue2_normalizer-BU0IC95A.chunk.mjs", host: "xxx"
2025/01/14 22:24:05 [warn] 151#151: *189 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000003 while reading upstream, client: xxx, server: xxx, request: "GET /apps/notifications/js/NotificationsApp-BMrpqXq-.chunk.mjs HTTP/2.0", upstream: "http://10.20.30.3:80/apps/notifications/js/NotificationsApp-BMrpqXq-.chunk.mjs", host: "xxx"
2025/01/14 22:24:05 [warn] 154#154: *249 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000002 while reading upstream, client: xxx, server: xxx, request: "GET /apps/photos/js/photos-dashboard.js?v=96ea537c-9 HTTP/2.0", upstream: "http://10.20.30.3:80/apps/photos/js/photos-dashboard.js?v=96ea537c-9", host: "xxx", referrer: "https://xxx/apps/dashboard/"
2025/01/14 22:24:05 [warn] 154#154: *247 an upstream response is buffered to a temporary file /var/tmp/bunkerweb/proxy_temp/0000000001 while reading upstream, client: xxx, server: xxx, request: "GET /apps/recommendations/js/recommendations-dashboard.js?v=96ea537c-9 HTTP/2.0", upstream: "http://10.20.30.3:80/apps/recommendations/js/recommendations-dashboard.js?v=96ea537c-9", host: "xxx", referrer: "https://xxx/apps/dashboard/"

BunkerWeb version

1.5.12

What integration are you using?

Docker

Linux distribution (if applicable)

docker

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Ghosty01 Ghosty01 added the bug Something isn't working label Jan 14, 2025
@Ghosty01
Copy link
Author

used the original nextcloud image works (linuxserver doesnt)

@TheophileDiot
Copy link
Member

TheophileDiot commented Jan 15, 2025

Oh I see, happy to see that the issue was elsewhere and that it's now fixed for you ! 😄

@Ghosty01
Copy link
Author

Okay, happens again :/

@Ghosty01 Ghosty01 reopened this Jan 15, 2025
@Ghosty01
Copy link
Author

on nextcloud contaier did fix it for me

  • PHP_MEMORY_LIMIT=-1

@TheophileDiot
Copy link
Member

Hi @Ghosty01,

Thanks for bringing this up. I don’t believe this issue is caused by BunkerWeb, as this feature has been thoroughly tested. The problem is more likely related to the Nextcloud configuration instead.

Here are a few suggestions you can try to resolve the issue:

  1. Adjust the Nextcloud Upload Limits:
    • Check the config.php file in your Nextcloud directory and look for the upload_max_filesize and post_max_size parameters. These should be set to the desired size limit.
    Example:
'upload_max_filesize' => '10G',
'post_max_size' => '10G',
  1. Verify PHP Configuration:
    Ensure that your PHP settings also allow the desired file size. Update the following values in your php.ini file:
upload_max_filesize = 10G  
post_max_size = 10G  
max_execution_time = 3600  
memory_limit = 512M  
  1. Check BunkerWeb (Optional):
    While it’s unlikely that BunkerWeb is causing the issue, ensure that you have the right value for the MAX_CLIENT_SIZE setting (default : 10m).
  2. Database Configuration:
    If you’re using Nextcloud’s chunked file upload system, ensure the database settings can handle large transactions. For example, increase the max_allowed_packet size in your MySQL or MariaDB configuration if necessary.
  3. Test with Logs:
    Enable detailed logging in both Nextcloud and your server to identify where the limitation occurs. This can help pinpoint whether it’s a PHP, server, or application-level issue.

If you try these steps and the issue persists, feel free to share more details about your setup, and I’d be happy to assist further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants