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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 31 2019, 11:14 AM
LGoto triaged this task as Low priority.Jan 8 2020, 4:46 PM
Renek78 added a subscriber: Renek78.May 9 2020, 1:37 PM

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 updated the task description. (Show Details)May 9 2020, 1:42 PM

@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

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?

Restricted Application added a project: Operations. · View Herald TranscriptJul 14 2020, 2:58 PM
MSantos removed MSantos as the assignee of this task.Jul 15 2020, 3:52 PM
MSantos added a subscriber: MSantos.