Page MenuHomePhabricator

sparql gives me 403
Closed, ResolvedPublicBUG REPORT

Description

I use POST to access https://query.wikidata.org/sparql with a bot; It seems that the first access works fine and then the second POST would get 403. This happens all the time.

I have a unique user agent.

Here is one example of such failed request

URI=https://query.wikidata.org/sparql
server=nginx/1.14.2
date=Fri, 06 Jan 2023 16:17:33 GMT
content-type=text/html
content-length=169
x-served-by=wdqs1012
age=0
x-cache=cp3064 miss, cp3058 pass
x-cache-status=pass
server-timing=cache;desc="pass", host;desc="cp3058"
strict-transport-security=max-age=106384710; includeSubDomains; preload
report-to={ "group": "wm_nel", "max_age": 86400, "endpoints": [{ "url": "https://intake-logging.wikimedia.org/v1/events?stream=w3c.reportingapi.network_error&schema_uri=/w3c/reportingapi/network_error/1.0.0" }] }
nel={ "report_to": "wm_nel", "max_age": 86400, "failure_fraction": 0.05, "success_fraction": 0.0}
accept-ch=Sec-CH-UA-Arch,Sec-CH-UA-Bitness,Sec-CH-UA-Full-Version-List,Sec-CH-UA-Model,Sec-CH-UA-Platform-Version
permissions-policy=interest-cohort=(),ch-ua-arch=(self "intake-analytics.wikimedia.org"),ch-ua-bitness=(self "intake-analytics.wikimedia.org"),ch-ua-full-version-list=(self "intake-analytics.wikimedia.org"),ch-ua-model=(self "intake-analytics.wikimedia.org"),ch-ua-platform-version=(self "intake-analytics.wikimedia.org")
x-client-ip=147.235.214.33

Event Timeline

It looks like this was blocked by our nginx reverse proxy, and the only rule we have that would block it is for an empty user agent. Are you sure the user agent is sent with that second request?

If you have a link to the code you're using, I could have a look as well.

@Gehel thanks. I found out the headers were indid cleared after the first POST.

Similiar to what this person wrote about (and likewise, reason is unknown)

I will close this ticket.

Kotz claimed this task.
Aklapper removed Kotz as the assignee of this task.Jan 8 2023, 6:07 PM
Aklapper removed a project: Content Discovery.