I have a Plex server running on an otherwise unused chromebook, I've got Ubuntu on there running inside a chroot.
I've used filemanager inside a simple web app. Node backend, react front end. Both the back and front ends run inside the same server as Plex. The chromebook is pretty underpowered but it just about manages to run Plex.
Previously I'd been using rsync to transfer movies etc from my laptop to the server (stored on a removable USB drive plugged into the chromebook). This is a bit clunky so the filemanager app is intended to make this a bit easier. But rsync was working without issue no matter the size/number of files.
The actual issue:
when uploading to the server, the POST request is failing when the file size is large.
A successful one (running locally on my laptop) looks like this:
General
Request URL: http://localhost:3020/files
Request Method: POST
Status Code: 200 OK
Remote Address: 127.0.0.1:3020
Referrer Policy: no-referrer-when-downgrade
Response Headers
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET,POST,HEAD,OPTIONS,PUT,PATCH,DELETE
Access-Control-Allow-Origin: *
Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate
Connection: keep-alive
Content-Length: 818
Content-Type: application/json; charset=utf-8
Date: Wed, 05 Aug 2020 19:32:41 GMT
ETag: W/"332-0ZIFQ02mUI0hn91dWC5wAEXBPDI"
Expires: 0
Pragma: no-cache
Surrogate-Control: no-store
X-Powered-By: Express
Request Headers
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Length: 568520768
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary0MszqJmkhmyrAi5u
Host: localhost:3020
Origin: http://localhost:3000
Referer: http://localhost:3000/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Form Data
type: file
parentId: Lw
files: (binary)
The failing request to the server looks like this:
General
Request URL: http://192.168.1.142:3020/files
Referrer Policy: no-referrer-when-downgrade
Request Headers
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Content-Length: 568520802
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarydVwjFJeJnKHe4MET
Host: 192.168.1.142:3020
Origin: http://192.168.1.142:3000
Referer: http://192.168.1.142:3000/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
Form Content
type: file
parentId: L1RWL1JpY2sgYW5kIE1vcnR5L1NlYXNvbiA0
files: (binary)
Error in the console:
Error: Request has been terminated
Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.
at Request.push../node_modules/superagent/lib/client.js.Request.crossDomainError (client.js:621)
at XMLHttpRequest.xhr.onreadystatechange (client.js:703)
client.js:772 POST http://192.168.1.142:3020/files net::ERR_CONNECTION_RESET
I suspect there's a timeout problem but I've got no idea how to determine which limit is being exceeded, and therefore how to mitigate it. I've got some linux knowledge but still relatively beginner.
I've been using htop to monitor the server performance during the transfer. Initially Plex was attempting to begin transcoding the files before the transfer had completed which was causing a CPU spike and possibly other problems. But having disabled that I still experience this same issue with large files (>650MB) even though CPU and RAM on the server remain stable
Another strange symptom is after the transfer fails, I end up with a 2 incomplete copies of the file in the destination folder. Both incomplete, but not a split of the original file. This is extremely strange behaviour which I can see no reason for.
So some context:
Error in the console:
I suspect there's a timeout problem but I've got no idea how to determine which limit is being exceeded, and therefore how to mitigate it. I've got some linux knowledge but still relatively beginner.
I've been using
htop
to monitor the server performance during the transfer. Initially Plex was attempting to begin transcoding the files before the transfer had completed which was causing a CPU spike and possibly other problems. But having disabled that I still experience this same issue with large files (>650MB) even though CPU and RAM on the server remain stableAnother strange symptom is after the transfer fails, I end up with a 2 incomplete copies of the file in the destination folder. Both incomplete, but not a split of the original file. This is extremely strange behaviour which I can see no reason for.