I've a 500 when pywikibot wants to fetch https://fr.wikipedia.org/w/api.php with these parameters
```
inprop=protection&gsrwhat=text&generator=search&format=json&gsrnamespace=0%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%7C2600%7C828%7C829%7C100%7C101%7C102%7C103%7C104%7C105%7C2300%7C2301%7C2302%7C2303&gsrsearch=%22Ssion%22&prop=info%7Cimageinfo%7Ccategoryinfo&iilimit=max&continue=&meta=userinfo&indexpageids=&action=query&gsrlimit=500&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata&uiprop=blockinfo%7Chasmsg
```
That corresponds to, unencoded:
```
inprop = protection
& gsrwhat = text
& generator = search
& format = json
& gsrnamespace = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2600 | 828 | 829 | 100 | 101 | 102 | 103 | 104 | 105 | 2300 | 2301 | 2302 | 2303
& gsrsearch = "Ssion"
& prop = info | imageinfo | categoryinfo
& iilimit = max
& continue =
& meta = userinfo
& indexpageids =
& action = query
& gsrlimit = 500
& iiprop = timestamp | user | comment | url | size | sha1 | metadata
& uiprop = blockinfo | hasmsg
```
I can reproduce the error [[ https://fr.wikipedia.org/wiki/Sp%C3%A9cial:ApiSandbox#action=query&format=json&prop=info%7Cimageinfo%7Ccategoryinfo&meta=userinfo&indexpageids=1&continue=&generator=search&inprop=protection&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata&iilimit=max&uiprop=blockinfo%7Chasmsg&gsrsearch=%22Ssion%22&gsrnamespace=0%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%7C2600%7C828%7C829%7C100%7C101%7C102%7C103%7C104%7C105%7C2300%7C2301%7C2302%7C2303&gsrlimit=500&gsrwhat=text | in the sandbox ]].
The content that is resulted is the generic HTML error page, not JSON as requested in the parameters.
{F22690525}
```
If you report this error to the Wikimedia System Administrators, please include the details below.
PHP fatal error:
request has exceeded memory limit
```
Even if the search query is "too large", a response formatted in JSON should be returned, with a nice readable error code, and not unreadable HTML for programs. Similarly, error code 500 is certainly not desired.
So the error was probably cleared by a program above mediawiki itself.