Yenya's World

Mon, 02 Jul 2012

404: /undefined

In IS MU, we log and evaluate errors in HTTP requests, including "404 not found". When the Referrer header points back to our site, we try to look for a broken link. Recently (last month or so), strange 404 requests started to appear in our log file:

These requests point to the location /undefined, with referrer being our root document, /. And the referrer is not fake, there is always a successful request to / from the same IP address from several seconds ago. Occasionally we get similar 404 requests, pointing to /lide/undefined, or /vyhledavani/undefined, with referrer being /lide, or /vyhledavani.

We are not able to reproduce the problem. It is not User-Agent-specific (altough most of the User-Agents with this problem are Chrome), and it is not deterministic: we got tens of these 404 requests daily out of milions total requests (and out of tens of thousands of requests to the title page). These requests are always for a non-authenticated page, and always for a page which is a directory (i.e. which is represented by the index.html or document in that directory).

I think it is related to some Javascript we include to the title page - maybe JQuery, maybe Google Analytics. I have tried to remove the Google Analytics Javascript from our title page for a day, but it did not make the problem disappear. Also, our git log from the time these requests started to appear does not show anything related. We have found the following possibly related discussions:

So, my dear lazyweb - any ideas what can be the cause of this behaviour?

UPDATE 2012/07/03: It is probably AJAX
Yesterday have added a new image to the 404 page which meets the above conditions (location ending with "/undefined", referrer being the location minus "/undefined"), and so far after > 12 hours I see exactly zero accesses to that image in my Apache logs. So this error is most probably caused by something that users can't see, i.e. AJAX requests. Not the window.location modification that himdel suggests in the coments.

Section: /computers (RSS feed) | Permanent link | 2 writebacks

2 replies for this story:

himdel wrote:

I think it's the autocompletion .. or, more specifically, ancient jQuery:

With jQuery 1.7 $(span) works as expected but in 1.3.2 it's null. Hope that helps :).

Yenya wrote: Re: himdel

Thanks, I will look at the autocompletion. But this would mean item[0] was set to an empty string. Moreover, I don't see any request to autocompletion (/ in my access logs before the request to /undefined is made.

Reply to this story:

URL/Email: [http://... or mailto:you@wherever] (optional)
Title: (optional)
Key image: key image (valid for an hour only)
Key value: (to verify you are not a bot)


Yenya's World: Linux and beyond - Yenya's blog.


RSS feed

Jan "Yenya" Kasprzak

The main page of this blog



Blog roll:

alphabetically :-)