{"record":{"id":"ce21c3ef56e187a7","repo":"huggingface/open-r1","slug":"response-message","errorCode":null,"errorMessage":"{response['message']}","messagePattern":"\\{response\\['message'\\]\\}","errorType":"exception","errorClass":"PistonError","httpStatus":null,"severity":"error","filePath":"src/open_r1/utils/competitive_programming/ioi_scoring.py","lineNumber":310,"sourceCode":"            *({\"name\": name, \"content\": content} for name, content in problem[\"grader_files\"] if content),\n        ],\n        \"run_timeout\": round(\n            (problem[\"time_limit\"] + 3) * 1000\n        ),  # +3 seconds hard limit. time limits are handled by the ioi script\n        \"run_memory_limit\": problem[\"memory_limit\"],\n    }\n    return await execute_ioi(client, data)\n\n\nasync def execute_ioi(client, data) -> tuple[str, str]:\n    \"\"\"\n    Requests to the IOI package return the score as a float in the stdout, as well as optional feedback/errors in stderr.\n    Returns a tuple of (score, feedback).\n    \"\"\"\n    response = await client.send_execute(data)\n\n    if \"message\" in response:\n        raise PistonError(response[\"message\"])\n\n    if \"compile\" in response and response[\"compile\"][\"code\"] != 0:\n        return \"0\", \"Compilation error exit code \" + str(response[\"compile\"][\"code\"]) + \"\\n\" + response[\"compile\"][\n            \"stderr\"\n        ]\n\n    if \"run\" not in response:\n        raise PistonError(response)\n\n    if response[\"run\"][\"code\"] == 1 and \"MemoryError\" in response[\"run\"][\"stderr\"]:\n        return \"0\", \"Memory limit exceeded\"\n\n    # successful result\n    if response[\"run\"][\"stdout\"]:\n        return response[\"run\"][\"stdout\"], response[\"run\"][\"stderr\"]\n\n    if response[\"run\"][\"signal\"] == \"SIGKILL\":\n        return \"0\", \"Time limit exceeded\"","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/huggingface/open-r1/blob/1416fa0cf21595d2083b399a2a0bbddd7f6e9563/src/open_r1/utils/competitive_programming/ioi_scoring.py#L292-L328","documentation":"execute_ioi raises PistonError when the Piston IOI package response contains a top-level 'message' key. Piston uses 'message' to report API-level failures (bad request, unsupported language/version, internal worker error) instead of a compile/run result. The library surfaces that message verbatim so the caller sees the remote engine's reason for refusing the submission.","triggerScenarios":"A call to run_submission -> execute_ioi where client.send_execute(data) returns a dict containing key 'message' — e.g. the endpoint doesn't have the cms_ioi language installed, the request payload is malformed, or the Piston worker returns an HTTP-level error body.","commonSituations":"Pointing PISTON_ENDPOINTS at a vanilla Piston instance without the custom IOI package; submitting a language version string Piston can't resolve; Piston worker returning 4xx/5xx JSON with a message field; rate-limited or overloaded worker.","solutions":["Verify the endpoint serves the custom cms_ioi language: curl <endpoint>/api/v2/runtimes and confirm cms_ioi is listed; if not, deploy the IOI package or point PISTON_ENDPOINTS at a valid endpoint.","Read the raised message text — it contains Piston's own reason (unknown language/version etc.) and fix the request accordingly.","Check that the Piston worker is healthy and reachable; replace unhealthy endpoints in PISTON_ENDPOINTS.","Retry with a different endpoint if the error is transient (the client round-robins endpoints)."],"exampleFix":"// before: any Piston endpoint\nPISTON_ENDPOINTS=https://emkc.org/api/v2/piston\n// after: endpoint running the IOI package\nPISTON_ENDPOINTS=http://my-piston-host:2000","handlingStrategy":"try-catch","validationCode":"import httpx\nruntimes = httpx.get(f'{endpoint}/api/v2/runtimes').json()\nassert any(rt['language'] == 'cms_ioi' for rt in runtimes), 'endpoint lacks cms_ioi runtime'","typeGuard":"def has_message(resp: dict) -> bool:\n    return isinstance(resp, dict) and isinstance(resp.get('message'), str)","tryCatchPattern":"try:\n    score, feedback = await run_submission(...)\nexcept PistonError as e:\n    logger.error('Piston rejected execution: %s', e)\n    score, feedback = '0', f'Execution infrastructure error: {e}'","preventionTips":["Health-check endpoints with /api/v2/runtimes before starting evaluation runs","Keep the custom IOI package installed on all workers","Log the full Piston response on failure for diagnosis"],"tags":["piston","sandbox-execution","remote-api"],"backgroundTag":"piston-execution-error","analyzedSha":"1416fa0cf21595d2083b399a2a0bbddd7f6e9563","analyzedAt":"2026-08-30T08:56:53.400Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}