Problems using regionmap on kibana 6.5.1

I'm trying to configurate regionmap in a kibana instance that are running in local. AlWays kibana return the same error:

"Cannot download http://localhost:8000/example1.geojson file. Please ensure the CORS configuration of the server permits requests from the Kibana application on this host."

the configuration in kibana is like is talking about in documentation:

regionmap:
    layers:
        - name: "bcn-barris"
          url: "http://localhost:8000/example1.geojson"
          fields:  
            - name: "name"
              description: "example1"

I tryied many ways:

  1. Install with npm http-server and try to start locally using next comand:

http-server --cors='*' -p 8000

server starts correctly but when i try to recover from kibana, errors happends.

  1. Trying to use the same kibana server to serve geojson files.

I copied my file, example1.geojson into [kibana_install_dir]\optimize\bundles. The efect is that i can serve my files throw the next url: http://localhost:5601/bundles/example1.geojson

but again the same message apears.

  1. trying to serve this files from a local apache installation. I follow the instructions about enable CORS configuration in apache here: https://enable-cors.org/server_apache.html

but... the same error apear again.

Iin my opinion the most strange thing is the results of test 2. If files are served by the kibana itself, how is possible that kibana informs that CORS configurations are incorrect? In theory, its not necessary..

Someone have any idea about this?

NOTE: my geojson example file:

{
"type": "featurecollection","features":
[
{"geometry":
{
"type": "Polygon","coordinates":
[ [ [ 2.170043729484323, 41.385469682357026 ], [ 2.170646546404706, 41.384582451354724 ], [ 2.17169812114231, 41.383034680820707 ], [ 2.171721788433596, 41.38299986580229 ], [ 2.172079138962279, 41.382473855563589 ], [ 2.173153085415748, 41.381267761526225 ], [ 2.173279717777688, 41.381125540970139 ], [ 2.174070411173343, 41.380237514008698 ], [ 2.174156532470374, 41.38014079621172 ], [ 2.174702416595381, 41.379508939677599 ], [ 2.175102871988755, 41.379045416586109 ], [ 2.175434539702061, 41.378770936167498 ], [ 2.175525595152453, 41.378645860880646 ], [ 2.175750799837658, 41.378266246911593 ], [ 2.175774001266169, 41.378226338428767 ], [ 2.176004276787348, 41.377830348485041 ], [ 2.176859121497912, 41.376712681047344 ], [ 2.177529964265944, 41.375986773209675 ], [ 2.177459865008629, 41.375904979470981 ], [ 2.177430007884441, 41.375854387023374 ], [ 2.177421806534602, 41.375836169235505 ], [ 2.177412479879368, 41.375810449132892 ], [ 2.177405239139924, 41.375784320574461 ], [ 2.177400130329009, 41.375757928009932 ], [ 2.177397277882313, 41.375732785595829 ], [ 2.177395913070557, 41.375718661026063 ], [ 2.177395668064563, 41.375702977142488 ], [ 2.177396750322672, 41.375687302739507 ], [ 2.177399087079453, 41.375671718365233 ], [ 2.177402737667065, 41.37565626047359 ], [ 2.177407617022675, 41.375641036547364 ], [ 2.17741378527223, 41.375626019993248 ], [ 2.177421157126235, 41.37561133630745 ], [ 2.177429707648887, 41.37559706637947 ], [ 2.177440350532638, 41.375581874611242 ], [ 2.177451871440106, 41.375569130157658 ], [ 2.177463334928529, 41.375558096726152 ], [ 2.177475711869486, 41.375547646300447 ], [ 2.177489001809342, 41.37553781490719 ], [ 2.177527920955122, 41.375512592511896 ], [ 2.177368674811844, 41.375315694131736 ], [ 2.178514078514669, 41.374813646944524 ], [ 2.178863570083496, 41.374660462020167 ], [ 2.178198973635043, 41.373831855176135 ], [ 2.183129944772675, 41.371597187350638 ], [ 2.182076281291919, 41.370277966004636 ], [ 2.177634929704094, 41.372297761678865 ], [ 2.177614333511908, 41.372359910811646 ], [ 2.176900099857641, 41.372679386245231 ], [ 2.176837740710422, 41.372716321858093 ], [ 2.176840639055876, 41.372817533369535 ], [ 2.176392517268402, 41.373023421638763 ], [ 2.175659529124863, 41.373360202797507 ], [ 2.175604097977219, 41.373390053348174 ], [ 2.176383505725734, 41.374346520733447 ], [ 2.175185211795379, 41.374649848827033 ], [ 2.173212370985966, 41.374795225646182 ], [ 2.17273057949106, 41.374828741656138 ], [ 2.172707192502348, 41.374830366153709 ], [ 2.171899439431534, 41.374890531879117 ], [ 2.170051618057805, 41.375016297250923 ], [ 2.169607999630712, 41.375001398517597 ], [ 2.168556084849286, 41.374950077070245 ], [ 2.167846940486142, 41.374984426038189 ], [ 2.167631577590614, 41.375179234037795 ], [ 2.167436772941477, 41.375372857137883 ], [ 2.166534400216464, 41.376049380640019 ], [ 2.166096012986182, 41.376398996302854 ], [ 2.166073541448239, 41.376416911709924 ], [ 2.165456405712666, 41.376909639221537 ], [ 2.164669021662576, 41.377535701177933 ], [ 2.164663202578018, 41.377540000600945 ], [ 2.164340073277919, 41.377778733972569 ], [ 2.163231995036594, 41.37864996742433 ], [ 2.163109537905787, 41.378742197456972 ], [ 2.163340640890831, 41.380337462535813 ], [ 2.163339382538923, 41.380435716563454 ], [ 2.163476122417851, 41.381350235777418 ], [ 2.163520009310038, 41.381669988629028 ], [ 2.163582129272874, 41.382120014670811 ], [ 2.163613537309763, 41.382348691755389 ], [ 2.163621275051269, 41.382398208297836 ], [ 2.163869049222712, 41.384131830964392 ], [ 2.163881145517049, 41.384216481452789 ], [ 2.164027258079788, 41.385248336473495 ], [ 2.164045965178077, 41.385401483101276 ], [ 2.164846888163389, 41.385916156566701 ], [ 2.170043729484323, 41.385469682357026 ] ] ]
},"type": "Feature", "properties": {"N_Distri": "Ciutat Vella"}
}
]
}

