Thursday, February 3, 2011

Apache serves incorrect page

To preface: this has got to be one of the strangest bugs I have ever seen, especially since it comes and goes.

There exists a page called view.php and another page called save.php. The bug manifests when I request save.php - I instead get view.php. Request headers say save.php, and it happens in Firefox, IE, Chrome, Opera, Safari. It happens consistently unless - and here's the strange part - I open up the file and save it. I don't make any changes to it, just save. After saving, I can make the same exact request and it serves up save.php like nothing was ever wrong.

I'm currently exporting from an svn repository (just a simple svn export http://server/repository target command). If I export after not making any changes, the bug re-manifests. If a make a change (to an entirely unrelated page), and commit it to the repository, then export, the bug usually goes away. However, the same thing might happen with two different pages (also unrelated to the changed page), or it may not.

I'm not using any kind of caching (no php caching, browser caching, or apache caching).

SVN versions: 1.6.9 w/ AnkhSVN on a Windows machine (the development machine), 1.4.2 on both the repository machine and the test machine (where I run the export command).

Aside from suspecting svn is where something is going wrong, I have no idea.

  • Certianly I've never heard of anything like this despite running several small and medium LAMP sites.

    Aside from suspecting svn is where something is going wrong

    How hard would to be to check that the contents of save.php has not been replaced with save.php? But that in itself would not explain why it occurs randomly.

    Have you sniffed the traffic when replicating the bug to ensure its not due to redirection or caching?

    What do the access and error logs show after serving up the wrong content?

    C.

    Andrew G : Unsurprisingly, the access and error logs don't show anything - no errors get generated, and the only indication on the access logs that anything is different is just the size of the returned content. I'll make sure to do lots of sniffing once the bug manifests itself.
    From symcbean
  • Hi Andrew,

    I only have a superficial knowledge of mod_rewrite. Regardless of having mod_rewrite, I would recommend deleting both save.php and view.php from SVN, then re-importing them with separate commits. I am going off some knowledge I have gained where the revisions become corrupted and moving them or deleting and re-importing fixes the problem. It is not an elegant (proposed) solution, I know.

    I hope this helps.

    Thank you,
    Zachary

0 comments:

Post a Comment