Forums / Setting Up Categories, Products, Attributes / Product downloads don't work when the site's in maintenance mode

Product downloads don't work when the site's in maintenance mode

Started by lat9 on 17 Oct 2012, 8:36 PM · Views: 1,565

Results 1 to 11 of 11
17 Oct 2012, 8:36 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Product downloads don't work when the site's in maintenance mode

Just a heads-up for anyone else that's trying to test their site's product download capability while in maintenance mode.

I've been beating my head against a wall for a couple of days now, as my "standard" Zen cart 1.5.1 installation's downloads work just fine. The Configuration->Attribute Settings are both the same, the attribute setup is similar ... it finally dawned on me that one difference is that my site is in Maintenance Mode and my zc1.5.1 test site isn't. Sure enough, I place my zc1.5.1 site into Maintenance Mode (with my IP set up in the Down for Maintenance - exclude this IP-address list) and the download fails there, too. Taking my test site out of Maintenance Mode results in the download there working.

On Firefox, I get the "Problem loading page: File not found" message and, with the Live HTTP Headers add-in loaded, I see that the download results in an HTTP 503 error.

I believe that, at a minimum, this scenario should be added to the "How come my download doesn't work" FAQ.

18 Oct 2012, 12:02 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

Update:

The downloads in maintenance mode work on my hosted site:

Server OS: Linux 2.6.28.8-20120620a-iscsi-ntacker-3ware-amd-sec8-fmon-igb-grsec
PHP Version: 5.2.17 (Zend: 2.2.0)
Database: MySQL 5.0.91-log
HTTP Server: Apache

but don't work on my localhost "clone":

Server OS: Windows NT 6.1 build 7601 (Windows 7 Home Premium Edition Service Pack 1) i586 (64-bit)
PHP Version: 5.3.8 (Zend: 2.3.0)
Database: MySQL 5.5.16
HTTP Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1

18 Oct 2012, 1:53 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product downloads don't work when the site's in maintenance mode

They do work locally when not on Down for Maintenance, correct?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Oct 2012, 2:26 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

Right, Ajeh. When my local site is not in maintenance mode, the downloads work correctly.

The thing is that I've gotten in the habit of running my local site as a direct clone of my online (in maintenance mode) site, so it's just a PITA to have to remember to disable maintenance mode locally each time I re-clone my local database.

18 Oct 2012, 4:20 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Product downloads don't work when the site's in maintenance mode

Have you tested a clean v1.5.1 to see if you have the same issue locally?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Oct 2012, 9:56 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

The same issue shows up for me in a "stock" (uncustomized) local version of v1.5.1. The issue I'm having is with the "stock" zen-cart download code (I haven't touched a thing).

P.S. The download page's header_php.php completes OK (at least the HEADER_END notifier is sent), but there is a HTTP 503 error that causes the file download failure.

18 Oct 2012, 10:37 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

Out-of-box settings:

Enable downloads: true
Download by Redirect: true
Download by Streaming: false

.htaccess and index.html files in /download and /pub directories are unchanged from install. Fails using the New v1.2->Downloads->Single Download product in the Zen Cart install demo when Maintenance Mode is set to true.

18 Oct 2012, 10:43 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Product downloads don't work when the site's in maintenance mode

Thanks, that helps.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Oct 2012, 11:57 AM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

Here are the Apache logs (not much there):

::1 - - [19/Oct/2012:05:46:26 -0600] "GET /zc151/images/dvd/blade_runner.gif HTTP/1.1" 304 - "http://localhost/zc151/index.php?main_page=account_history_info&order_id=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
::1 - - [19/Oct/2012:05:46:40 -0600] "GET /zc151/index.php?main_page=download&order=1&id=1 HTTP/1.1" 503 133 "http://localhost/zc151/index.php?main_page=account_history_info&order_id=1" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
http://localhost/zc151/index.php?main_page=download&order=1&id=1

and the Live HTTP Headers information:

GET /zc151/index.php?main_page=download&order=1&id=1 HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://localhost/zc151/index.php?main_page=account_history_info&order_id=1
Cookie: zenid=<removed>; __utma=111872281.428386062.1346448043.1346948398.1347144059.15; __utmz=111872281.1346448043.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __atuvc=2%7C35%2C1%7C36; zenInstallId=<removed>

HTTP/1.1 503 Service Unavailable
Date: Fri, 19 Oct 2012 11:51:47 GMT
Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.8
Expires: Mon, 22 Jan 2002 00:00:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-Disposition: attachment; filename="pdf_sample.zip"
Last-Modified: Fri,19 Oct 2012 11:51:47 GMT
Content-transfer-encoding: binary
Content-Length: 133
Connection: close
Content-Type: application/force-download
19 Oct 2012, 4:28 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Product downloads don't work when the site's in maintenance mode

You could try making the following edit:
/includes/init_includes/init_header.php
line 130:
change from if ((DOWN_FOR_MAINTENANCE == 'true')) {to```
if ( (DOWN_FOR_MAINTENANCE == 'true')[B] && (!strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR']))[/B] ) {


That should work as a bandage. Meanwhile, we're investigating a potentially more efficient fix.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Oct 2012, 2:59 PM
#11
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Product downloads don't work when the site's in maintenance mode

Thanks, DrByte, I've already got that temporary fix in; I appreciate the help.