CORS errors when requesting vectortiles

114 views
Skip to first unread message

Edi Schnüriger

unread,
Mar 31, 2022, 9:23:20 AM3/31/22
to GeoAdminCh API
Hello,

Since March 31th, we are (sometimes) getting CORS error when requesting the vector tiles style.json with Openlayers. Here are two screenshots from the coresponding requests. The first one is an example of a failing one, the second one was a success (after hard page refresh):

Any ideas?

Failing:
Bildschirmfoto 2022-03-31 um 14.06.19.png

Success:
Bildschirmfoto 2022-03-31 um 14.06.14.png

David Oesch

unread,
Mar 31, 2022, 9:29:52 AM3/31/22
to geoadm...@googlegroups.com
After the hard page refresh— fixed or did it reoccur?

--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/feac16ab-bead-41e2-a327-3c781686b04fn%40googlegroups.com.

Edi Schnüriger

unread,
Apr 1, 2022, 1:43:31 AM4/1/22
to GeoAdminCh API
It did and does reoccur

David...@swisstopo.ch

unread,
Apr 1, 2022, 2:08:16 AM4/1/22
to geoadm...@googlegroups.com

Hi Edi

 

We can’t reproduce it ..

For further analysis:

-        Can you provide the Version of OS and Browser ?

-        Did you test it on different platforms?

 

David

 

Internal reference https://jira.swisstopo.ch/browse/BGDIINF_SB-2316

Edi Schnüriger

unread,
Apr 1, 2022, 3:15:28 AM4/1/22
to GeoAdminCh API
We're seeing this on multiple browsers and platforms. Par example:

- Chrome 100.0.4896, Windows 10
- Chrome 99.0.4844, Mac OS X 10.15.7
- Firefox 98.0, Mac OS X 10.15.7
- Safari 15.0, Mac OS X 10.15.7
- Firefox 89.0, Mac OS x 10.15

Can I assist with anything else?

Gilbert Jeiziner

unread,
Apr 1, 2022, 3:33:43 AM4/1/22
to geoadm...@googlegroups.com
Hi Edi

could you provide us with a testlink where the error occurs or create a codepen which doese re-produce it?

That would help us tremendously.

Gilbert

------- Original Message -------
--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.

Edi Schnüriger

unread,
Apr 1, 2022, 4:26:31 AM4/1/22
to GeoAdminCh API
Yes, the same errors appears in this code sandbox I created some time ago: https://codesandbox.io/s/mapbox-style-forked-9t8m8?file=/main.js

Gilbert Jeiziner

unread,
Apr 1, 2022, 5:03:00 AM4/1/22
to geoadm...@googlegroups.com
Hi Edi

thanks alot for the sandbox. This helped alot.

Our first take is a DNS caching issue on browser side. We switched DNS entries for those hosts roughly 8-9 days ago. While the DNS responds correctly, it might be that some DNS cache (on browser level) might exist and be used instead. Clearing caching is the only solution we currently see.

But we'll continue our analysis.

Gilbert

------- Original Message -------

Edi Schnüriger

unread,
Apr 1, 2022, 5:44:12 AM4/1/22
to GeoAdminCh API
Thanks for investigating. Isn't there also a DNS cache on some of the operating systems? 
Because I could reproduce the error on Safari this morning, which I didn't use in the last 8-9 days. That seems to contradict your statement that it's a DNS caching problem only on browser side.

Is there another way to fix this? Clearing DNS cache isn't as straight forward as clearing the browser cache, is it?
Contacting every customer that visited since then and asking them to clear the DNS cache of the browser seems quite cumbersome...


Edi Schnüriger

unread,
Apr 7, 2022, 2:10:57 AM4/7/22
to GeoAdminCh API
May I follow-up and ask what type of DNS records you changed and what their TTL were? This might give a hint how long to wait until the problem fixes itself...
The records here are the new ones, right? https://who.is/dns/vectortiles.geo.admin.ch

GeoAdminCh API

unread,
Apr 7, 2022, 5:37:10 AM4/7/22
to GeoAdminCh API
update: we opened ticket at our network/caching provider
answer: pending....

christoph...@swisstopo.ch

unread,
Apr 7, 2022, 8:55:00 AM4/7/22
to GeoAdminCh API
Update: we have slightly changed the cache configuration as recommended by Infra Provider and the issue seems to have been mitigated by this. Pls report if you still face problems.
We recommend to use the style.json from vectortiles.geo.admin.ch and not statify this locally (unless you want to modify the style). This way you automatically profit from new versions and data-update that you might miss otherwise.

