Files are on a D6 site with private filesystem, the swf file downloaded via browser ends up different to the same file downloaded via sftp, confirmed with a merge tool.

Any suggestions as to why this may be happening?

Comments

realityloop’s picture

Possibly relevant is that we have the private directory outside the webroot, with the setting enforced via local.settings.php

Do we need to make some changes to the nginx config to account for this?

realityloop’s picture

Have tested this using the default private filesystem settings and locations of Barracuda/Aegir and swf files are still not getting sent properly

Diffed example in this image:
https://www.evernote.com/shard/s2/sh/59caa1d6-f32e-42cb-a21b-add74faba95...

omega8cc’s picture

Status: Active » Postponed (maintainer needs more info)

Private files are handled via Drupal, so via PHP-FMP. However, not sure why it could make a difference or why you believe that it is BOA related? Have you tried the same on some non-BOA based site? Nginx sends the correct mime for Flash files, so I don't think it is Nginx related, it is Drupal and PHP what sends the file if it is private, also because we don't use any other method yet.

realityloop’s picture

Status: Postponed (maintainer needs more info) » Active

This appears to be caused by gzip compression on the swf files, if I comment out the following line in /var/aegir/config/server_master/nginx.conf then the swf files are served and display properly:

#  gzip_types        text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

Tipped off via http://patrickmcd.com/2009/04/20/flash-preloading-errors-turn-off-gzip/

Is there a way we can only disable gzip on swf files?

omega8cc’s picture

This is probably because your Drupal code/module doesn't send correct headers? What are the URLs which are gzipped? Note that we don't compress any binary files, like images, media etc. because only expected mime types are listed in the gzip_types. At any rate, Drupal should not send this, even that pre-loader stuff as a text/plain, imo. This is the source of the problem.

realityloop’s picture

This is private filesystem on Drupal 6 so the files do get sent via Drupal.

We haven't created any module that does it.. just vanilla private filesystem in D6.

Interestingly, since disabling gzip, the files being received by FF, Chrome, and Safari are alll different sizes for the exact same file.

FF is the only browser displaying the file in full, Chrome and Safari downloads incomplete versions of the file.

output from Live HTTP extension shows that it is still being gzipped :/

http://cname.domain.com.au/system/files/webducate-content/15-aspire-learning-resources/2212-5934-bsbsus301a---implement-and-monitor-environmentally-sustainable-work-practices-v13/LO_283.swf

GET /system/files/webducate-content/15-aspire-learning-resources/2212-5934-bsbsus301a---implement-and-monitor-environmentally-sustainable-work-practices-v13/LO_283.swf HTTP/1.1
Host: cname.domain.com.au
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Referer: http://cname.domain.com.au/webducate/2212/none/56697
Cache-Control: max-age=0

HTTP/1.1 200 OK
Server: nginx
Date: Fri, 24 Aug 2012 04:21:56 GMT
Content-Type: application/x-shockwave-flash
Content-Length: 195994
Connection: close
X-Cookie-Domain: .cname.domain.com.au
X-Backend: E
X-Purge-Level: none
X-Accel-Expires: 3600
X-Allow-Redis: NO
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Last-Modified: Fri, 24 Aug 2012 04:21:56 GMT
Cache-Control: no-cache
Content-Encoding: gzip
Vary: Accept-Encoding
X-Engine: Barracuda 1.0 ET
X-Device: normal
X-Speed-Cache: BYPASS
X-Speed-Cache-UID: 4hqv1m3hgn4tfjv090hmr73167;
X-Speed-Cache-Key: /system/files/webducate-content/15-aspire-learning-resources/2212-5934-bsbsus301a---implement-and-monitor-environmentally-sustainable-work-practices-v13/LO_283.swf
X-NoCache: Skip
X-GeoIP-Country-Code: AU
X-GeoIP-Country-Name: Australia
X-Server-Name: cname.domain.com.au
omega8cc’s picture

There are two weird details here:

X-Backend: E - this is a sign that it can't guess the version of Drupal used.

Content-Encoding: gzip - this, along with correct Content-Type: application/x-shockwave-flash doesn't make any sense.

Is there some extra IP/proxy used for this site maybe?

Also, what version of BOA are you running?

realityloop’s picture

Status: Active » Fixed

Had to change the following setting to "off" in /etc/php/fpm/php.ini to resolve this:

zlib.output_compression = Off
omega8cc’s picture

Title: Flash files getting changed on download, causes the component to not load in page » zlib.output_compression should be disabled in php53.ini and php53-cli.ini
Component: Miscellaneous » Code
Category: support » bug
Priority: Normal » Major
Status: Fixed » Active

Uh. It is a bug. We had it always disabled in php.ini for 5.2, and I have no idea why it was left enabled for 5.3, but it was totally unintended.

Thanks for the heads up!

omega8cc’s picture

Status: Active » Fixed
realityloop’s picture

has this made it to stable yet?

omega8cc’s picture

No, there is no new stable yet, but is expected shortly.

realityloop’s picture

is there any way to see when the last stable was pushed?

Or ideally something that we can subscribe to via RSS..?

omega8cc’s picture

omega8cc’s picture

Plus, Barracuda monitor will send you e-mail notice (it will send it daily until you will upgrade) when it detects new release posted on d.o

realityloop’s picture

thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.