Page MenuHomePhabricator

Geoshapes service is not sending 'access-control-allow-origin' header to some requests
Open, LowPublic

Description

Steps to Reproduce

  1. Access https://en.wikivoyage.org/wiki/Talk:Prague#Wikidata_items_for_dynamic_map
  2. Look at the network requests and see that some requests fulfill without a problem and others are canceled due to the lack of access-control-allow-origin header

Expected Results

  • All requests to maps.wikimedia.org should return access-control-allow-origin header

Actual Results

  • The presence of access-control-allow-origin header is inconsistent and random

Environments Observed

  • English Wikivoyage

Additional notes

  • The ticket was formerly about 429 errors, which is not reproducible at the moment, the history will be preserved for context.

Recently, when I open pages with multi-region maps, the dinamic map fails to load, only the static fallback image is shown. The Kartographer extension tries to load GeoJSON for each regions, but some of them are rejected by the server 'maps.wikimedia.org' with response '429 Too Many Requests'.

It can be easily reproduced on the following pages:
https://en.wikivoyage.org/w/index.php?title=Paris&oldid=3897346#Districts
https://en.wikivoyage.org/w/index.php?title=Vienna&oldid=3897365#Districts
https://en.wikivoyage.org/w/index.php?title=Budapest&oldid=3895843#Districts

Possible solutions are:

  1. Configure the map server to allow more mapshape requests per client at once.
  2. Modify the client JavaScript code to not load mapshapes in parallel, just after each other.
  3. Implement some caching mechanism to reduce the number of requests, and reduce load.

Related discussion:
https://en.wikivoyage.org/wiki/Wikivoyage_talk:Mapmaking_Expedition#Too_Many_Requests_on_loading_complex_dynamic_maps

Event Timeline

Any news? Many of the dynamic maps on Wikivoyage haven't been working for months due to this problem, e.g. https://en.wikivoyage.org/wiki/Paris#Districts

@Renek78 I can't replicate the issue. Could you share screenshots or details of the requests?

@MSantos I cannot replicate the issue for Paris, but on the talk page for Prague the map is still not working: https://en.wikivoyage.org/wiki/Talk:Prague#Wikidata_items_for_dynamic_map

image.png (616×1 px, 138 KB)

Same goes for Vienna (please see link of original poster).

MSantos renamed this task from Too Many Requests on loading complex dynamic maps to Geoshapes service is not sending 'access-control-allow-origin' header to some quests.Jul 9 2020, 5:22 PM
MSantos renamed this task from Geoshapes service is not sending 'access-control-allow-origin' header to some quests to Geoshapes service is not sending 'access-control-allow-origin' header to some requests.
MSantos updated the task description. (Show Details)
MSantos edited projects, added Maps (Kartotherian); removed Maps (Kartographer).

On another note, the requests that are not failing are also missing cache x-cache-status: miss. Adding Traffic to help me understand this information, is it possible that the cache layer is not sending the proper response headers?

MSantos subscribed.
BBlack subscribed.

The swap of Traffic for Traffic-Icebox in this ticket's set of tags was based on a bulk action for all such tickets that haven't been updated in 6 months or more. This does not imply any human judgement about the validity or importance of the task, and is simply the first step in a larger task cleanup effort. Further manual triage and/or requests for updates will happen this month for all such tickets. For more detail, have a look at the extended explanation on the main page of Traffic-Icebox . Thank you!

TheDJ subscribed.

We are still seeing this problem. This seems more common on pages with lots of shapes in the map?? And considering this was first about 429 errors, I'm wondering if rate limiting kicks in in some sort of other way perhaps ? Maybe we get 429s on the must-revalidate and we serve up stale data which doesn't have the headers somehow ?

OK, just by refreshing I can just 'fill the cache' and every refresh i have more shapes (with origin control headers), because more shapes have filled the cache. This is absolutely some sort of rate limiting taking place, possibly between the cache and the server.

Also of note, there is no Cache-Control response header, only Age... There is a "Access-Control-Expose-Headers: etag", but no ETag either ? is that a generic setting on the ATS, or was there an ETag before and now no longer ?

Tagging WMDE, as this looks like something that they might be interested in.