Note: contrary to the initial guess, this has nothing to do with DNS caching issues, so no action to be taken there.

Best, geoadmin team

Edi Schnüriger

unread,
Apr 7, 2022, 9:17:32 AM4/7/22
to GeoAdminCh API
I can confirm that the issue seems to have been mitigated by your change. Thanks a lot!

Edi Schnüriger

unread,
Apr 8, 2022, 6:59:34 AM4/8/22
to GeoAdminCh API
Sorry to bother you again. Something is still not right. I can consistently reproduce the issue when opening the sandbox link in a new Chrome Incognito window.
Can you check again please?

Edi

David...@swisstopo.ch

unread,
Apr 8, 2022, 7:18:49 AM4/8/22
to geoadm...@googlegroups.com, tic...@bgdi.ch

Hi thanks for reaching out-
We will reopen this on our side …

________________________________

Von: Edi Schnüriger <edgar.sc...@gmail.com>
Datum: 8. April 2022 um 12:58:21 MESZ
An: GeoAdminCh API <geoadm...@googlegroups.com>
Betreff: Re: CORS errors when requesting vectortiles

Sorry to bother you again. Something is still not right. I can consistently reproduce the issue when opening the sandbox link in a new Chrome Incognito window.
Can you check again please?

Edi
On Thursday, 7 April 2022 at 15:17:32 UTC+2 Edi Schnüriger wrote:
I can confirm that the issue seems to have been mitigated by your change. Thanks a lot!

On Thursday, 7 April 2022 at 14:55:00 UTC+2 christoph...@swisstopo.ch wrote:
Update: we have slightly changed the cache configuration as recommended by Infra Provider and the issue seems to have been mitigated by this. Pls report if you still face problems.
We recommend to use the style.json from vectortiles.geo.admin.ch<http://vectortiles.geo.admin.ch> and not statify this locally (unless you want to modify the style). This way you automatically profit from new versions and data-update that you might miss otherwise.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/d33303a4-bae9-44eb-bdcd-d8ab6e94d2f1n%40googlegroups.com<https://groups.google.com/d/msgid/geoadmin-api/d33303a4-bae9-44eb-bdcd-d8ab6e94d2f1n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/5186fdac-29db-428e-9062-166598dc02e5n%40googlegroups.com<https://groups.google.com/d/msgid/geoadmin-api/5186fdac-29db-428e-9062-166598dc02e5n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
You received this message because you are subscribed to the Google Groups "GeoAdminCh API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com<mailto:geoadmin-api...@googlegroups.com>.
To view this discussion on the web visit https://groups.google.com/d/msgid/geoadmin-api/29b48a13-a5be-4631-afc3-1d05c31b5da5n%40googlegroups.com<https://groups.google.com/d/msgid/geoadmin-api/29b48a13-a5be-4631-afc3-1d05c31b5da5n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Michael Lieberherr

unread,
Apr 11, 2022, 5:25:22 PM4/11/22
to GeoAdminCh API
Hi all
We have exactly the same CORS issue when requesting the styles.json (also only on the first load). To verify the observations concerning AWS CloudFront caching in this thread, I quickly checked trough a VPN connection (with US IP). Following observations on AWS CloudFront:
CloudFront Edge Location with ID: ZRH50-C1 (Zurich) affected by CORS Error
CloudFront Edge Location with ID: IAD89-P1 (Washington) NOT affected by the same CORS Error (accessed through VPN)
Maybe it will help the further investigation. 
Thanks, Michael

christoph...@swisstopo.ch

unread,
Apr 13, 2022, 10:19:25 AM4/13/22
to GeoAdminCh API
Good afternoon,

Thanks for all the hints. We figured that we accidentally reverted the change we did last Thursday on Friday. We reapplied it yesterday, so everything should be fine again, at least I cannot reproduce it anymore with the codepens and other sample pages I have.

Pleas excuse the hassle with this issue, I hope we have resolved it for good now.

Best, Chris

Edi Schnüriger

unread,
Apr 14, 2022, 1:51:04 AM4/14/22
to GeoAdminCh API
Thank you very much. Seems good just now. We'll monitor the situation for some time.
Reply all
Reply to author
Forward
0 new messages