Portal for ArcGIS KML Problem

10288
16
Jump to solution
06-30-2015 03:51 PM
IgorBalotsky1
Occasional Contributor

I have Portal for ArcGIS 10.3.1 and I am trying to add an item from the web of type KML. Here is the exact URL of the item I am trying to add: http://quickmap.dot.ca.gov/data/cctv.kml

However I keep getting this error: "File not found. Wrong url or out of memory." I was wondering if there is a way to get around this issue or if it will be resolved in the next version of Portal?

When I try this in ArcGIS Explorer, it works without problems. It also works if I first save the KML file to my computer first then reference it locally.

Thanks,

Igor

0 Kudos
1 Solution

Accepted Solutions
LG1
by
New Contributor

I just solved this.  Here is a short description of my setup, the problem, and solution with a work around.  Esri needs to be informed that there is a bug in their Portal software - hence the reason they suggest to set it up a certain way. 

My Setup

Box 1

IIS Web server project - My Map Code.

Portal software - This is the piece of software from Esri for processing your own KML stuff.

ArcGis WebAdaptor - This is typically the /arcgis/ directory, yet another install from Esri. 

Box 2

Database for my website

Your setup may or may not be similar to this.

The Problem

The problem at the top where the user is looking at the browser realizes that uploading a KML via hyperlink or file, it just does not work! 

Inside F12, web browser Developer tools you may find this nice message.

"File not found. Wrong url or out of memory."

Explanation of the traffic:

When we upload a KML/KMZ file, the process goes as follows:

1. Upload the file to a File Host service on ArcGIS through the Web Adaptor.

2. The client gets the url to where this is saved, and creates a new KML Layer and adds it to the map.

3. A request is sent up to the Portal instance along with the url for where the KML/KMZ file was hosted.

4. The Portal install is then supposed to connect to the WebAdaptor, grab the KML/KMZ file and return a JSON response back to the client so it can be rendered on the map.

Specifically, when the Portal receives this URL, it rewrites it to start looking within its own directory - hence the Tomcat instance that it is running on at the moment, when in fact it should be retrieving it from the ArcGIS WebAdaptor.

This is why Esri says to set it up on separate boxes.  Read the documentation.

Workaround

The easy fix is on the client to change the URL to where the KML/KMZ was uploaded to use localhost for the server name instead of whatever the ArcGIS WebAdaptor responded with. 

Example:  http://mywebbox-withportal-and-webadaptor.com/..../output_file  should be http://localhost/.../output_file.

Ultimate Workaround:

Put the Portal install on a separate box, or register with a different ip address / fqdn.

View solution in original post

16 Replies
XanderBakker
Esri Esteemed Contributor

Strange, since ArcGIS Online allows it to be added:

JayantaPoddar
MVP Esteemed Contributor

Igor,

You could also try adding the KML to My Content. Then adding the KML layer from My Content.



Think Location
0 Kudos
JonathanQuinn
Esri Notable Contributor

I see no problems in Portal 10.3.1 on my end:

Could you try to run fiddler and see what requests it's making, and if they're successful?  The file will be added through the Portal /sharing/KML utility, so chances are the request is not making it through there.  A Fiddler log or developer tools log from Firefox, Chrome, or IE will be helpful here.

IgorBalotsky1
Occasional Contributor

Jonathan,

Here is the trace from the developer tools - it's the same error. Maybe the issue is with the proxy here at work?

Error: Unable to load KML: http://quickmap.dot.ca.gov/data/cctv.kml File not found. Wrong url or out of memory. {code: 400, message: "Unable to load KML: http://quickmap.dot.ca.gov/dat…v.kml File not found. Wrong url or out of memory.", details: Array[0], log: false, httpCode: 400…}_ssl: undefinedcode: 400details: Array[0]httpCode: 400log: falsemessage: "Unable to load KML: http://quickmap.dot.ca.gov/data/cctv.kml File not found. Wrong url or out of memory."stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__: d "Error: Unable to load KML: http://quickmap.dot.ca.gov/data/cctv.kml File not found. Wrong url or out of memory.

Igor

0 Kudos
CubbySkeete
Esri Contributor

Igor,

