KmlOverlayService 500 Internal Server Error

285 views
Skip to first unread message

Matthew C

unread,
May 30, 2011, 12:28:15 AM5/30/11
to google-map...@googlegroups.com
I'm intermittently getting a 500 Internal Server Error when I try to load one specific KML layer on my maps API implementation, development version at http://foothill-web-gis.googlecode.com/svn/trunk/webgis/fhwebmapdemo.html. Here's the error (as reported by Firebug; I've also seen it in Chrome 11, and my colleague has seen it in Firefox 3.6 on Windows 7):

GET http://maps.googleapis.com/maps/api/js/KmlOverlayService.GetOverlays?1shttp%3A%2F%2Ffoothill-web-gis.googlecode.com%2Fsvn%2Fdata%2Frooms1.kml%3Frandom%3D0.45035833644684664&callback=_xdc_._5r6577&token=39032
500 Internal Server Error

Response Headers
DateMon, 30 May 2011 04:04:02 GMT
Content-Typetext/html; charset=UTF-8
Servermafe
Content-Length11957
X-XSS-Protection1; mode=block

Request Headers
view source
Hostmaps.googleapis.com
User-AgentMozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0
Accept*/*
Accept-Languageen-us,en;q=0.5
Accept-Encodinggzip, deflate
Accept-CharsetISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive115
Connectionkeep-alive
Refererhttp://foothill-web-gis.googlecode.com/svn/trunk/webgis/fhwebmapdemo.html


Cache information:
Last ModifiedSun May 29 2011 21:04:02 GMT-0700 (PDT)
Last FetchedSun May 29 2011 21:04:02 GMT-0700 (PDT)
ExpiresWed Dec 31 1969 16:00:00 GMT-0800 (PST)
Data Size11957
Fetch Count2
Devicedisk

Opening the above URL directly gives Google's standard error page.

Here's the KML file in question: http://foothill-web-gis.googlecode.com/svn/data/rooms1.kml

It's large (~1.2MB), but under Google's 3MB limit, and has a lot of features (877, but under Google's limit of 1000), so I'm not exactly sure what's going on. I'm serving out of the project SVN and I've forced caching on the KML off (since I'm updating it frequently right now), and some have suggested that it's just the SVN server being slow and Google giving up fetching it, but I'm not sure if that's correct. I've speedtested the download, and I'm getting 93-128K down when the map is failing (which is pretty near the limits of my 'net connection). Switching to a KMZ seems to help, but I'd like to know what's going on here so I can avoid it.

Has anyone seen this problem or have any insight? Thanks in advance!
-Matt

Matthew C

unread,
May 30, 2011, 12:31:11 AM5/30/11
to google-map...@googlegroups.com
By the way, http://code.google.com/apis/maps/documentation/javascript/forum.html?place=forum/google-maps-js-api-v3 seems to be related, but they're discussing dynamically generated KML and this is static and there doesn't seem to be an answer there either. Meant to mention this thread in the original post, sorry about that.
-Matt

James McGill

unread,
May 30, 2011, 1:35:04 AM5/30/11
to google-map...@googlegroups.com
Hi Matt,

You are correct in inferring that the file is taking too long to fetch.

By appending a random number (to prevent Google caching the file) you
are effectively making the KML file dynamic - Google must download and
parse the file every time you change that random number.

I used wget to time downloading that file a few times, and saw a
median download time of 6 seconds and a maximum of 59 seconds (SVN is
probably not well suited to acting as a content server). Ideal
download times would be under 1 second.

Some suggestions:
* Most importantly, do not append random numbers to your KML file when
your site is in production. Change the URL only when the content of
the underlying KML file has actually changed. During development is
fine.

* Consider zipping the file and serving it as a *.kmz file. It
compresses from 1.2M to 124K which should download much faster.

* Serve the file from a faster or more consistent server. I've found
that Google AppEngine works well for static files.

Regards,
James

> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to google-map...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-maps-js-a...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>

James McGill

unread,
May 30, 2011, 1:41:35 AM5/30/11
to google-map...@googlegroups.com
For those interested, here's the command I used to time downloads:

time wget -S http://foothill-web-gis.googlecode.com/svn/data/rooms1.kml?randomnumberhere

Looking at the download speed is insufficient as it doesn't take into
account the size of the file, or request latency.

Regards,
James

Matthew C

unread,
May 30, 2011, 4:22:23 PM5/30/11
to google-map...@googlegroups.com
OK, thanks for shedding some light on the matter. I plan to switch to KMZ, and I certainly won't be serving from SVN in production! The random numbers, too, will disappear in production.

Matthew C

unread,
May 30, 2011, 4:23:24 PM5/30/11
to google-map...@googlegroups.com
Closing topic.
Reply all
Reply to author
Forward
0 new messages