No input file specified – Windows Server 2012 Deduplication on IIS with php

Posted: December 22, 2013 in IIS, Server 2012, Solved
Tags: , , , , , , ,

My gaming clan forums started throwing a rather annoying random error recently and I couldn’t figure out what had changed to cause it. Essentially a page saying only “No input file specified.”

My forums are running phpBB on Server 2012 running IIS with (of course) php installed. The message would just randomly appear when posting replies to messages, or searching for new topics. It didn’t always happen, and clicking refresh would then load the page fine. I tried re-installing php, upgrading to a newer php and “tweaking” settings in the php.ini file. No difference.

Looking in the IIS logs would show a 404 error returned, hitting refresh (maybe a couple of times) usually returned a 200 and loaded the page. The file being loaded was present and everything seemed to be in order.

To troubleshoot without breaking the main site completely, I made a copy of the site and the database. On the test site though there was nothing I could do to reproduce the error!

I ran up Beyond Compare to check no file contents had changed in the process of reconfiguring the test website. I thought perhaps the reconfig had “refreshed” some corruption in a file somewhere. I tried “resaving” settings on the main site to see if that might also refresh the files. No improvement.

One thing that did strike me as odd was Beyond Compare was showing a bunch of files on the original site using a “shortcut” icon. The file showed with the same date and file size, but it was showing as being a different file. Most odd. When I copied the files from the copy back to the original site, the files all showed as normal files again and the “No input file specified” went away!

So, what was making these files appear to be different but not be different?

SOLUTION

Investigating why the files were appearing as shortcuts led me to realise they were in fact linked files. That reminded me that I had enabled the disk deduplication feature on the server several weeks earlier. The way the dedupe works is it locates files that appear multiple times on the disk and places a copy of that file in a single instance store. The original file is then replaced with a symbolic link to the version in the single instance store. Ordinarily this would appear completely transparent to applications.

When I made a copy of the original website, the copy was using its own direct version of the files. The dedupe hadn’t processed them yet so they were still the actual files. when I copied those files back to the original site it “replaced” the linked files and put original files back in their place. That’s why the site would then work. However, the next day it was broken again because the dedupe process would change them back to links once more.

So the simple fix is to exclude the web site directory from the deduplication process. This is done simply through the dedupe config.

Server Manager > File and Storage Services > Volumes > right click volume > Configure Data Deduplication > Add folder to exclude

As for *why* the dedupe is causing the problem for IIS, I’m still looking into that.

Comments
  1. Kvad says:

    Hi! Ever figure out why this happens?

    • Scott says:

      No, I never found any explanations anywhere to explain why and I haven’t really had time to test further.
      I still suspect it’s something to do with how the Single Instance version of a file is actually a “junction link” and that IIS or php don’t see them properly.

      Having a fix to stop it happening was enough and I haven’t become aware of it being an issue on any of my other systems.

  2. Thanks for completely describing the issue and offering a solution. Your information here saved myself and a colleague from having to continue to flail about trying to figure out what’s was even going on.

  3. Bruce says:

    Thanks for this I was having the same issue.

    The reason that this may happen is that I know from using linked files is that they work in PHP if the PHP app is using windows file paths with backslash \ but failed to work when using Unix forward slash / for file paths.

    The only solution that I have found so far is to exclude files with php extension on deduplicated drives that are used by IIS.

    • Scott says:

      Sounds like a reasonable guess why it happens. I dunno if this would be a php or a Microsoft bug, but I think just excluding from dedupe is better than hoping for a fix.

Leave a comment