I got same error. I am working with support services to see if we can come to a resolution. Does the kml reside on the same server as the web adaptor for your Portal for ArcGIS? If so, can you use a different CNAME to access the kml. (e.g, foo.example.com/filename.kml -> bar.example.com/filename.kml). Can you let me know if that worked for you?

Skeete

MatthewRyan2
New Contributor III

OK, I can give ESRI a good place to start debugging this one. I've got the same set up. I'm having trouble with getting it working too and I want it sorted as soon as possible.

I have a fresh install of portal and I navigate to "http://myhost/arcgis//sharing/kml". This is the URL to tell your JavaScript code to use when processing kml/kmz files.

On that^ page there is a default KML entered in the form to be executed with it. The kml url looks like "http://localhost/kml/usa.kml"  . I am running this on a local browser at http://localhost/arcgis/sharing/kml and get the error:

{"error":{"code":400,"message":"File not found. Wrong url or out of memory.","details":[]}}

I get that^ error every time in my JavaScript when I run the add KML after I've changed the config to use our Portal for the KML translation. Code as shown here ( of course leaving out the irrelevant code and not revealing my server name 😞

require(["esri.layers.KMLLayer","esri/config", .....], function(KMLLayer, esriConfig) {

.....

  esriConfig.defaults.kmlService = "http://servername.domain.suffix/arcgis/sharing/kml";

var kmlUrl = "http://host/kml_data/data/society.kml"

var kmlLyr = new KMLLayer(kmlUrl);

});

Now onto the interesting part. When I point the webform found at http://host/sharing/kml at my australia.kml file on my webserver I get the error message:

{"error":{"code":400,"message":"Internal kml parser error.","details":["The element type \"br\" must be terminated by the matching end-tag \"<\/br>\"."]}}

That's a big problem because my KML contains no character "br" which indicates to me that it's an error with the form.

What do you think it going on here geonet community/ESRI?

0 Kudos
LG1
by
New Contributor

I just solved this.  Here is a short description of my setup, the problem, and solution with a work around.  Esri needs to be informed that there is a bug in their Portal software - hence the reason they suggest to set it up a certain way. 

My Setup

Box 1

IIS Web server project - My Map Code.

Portal software - This is the piece of software from Esri for processing your own KML stuff.

ArcGis WebAdaptor - This is typically the /arcgis/ directory, yet another install from Esri. 

Box 2

Database for my website

Your setup may or may not be similar to this.

The Problem

The problem at the top where the user is looking at the browser realizes that uploading a KML via hyperlink or file, it just does not work! 

Inside F12, web browser Developer tools you may find this nice message.

"File not found. Wrong url or out of memory."

Explanation of the traffic:

When we upload a KML/KMZ file, the process goes as follows:

1. Upload the file to a File Host service on ArcGIS through the Web Adaptor.

2. The client gets the url to where this is saved, and creates a new KML Layer and adds it to the map.

3. A request is sent up to the Portal instance along with the url for where the KML/KMZ file was hosted.

4. The Portal install is then supposed to connect to the WebAdaptor, grab the KML/KMZ file and return a JSON response back to the client so it can be rendered on the map.

Specifically, when the Portal receives this URL, it rewrites it to start looking within its own directory - hence the Tomcat instance that it is running on at the moment, when in fact it should be retrieving it from the ArcGIS WebAdaptor.

This is why Esri says to set it up on separate boxes.  Read the documentation.

Workaround

The easy fix is on the client to change the URL to where the KML/KMZ was uploaded to use localhost for the server name instead of whatever the ArcGIS WebAdaptor responded with. 

Example:  http://mywebbox-withportal-and-webadaptor.com/..../output_file  should be http://localhost/.../output_file.

Ultimate Workaround:

Put the Portal install on a separate box, or register with a different ip address / fqdn.

CubbySkeete
Esri Contributor

Thank you L G. That was extremely helpful.

I was able to get a bug logged for this problem:

BUG-000089958 : Portal for ArcGIS 10.3 fails to add a KML
as an item when the KML is hosted on the same webserver as the web-adaptor
machine.

0 Kudos
JosephBuckles2
New Contributor


I'm getting the same issue, but I'm not sure its the webadaptor issue. I'm unable to access KML files stored anywhere.

0 Kudos