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?
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.