Page MenuHomePhabricator

invalid result validation in one test causes indefinite "running" in all others
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Similar behavior observed

What happens?:

image.png (817×556 px, 39 KB)

  • The error created as a response is so big that the API fails with "This result was truncated because it would otherwise be larger than the limit of 12,582,912 bytes." (see api call)

What should have happened instead?:

  • It's understandable that the broken test itself fails or exhibits strange behaviour. But this should not affect the outcome of all the others, especially if it's not connected.
  • UI should replace "Running" with "Failed" after the response is received

Event Timeline

There's a JS fatal in the console:

Uncaught (in promise) TypeError: error.messageOrFallback is not a function

at testResults.js:274:26

So we should definitely handle that, alongside the long response.

For all these objects, the evaluator is generating an error that is too big to return as a response.

  • Z507K1 contains the whole dereferenced object (e.g. 46000 lines of JSON) making it too big for a response and also unreadable
  • Z507K2 contains the following error:
Function evaluation failed with status 500: 

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>TypeError: Cannot read properties of undefined (reading '0')
    at WikimediaEcsFormatMiddleware.transform (/srv/service/node_modules/@wikimedia/service-utils/dist/index.js:29:39)
    at Format.transform (/srv/service/node_modules/logform/combine.js:20:24)
    at DerivedLogger._transform (/srv/service/node_modules/winston/lib/winston/logger.js:314:29)
    at Transform._read (/srv/service/node_modules/readable-stream/lib/_stream_transform.js:166:10)
    at Transform._write (/srv/service/node_modules/readable-stream/lib/_stream_transform.js:155:83)
    at doWrite (/srv/service/node_modules/readable-stream/lib/_stream_writable.js:390:139)
    at writeOrBuffer (/srv/service/node_modules/readable-stream/lib/_stream_writable.js:381:5)
    at Writable.write (/srv/service/node_modules/readable-stream/lib/_stream_writable.js:302:11)
    at DerivedLogger.value (/srv/service/node_modules/winston/lib/winston/logger.js:67:18)
    at DerivedLogger.log (/srv/service/node_modules/winston/lib/winston/logger.js:225:14)
</pre>
</body>
</html>

Things to fix:

  • When creating error Z507, set Z507K1 with the initial function call, instead of the same in its current dereferenced shape. This not only would help with readability but would remove the issue of having responses be too large.
  • Handle errors in the front-end perform test request, so that a response of this kind renders "Failed" instead of remaining in "Running..."
  • Find out and fix the origin of the error

Change #1143674 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Build ApiError when response returns 200 but contains warnings

https://gerrit.wikimedia.org/r/1143674

If response contains warnings and no data, we are ending the request with "Failure" and displaying the reason in the error message:

Screenshot from 2025-05-08 23-07-56.png (784×521 px, 48 KB)

Change #1143674 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Build ApiError when response returns 200 but contains warnings

https://gerrit.wikimedia.org/r/1143674

DSantamaria changed the task status from Open to In Progress.May 10 2025, 10:09 AM