Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACAS-783: Fix package import error and message printing #1183

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

brianbolt
Copy link
Contributor

@brianbolt brianbolt commented Jun 26, 2024

Description

  • 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.

@brianbolt brianbolt requested a review from bffrost June 26, 2024 17:21
Copy link
Collaborator

@bffrost bffrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brianbolt brianbolt merged commit cc7bbb5 into release/2024.3.x Jun 26, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants