*New 12.1 series Release:
2019-11-08: XigmaNAS 12.1.0.4.7091 - released!

*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released


We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

WebUI is blocked when file is being downloaded in the file manager

XigmaNAS Basic Tune-up
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
dimitry
Starter
Starter
Posts: 23
Joined: 11 Oct 2017 10:43
Status: Offline

WebUI is blocked when file is being downloaded in the file manager

#1

Post by dimitry » 06 Nov 2019 11:54

Hi,

Faced the weird issue - if I click "Download" for some big file in the Web UI's file manager (quixplorer), I can't open any other page in the Web UI until download is finished/cancelled, no matter same browser's tab, or another.

I've also noticed another weird thing - if I open another browser (lets say, I'm downloading using Chrome, and then opened Safari) - WebUI works there, but if I navigate to File Manager - WebUI gets frozen in the second browser as well.

Is it something with my XigmaNAS setup, or somebody else has the same behavior?

User avatar
raulfg3
Site Admin
Site Admin
Posts: 4945
Joined: 22 Jun 2012 22:13
Location: Madrid (ESPAÑA)
Contact:
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#2

Post by raulfg3 » 06 Nov 2019 15:37

is a know limitation of how webGUI is implemented. please use WinSCP instead.

https://winscp.net/eng/docs/introduction
12.0.0.4 (revision 6766)+OBI on SUPERMICRO X8SIL-F 8GB of ECC RAM, 12x3TB disk in 3 vdev in RaidZ1 = 32TB Raw size only 22TB usable

Wiki
Last changes

dimitry
Starter
Starter
Posts: 23
Joined: 11 Oct 2017 10:43
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#3

Post by dimitry » 10 Nov 2019 21:58

Ok, just curious - why?

I tried to look deeply to the php code of quixplorer and found in /usr/local/www/quixplorer/_include/down.php code that checks the web-server before file downloading process (I cut code a bit):

Code: Select all

function _download($file,$localname) {
	//... some code here
	$use_x_sendfile = false;
	if(function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())):
	//... some other code here
	elseif(preg_match('/lighttpd\/1(\.[0-9]+)+/',$_SERVER['SERVER_SOFTWARE'])):
		$hdr_x_sendfile = sprintf('X-Sendfile: %s',$file);
		$use_x_sendfile = true;
	endif;
	if($use_x_sendfile): // use x-sendfile
		$hdr_content_disposition = sprintf('Content-Disposition: attachment; filename="%s"',$localname);
		$hdr_content_type = sprintf('Content-Type: application/octet-stream; name="%s"',$localname);
		header($hdr_content_disposition);
		header($hdr_content_type);
		header($hdr_x_sendfile);
		exit;
	else: // use php
		_download_header($localname,@filesize($file));
		@readfile($file);
		exit;
	endif;
}
Lighttpd is used as the web-server for XigmaNAS's WebGUI, however

Code: Select all

preg_match('/lighttpd\/1(\.[0-9]+)+/',$_SERVER['SERVER_SOFTWARE'])
returns FALSE, b/c $_SERVER["SERVER_SOFTWARE"] equals to "WebGUI" based on /var/etc/lighttpd.conf:

Code: Select all

server.tag = "WebGUI"
So I changed the "elseif" condition in down.php to

Code: Select all

elseif(preg_match('/lighttpd\/1(\.[0-9]+)+/',$_SERVER['SERVER_SOFTWARE']) || $_SERVER['SERVER_SOFTWARE']=="WebGUI"):
and now I can download many files (I tried 5) in parallel without UI blocking. Also I can navigate to any other WebUI's page.

I haven't noticed any side effects.
Are there any other risks?

User avatar
ms49434
Developer
Developer
Posts: 747
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#4

Post by ms49434 » 10 Nov 2019 22:43

yes, there are side effects and risks.

a) the upload folders are folders on a memory disk in the default configuration, if the memory disk is full, the system might stall/crash.
b) the maximum request size is 512MB, files larger than the maximum size or larger than the remaining space on the memory disk will fail to upload.

please take a deeper look under the hood at /etc/rc.d/lighttpd:

Code: Select all

...
lighttpd_uploaddir=${lighttpd_uploaddir:-"/var/tmp"}
lighttpd_maxrequestsize=${lighttpd_maxrequestsize:-"524288"}
...
	# set temporary directory
	cat <<-EOF >> ${lighttpd_conf}
		server.upload-dirs = ( "${lighttpd_uploaddir}/ftmp", "${lighttpd_uploaddir}" )
		server.max-request-size = ${lighttpd_maxrequestsize}
	EOF
...
server.tag = "WebGUI"
...
1) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

dimitry
Starter
Starter
Posts: 23
Joined: 11 Oct 2017 10:43
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#5

Post by dimitry » 10 Nov 2019 22:56

Mm.. Sorry, I'm still confused a bit. I'm trying to figure out with issue of downloading, and you're referring to files upload. I understood the process of upload, but how that settings are connected with download?

User avatar
ms49434
Developer
Developer
Posts: 747
Joined: 03 Sep 2015 18:49
Location: Neuenkirchen-Vörden, Germany - GMT+1
Contact:
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#6

Post by ms49434 » 10 Nov 2019 23:08

dimitry wrote:
10 Nov 2019 22:56
Mm.. Sorry, I'm still confused a bit. I'm trying to figure out with issue of downloading, and you're referring to files upload. I understood the process of upload, but how that settings are connected with download?
you're right, I was looking into the upload which is known to be limited.

Download function has been reworked and will use lighttpd's sendfile instead of PHP.
1) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 22GB out of 32GB ECC RAM, LSI 9300-8i IT mode in passthrough mode. Pool 1: 2x HGST 10TB, mirrored, SLOG: Samsung 850 Pro, L2ARC: Samsung 850 Pro, Pool 2: 1x Samsung 860 EVO 1TB , services: Samba AD, CIFS/SMB, ftp, ctld, rsync, syncthing, zfs snapshots.
2) XigmaNAS 12.0.0.4 amd64-embedded on a Dell T20 running in a VM on ESXi 6.7U2, 8GB out of 32GB ECC RAM, IBM M1215 crossflashed, IT mode, passthrough mode, 2x HGST 10TB , services: rsync.

dimitry
Starter
Starter
Posts: 23
Joined: 11 Oct 2017 10:43
Status: Offline

Re: WebUI is blocked when file is being downloaded in the file manager

#7

Post by dimitry » 11 Nov 2019 17:58

Cool! Looking forward for updated release build.

Thanks!

Post Reply

Return to “XigmaNAS Basic Tune-up”