Fixes this error when opening an experiment in LiveDesign:
[acas] [ACAS] 2024-06-24T21:05:46.778Z error: 'Caught exception: RangeError [ERR_HTTP_INVALID_STATUS_CODE]: Invalid status code: NaN\n' +
[acas] ' at ServerResponse.writeHead (node:_http_server:352:11)\n' +
[acas] ' at ServerResponse.writeHead (/home/runner/build/node_modules/on-headers/index.js:44:26)\n' +
[acas] ' at ServerResponse.writeHead (/home/runner/build/node_modules/on-headers/index.js:44:26)\n' +
[acas] ' at ServerResponse._implicitHeader (node:_http_server:338:8)\n' +
[acas] ' at write_ (node:_http_outgoing:945:9)\n' +
[acas] ' at ServerResponse.end (node:_http_outgoing:1056:5)\n' +
[acas] ' at writeend (/home/runner/build/node_modules/express-session/index.js:270:22)\n' +
[acas] ' at Immediate.onsave (/home/runner/build/node_modules/express-session/index.js:348:11)\n' +
[acas] ' at process.processImmediate (node:internal/timers:480:21)'
The bug
Python3.11 upgrade caused an import error Ignoring ImportError: cannot import name 'SNIMissingWarning' from 'urllib3.exceptions' (/home/runner/.local/lib/python3.11/site-packages/urllib3/exceptions.py) which triggered a print() statement at the beginning of the script which went to stdout rather than stderr. Which eventually lead to the nodejs code to try and interpret the error output line as the return status code and led to a NaN error above.
The fixes
Print import errors to stderr
Fix the import error by removing SNIMissingWarning which is not longer available and isn't necessary anyway.
Related Issue
ACAS-783
How Has This Been Tested?
Ran open in LiveDesign after applying the fixes and verified the LiveReport was opened successfully.
Description
The bug Python3.11 upgrade caused an import error
Ignoring ImportError: cannot import name 'SNIMissingWarning' from 'urllib3.exceptions' (/home/runner/.local/lib/python3.11/site-packages/urllib3/exceptions.py)
which triggered a print() statement at the beginning of the script which went to stdout rather than stderr. Which eventually lead to the nodejs code to try and interpret the error output line as the return status code and led to a NaN error above.The fixes
Related Issue
ACAS-783
How Has This Been Tested?
Ran open in LiveDesign after applying the fixes and verified the LiveReport was opened successfully.