Uploaded MP3 is returning No Content

Hi there, I'm having a problem with a client's site.

It is a mapped domain. The file has 644 permissions and is owned correctly.

When the file is accessed, it returns 204 no content. The file is being found, but it's content is being truncated by the server and I'm not sure why.

I believe this started with the 3.6 upgrade.

The server is also storing png's in the same folder and they are being served correctly. MP3's however are not.

Any ideas on how I can get this to properly work?

I also checked the MP3 file and saw that it did have content and was not null.

The file in question is available here:
http://desertsax.com/files/2012/07/I-Shot-the-Sheriff-3.mp3

  • zbornheimer
    • Flash Drive

    Auxiliary Update:

    I reinstalled the domain mapping plugin and tried the sunrise.php that was included. No luck. I downloaded the multi-domains plugin to use the dm-sunrise.php (which I renamed sunrise.php). No luck.

    I do have both multi-domains and domain mapping running.

    This also doesn't seem to work with .zip files (I manually uploaded a zip file and tested the resultant html headers: 204 again).

    It seems to only allow for images.

  • PC
    • WPMU DEV Initiate

    Hello there,

    Greetings and thanks for posting on the forums.

    I am not sure on why that would be happening in the first place that its only allowing the files to be downloaded from the original domain but not the mapped domain.

    Can you kindly provide a screenshot of the domain mapping settings from your Network admin control panel ?

    I will then try to replicate it on my lab site.

    Cheers
    PC
    Sales &Support

  • zbornheimer
    • Flash Drive

    Update: I was perusing the code and, while I haven't found a solution, I thought I'd say that when I navigate to the non-mapped domain it redirects to the mapped domain as it should, but when I navigate to the file on the non-mapped domain, it does not redirect.

    That may help, I don't know.

  • PC
    • WPMU DEV Initiate

    Hiya,

    Sorry for the delay here. I need to have a closer look as I was not able to replicate it on my lab site.

    Can you please send me your login details via our secure contact form

    1: Mark the email to my attention

    Attn: PC

    2: Include a link of this thread in the email

    3: Include FTP and WordPress super admin details.

    4: While filling the form, select "I have a different question" from the list.

    Looking forward for a response on this.

    Cheers
    PC

  • PC
    • WPMU DEV Initiate

    Hiya,

    I had a look but could not see what might be causing it.

    Can you please check for a plugin conflict using the attached screenshot

    ?

    While disabling the plugins, just leave Domain mapping enabled.

    I have also sent a note to our lead developer @Barry for his thoughts on the same.

    Cheers, PC

  • Barry
    • DEV MAN’s Mascot

    Are you linking to the unmapped domain in the webpage? Or the mapped domain?

    but when I navigate to the file on the non-mapped domain, it does not redirect.

    The web server will be set to serve files directly rather than load WP to serve them, so, no it won't redirect if the file exists in the location you are entering in the address.

    That said, if the mapped domain is pointing at the same install, then the file should also load at the mapped domain with the same url (except for domain).

  • zbornheimer
    • Flash Drive

    PC,

    Which plugins do I disable? I disabled all plugins on the mapped site to no avail. I even restarted httpd and varnish. I also disabled all the network enabled plugins for multisite. Do I need to disable all the sites on my main site (zysys.org)? This site with the problem is running the official WP 2011 theme.

    I just want to make sure that you were able to have an mp3 file uploaded to your test server via Media, you linked the url to a page, you clicked the link on the page or accessed the file and it work successfully.

    ===========

    Barry,

    I'm linking to the the mapped domain on the webpage.

    ===========

    If either of you need server specs or anything like that, let me know. I don't know why this is happening. I don't know what is happening with the file.

    The server is seeing the file, it is just responding that it has been truncated. Maybe the mapped domain is truncating the content of non-image mimes somewhere.

  • PC
    • WPMU DEV Initiate

    Hey there,

    While @Barry chimes in here, can you tell me how you have mapped the domain to the subsite ?

    Have you pointed the domain to the root install ?

    The only thing I am confused about is the .png is working fine and just not .mp3

    Cheers
    PC
    Sales &Support

  • zbornheimer
    • Flash Drive

    I'm a little confused by what you asked (re mapped the domain to the root install), so I'll tell you everything that might be relevant here.

    I have a root install at zysys.org. I have the multi-domain plugin active which allows me to have all of the hosting on zysites.com. The mapped domain is mapped from zysites.com/<wp_user> to the ip of the server.

    I also don't understand the idea that .png would work and .mp3 wouldn't. The only thing I could think of is that the code is checking mimes and for some reason, it isn't defined for mp3, it's unset, or it is an issue in the .htaccess.

    By the way, I haven't deleted those accounts, so you can take a look whenever you need to. Once this is resolved, I will delete those accounts, however.

    Thank you for your help so far, PC.

  • PC
    • WPMU DEV Initiate

    Hey there,

    Thanks for standing by.

    I checked the settings once again but could not find what might be causing it. Totally stumped :slight_frown:

    I am going to send this to our developers team and see if they can suggest me something.

    Cheers
    PC
    Sales &Support

  • Barry
    • DEV MAN’s Mascot

    There is something wrong with your domain mapping install.
    If you look at the source of one of your mapped domains (http://desertsax.com) you will see header includes like the following:

    http://zysys.org/zycms/plugins/marketpress/marketpress-includes/themes/icons.css?ver=2.8.8

    These should be at the mapped domain, not a different one. There should be no mention of the original domain on the front end of a mapped domain.

    Can you double check you are using the correct version of sunrise.php? If you have multi domains installed then it should be the one called dm_sunrise.php (though renamed to sunrise.php).

    http://zysites.com/rltrane/files/2012/07/I-Shot-the-Sheriff-3.mp3

    Is that another domain entirely? or a mapped domain or a multi-domain set up - I'm a bit confused now about what the original url of your system is as you mapped domains are pointing to the .org not the .com

  • zbornheimer
    • Flash Drive

    Hi @Barry,

    In the zip, there is no dm_sunrise.php. All I have are the following:

    Folders: classes, external, images, includes, languages
    Files: domain-mapping.php, license.txt, sunrise.php

    dm_sunrise.php does not exist in my download. Is there an alternate location for it?

    ========

    zysys.org: Original Domain
    zysites.com: Multi-Domain (hosts all sites)
    desertsax.com: Mapped Domain

  • Aaron
    • CTO

    This could very well be tied to your hosting. Especially as image files work but not mp3 or zip files. Have you contacted your host about this? It could easily be a configuration issue.

    I see from your headers that you have a varnish cache in front of it as well, that could easily be not configured for files that are not images.

  • PC
    • WPMU DEV Initiate

    Hello @zbornheimer

    Thanks for posting back.

    I just tested this on my lab site here : http://pressword.in/wp-content/uploads/sites/3/2013/08/I-Shot-the-Sheriff-3.mp3

    and here : http://dm.easywp.co/wp-content/uploads/sites/3/2013/08/I-Shot-the-Sheriff-3.mp3 and it works fine and is available from both the locations so it doesn't seem to be a domain mapping issue to me.

    I am gonna try out with Multi domains too and try to replicate the structure where I will map a domain to a subsite created on an addon domain and see if I can get it working.

    In the meantime I have asked @Barry to chime in with his thoughts.

    Cheers
    PC
    Sales &Support

  • zbornheimer
    • Flash Drive

    Thanks PC. @Barry was recognized that the desertsax.com site isn't using desertsax.com domains for some static files which leads me to believe that it might be multi-domain & domain mapping compatibility. I'm curious to know if it works for you.

    @Aaron, it's not nginx. I turned it off and tried it. Also this problem arose when before I installed nginx at all.

    I was forced to install varnish on top of nginx ~3 days after posting here and then ~1 day after that install nginx to prevent apache setup from killing my server (I have been having issues with apache running rampant).

    Nginx (port 80) is configured to be a reverse proxy to varnish (port 89) which is a reverse proxy to apache (port 8080).

  • zbornheimer
    • Flash Drive

    For some reason, it looks like my post didn't submit. Weird.

    @Aaron, I'd prefer not to give out any .hatccess rules online before knowing what the actual problem is...I don't want to unknowingly compromise something.

    Can you get the login credentials from @PC? I give you permission to take a look a the .htaccess file.

  • PC
    • WPMU DEV Initiate

    I went to http://zysites.com/silververitas which only makes use of Multi-Domains and it also shows zysys.org instead of zysites.com/silververitas for some static content.

    I don't notice it on that site ? Can you kindly give a screenshot ?

    I will also try to replicate this with Multi domains on my lab site and also look for suggestions from @Vladislav on this.

    Cheers
    PC
    Sales &Support

  • PC
    • WPMU DEV Initiate

    Hey there,

    I discussed this with Vlad, and found that your domain http://zysites.com/ was going to http://www.domain_current_site.com/ which was due to commented define in your wp-config.php

    #define( 'DOMAIN_CURRENT_SITE'

    Its fixed now.

    However when Vlad reviewed your .htaccess file, its got wordpress rules repeated around 3 times.

    Can you kindly clean that up ?

    for now, I will personally suggest you to take a backup of your current .htaccess file and just try with a new .htaccess file with just wordpress rules.

    Cheers
    PC
    Sales &Support

  • zbornheimer
    • Flash Drive

    Hi,

    I created a temporary .htaccess solution that only included the Wordpress rules and that didn't fix anything. However, I was forced to restore the old one as I would bleed clients if my server lost the functionality defined there.

    Attached is the screenshot of the source code for http://zysites.com/silververitas

    In there, some of the urls are zysys.org/zycms/... as opposed to zysites.com/silververitas/... I'm pretty sure when that's resolved the other issues will be resolved as well.

    *** EDIT: Sorry about the attachment. This site makes it very hard for me to upload screenshots because of the size limits ***

  • PC
    • WPMU DEV Initiate

    Hey there,

    Thanks for posting back.

    Unfortunately not yet. I am still waiting to hear from ourlead developer @Vladislav

    I have sent him another note requesting his presence and he should be here soon

    Cheers
    PC
    Sales &Support

  • Vladislav
    • Dead Eye Dev

    Hello,

    The zysys.org/zycms/... style URLs are a whole different matter. This is unrelated to the issue with MP3 files, and a consequence of explicit overriding of the WP_CONTENT_URL define you have set up.

    As for the MP3 content returning status 204 headers. it does indeed has to do with your .htaccess setup - actually, it's a combination of your .htaccess rewrites and the way that "WP Retina 2x" plugin operates (the problem is with the wp-retina-2x plugin rewrite rules). Basically, the rewrite rule as it's currently set up will pass *all* the file requests non-discriminately to the plugin, regardless if they're actually images or not. When a request for MP3 file reaches your retina plugin, the MP3 file, obviously not being an image, trips the plugin up and it returns a 204 status header and breaks out without ever serving your content.

    The solution for this issue could be to a) change the plugin not to forcefully serve the 204 status and no content if it can't recognise the request as an image and act on it (this is probably a good idea anyway), and/or b) change the .htaccess rule that rewrites the file request to wp-retina-2x plugin to be less naive and only forward the requests for files that actually are images. If you decide to go with the latter approach, the wp-retina-2x plugin defines images as files with extensions 'png', 'gif', 'jpg', 'jpeg', or 'bmp' (case-insensitive), so you may want to craft your rewrite rule accordingly.

  • zbornheimer
    • Flash Drive

    That's it. I deleted the WP Retina plugin and it works perfectly. I'll probably send them a bug report just so they know that it's an issue.

    I also disabled the WP_CONTENT_URL definition and and it also works perfectly.

    Thank everyone for your help!

    Thanks @PC!
    Thanks @Vladislav!
    Thanks @Aaron!
    Thanks @Barry!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.