regards!

Hi, have you looked into the http-server documentation? Looking at their latest version, 0.8.0, there's no indication that --cors takes a value, which you have as * Not only that, but there's an open issue that --cors doesn't work: https://github.com/indexzero/http-server/issues/394

See if you can create a minimal setup of cross-origin requests working for this http server without going through Kibana to do it. Making the request from a script tag in an HTML page hosted with a different domain should do it.

Thx Tim,

In fact, the use of http-server is one of three ways that i try to configure.

Http-server with this configuration is used in one of yours videos:

Dashboards en Kibana: El siguiente nivel (over min 17)

and is for this reason that i try to reproduce it.

It's possible that cors dont work in http-server, but in apache or using kibana itself?

There are other way to configure external maps in kibana? maybe putting gepjson inside kibana using other way?

kind regards,

Hi, I don't know what's going on with that video link. It looks like it's trying to take me to a Cisco proxy???

I do hope you can get the CORS issue resolved. Realize though that CORS is only needed for cross-origin, so if you have have everything in the same origin you'd be fine.

Kibana run on: https://internal.my-company/kibana/
Map server run on: https://internal.my-company/mapserver/

To host Kibana as a sub-path of a domain, it can be served out of a reverse proxy's /kibana URL path.

Hi Tim,

Unfortunately, I have not been able to fix it.

Highlight, in case you have not understood correctly, that I am trying to load a map in kibana that is in a local installation.

I have tried a nginx server and configuring it to support CORS, it does not work either.

I'm probably doing something wrong, but I really do not know what can be.

If you've tried it that way, could you tell me how you did it?

Regards

Olorade Oscar Hi ,

I am also encountering the same error: Cannot download http://localhost:8000/Liberian_Counties.geojson file. Please ensure the CORS configuration of the server permits requests from the Kibana application on this host.

I have enabled CORS in elasticsearch.yml but I still get the same error. Please if you find a solution to this problem could you please post it here. Thank You,

Richard.

Hi Upchair,

I belive that you dont need configure CORS into EL. In theory, CORS options must be active in a server that serve geojson maps (apache, nginx o other that you have in your local installation or organization.

If you manage to display the maps on the same server as kibana (I assume that within the kibana itself) you do not need to configure the CORS.

In any case, I did not get any results neither configuring an apache, a local nginx with CORS nor putting the maps inside the kibana itself (with or without activated CORS).

I'm sorry I can not help you much more ... :frowning:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.