WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

Cloud download doesn't work from Windows binary #147

Closed mzieg closed 8 months ago

mzieg commented 1 year ago

I was able to reproduce on user KP's laptop that ENLIGHTEN 4.0.10 was unable to download an Andor config file from AWS, even though internet was otherwise working on the laptop. Possibly issue with Win11? (I only tested locally on Win10) Low-priority, but annoying.

samiebee43 commented 1 year ago

Did this have anything to do with keys.py and the Network folder?

mzieg commented 1 year ago

...possibly. I just verified on my own laptop. It's not working from the 4.0.10 installer (that I built :-( )

mzieg commented 1 year ago

I'm not sure this has ever worked through our installers. Or maybe it did, but it is now broken. I don't think it has anything to do with the keys file. If keys.py wasn't being compiled in, CloudManager.py wouldn't be trying to connect.

mzieg commented 1 year ago

Failing transcript (run from binary installer):

2023-05-15 11:57:08,440 [0x000019c8] enlighten.Controller DEBUG    attempting to download Andor EEPROM
2023-05-15 11:57:08,440 [0x000019c8] enlighten.network.CloudManager DEBUG    checking if internet available
2023-05-15 11:57:08,472 [0x000019c8] enlighten.network.CloudManager INFO     internet is available
2023-05-15 11:57:08,472 [0x000019c8] enlighten.network.CloudManager DEBUG    creating cloud session
2023-05-15 11:57:08,472 [0x000019c8] enlighten.network.CloudManager DEBUG    instantiating boto3 client
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from before-call.apigateway to before-call.api-gateway
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2023-05-15 11:57:08,472 [0x000019c8] botocore.hooks DEBUG    Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: env
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: assume-role
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: assume-role-with-web-identity
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: sso
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: shared-credentials-file
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: custom-process
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: config-file
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: ec2-credentials-file
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: boto-config
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: container-role
2023-05-15 11:57:08,487 [0x000019c8] botocore.credentials DEBUG    Looking for credentials via: iam-role
2023-05-15 11:57:08,487 [0x000019c8] urllib3.connectionpool DEBUG    Starting new HTTP connection (1): 169.254.169.254:80
  (one sec)
2023-05-15 11:57:09,503 [0x000019c8] urllib3.connectionpool DEBUG    Starting new HTTP connection (2): 169.254.169.254:80
  (one sec)
2023-05-15 11:57:10,504 [0x000019c8] botocore.loaders DEBUG    Loading JSON file: C:\Program Files\Wasatch Photonics\ENLIGHTEN\Enlighten\botocore\data\endpoints.json
2023-05-15 11:57:10,519 [0x000019c8] botocore.loaders DEBUG    Loading JSON file: C:\Program Files\Wasatch Photonics\ENLIGHTEN\Enlighten\botocore\data\sdk-default-configuration.json
2023-05-15 11:57:10,519 [0x000019c8] botocore.hooks DEBUG    Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000026F47C5E0E0>
2023-05-15 11:57:10,597 [0x000019c8] botocore.loaders DEBUG    Loading JSON file: C:\Program Files\Wasatch Photonics\ENLIGHTEN\Enlighten\botocore\data\cognito-identity\2014-06-30\service-2.json
2023-05-15 11:57:10,675 [0x000019c8] botocore.loaders DEBUG    Loading JSON file: C:\Program Files\Wasatch Photonics\ENLIGHTEN\Enlighten\botocore\data\cognito-identity\2014-06-30\endpoint-rule-set-1.json.gz
2023-05-15 11:57:10,675 [0x000019c8] botocore.loaders DEBUG    Loading JSON file: C:\Program Files\Wasatch Photonics\ENLIGHTEN\Enlighten\botocore\data\partitions.json
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event creating-client-class.cognito-identity: calling handler <function add_generate_presigned_url at 0x0000026F47BCD990>
2023-05-15 11:57:10,690 [0x000019c8] botocore.endpoint DEBUG    Setting cognito-identity timeout as (60, 60)
2023-05-15 11:57:10,690 [0x000019c8] enlighten.network.CloudManager DEBUG    getting client credentials
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event before-parameter-build.cognito-identity.GetId: calling handler <function generate_idempotent_uuid at 0x0000026F47C5F640>
2023-05-15 11:57:10,690 [0x000019c8] botocore.regions DEBUG    Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2023-05-15 11:57:10,690 [0x000019c8] botocore.regions DEBUG    Endpoint provider result: https://cognito-identity.us-east-1.amazonaws.com
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event before-call.cognito-identity.GetId: calling handler <function add_recursion_detection_header at 0x0000026F47C5F2E0>
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event before-call.cognito-identity.GetId: calling handler <function inject_api_version_header_if_needed at 0x0000026F47C78EE0>
2023-05-15 11:57:10,690 [0x000019c8] botocore.endpoint DEBUG    Making request for OperationModel(name=GetId) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'AWSCognitoIdentityService.GetId', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133'}, 'body': b'{"IdentityPoolId": "us-east-1:93d19108-8553-4ce6-ad24-4f39f097ddc4"}', 'url': 'https://cognito-identity.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x0000026F4A6FBD30>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event request-created.cognito-identity.GetId: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x0000026F4A6FBBE0>>
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event choose-signer.cognito-identity.GetId: calling handler <function disable_signing at 0x0000026F47C5FAC0>
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event request-created.cognito-identity.GetId: calling handler <function add_retry_headers at 0x0000026F47C795A0>
2023-05-15 11:57:10,690 [0x000019c8] botocore.endpoint DEBUG    Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://cognito-identity.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'AWSCognitoIdentityService.GetId', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133', 'amz-sdk-invocation-id': b'fcb69aa1-6155-4988-80a2-d159891f8e9f', 'amz-sdk-request': b'attempt=1', 'Content-Length': '68'}>
2023-05-15 11:57:10,690 [0x000019c8] botocore.httpsession DEBUG    Exception received when sending urllib3 HTTP request
Traceback (most recent call last):
  File "importlib\_common.py", line 92, in _tempfile
  File "importlib\abc.py", line 371, in read_bytes
  File "importlib\_adapters.py", line 54, in open
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "botocore\httpsession.py", line 453, in send
  File "botocore\httpsession.py", line 380, in _setup_ssl_cert
  File "botocore\httpsession.py", line 96, in get_cert_path
  File "certifi\core.py", line 72, in where
  File "contextlib.py", line 135, in __enter__
  File "importlib\_common.py", line 98, in _tempfile
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\mzieg\\AppData\\Local\\Temp\\tmpzd_x20yy'
2023-05-15 11:57:10,690 [0x000019c8] botocore.hooks DEBUG    Event needs-retry.cognito-identity.GetId: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x0000026F421BD030>>
2023-05-15 11:57:10,690 [0x000019c8] botocore.retries.standard DEBUG    Retry needed, retrying request after delay of: 0.32240068155206736
mzieg commented 1 year ago

Working transcript (run from source):

2023-05-15 12:12:32,511 [0x00000854] enlighten.Controller DEBUG    attempting to download Andor EEPROM
2023-05-15 12:12:32,511 [0x00000854] enlighten.network.CloudManager DEBUG    checking if internet available
2023-05-15 12:12:32,574 [0x00000854] enlighten.network.CloudManager INFO     internet is available
2023-05-15 12:12:32,574 [0x00000854] enlighten.network.CloudManager DEBUG    creating cloud session
2023-05-15 12:12:32,574 [0x00000854] enlighten.network.CloudManager DEBUG    instantiating boto3 client
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from before-call.apigateway to before-call.api-gateway
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2023-05-15 12:12:32,574 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: env
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: assume-role
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: assume-role-with-web-identity
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: sso
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: shared-credentials-file
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: custom-process
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: config-file
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: ec2-credentials-file
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: boto-config
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: container-role
2023-05-15 12:12:32,589 [0x00000854] botocore.credentials DEBUG    Looking for credentials via: iam-role
2023-05-15 12:12:32,589 [0x00000854] urllib3.connectionpool DEBUG    Starting new HTTP connection (1): 169.254.169.254:80
2023-05-15 12:12:33,589 [0x00000854] urllib3.connectionpool DEBUG    Starting new HTTP connection (2): 169.254.169.254:80
2023-05-15 12:12:34,605 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\endpoints.json
2023-05-15 12:12:34,605 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\sdk-default-configuration.json
2023-05-15 12:12:34,605 [0x00000854] botocore.hooks DEBUG    Event choose-service-name: calling handler <function handle_service_name_alias at 0x00000271E8065FC0>
2023-05-15 12:12:34,652 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\cognito-identity\2014-06-30\service-2.json
2023-05-15 12:12:34,714 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\cognito-identity\2014-06-30\endpoint-rule-set-1.json.gz
2023-05-15 12:12:34,714 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\partitions.json
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event creating-client-class.cognito-identity: calling handler <function add_generate_presigned_url at 0x00000271E7FD5630>
2023-05-15 12:12:34,714 [0x00000854] botocore.endpoint DEBUG    Setting cognito-identity timeout as (60, 60)
2023-05-15 12:12:34,714 [0x00000854] enlighten.network.CloudManager DEBUG    getting client credentials
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.cognito-identity.GetId: calling handler <function generate_idempotent_uuid at 0x00000271E8067760>
2023-05-15 12:12:34,714 [0x00000854] botocore.regions DEBUG    Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2023-05-15 12:12:34,714 [0x00000854] botocore.regions DEBUG    Endpoint provider result: https://cognito-identity.us-east-1.amazonaws.com
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event before-call.cognito-identity.GetId: calling handler <function add_recursion_detection_header at 0x00000271E8067400>
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event before-call.cognito-identity.GetId: calling handler <function inject_api_version_header_if_needed at 0x00000271E807D000>
2023-05-15 12:12:34,714 [0x00000854] botocore.endpoint DEBUG    Making request for OperationModel(name=GetId) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'AWSCognitoIdentityService.GetId', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133'}, 'body': b'{"IdentityPoolId": "us-east-1:93d19108-8553-4ce6-ad24-4f39f097ddc4"}', 'url': 'https://cognito-identity.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x00000271F72CA1D0>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event request-created.cognito-identity.GetId: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x00000271F72CA080>>
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event choose-signer.cognito-identity.GetId: calling handler <function disable_signing at 0x00000271E8067BE0>
2023-05-15 12:12:34,714 [0x00000854] botocore.hooks DEBUG    Event request-created.cognito-identity.GetId: calling handler <function add_retry_headers at 0x00000271E807D6C0>
2023-05-15 12:12:34,714 [0x00000854] botocore.endpoint DEBUG    Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://cognito-identity.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'AWSCognitoIdentityService.GetId', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133', 'amz-sdk-invocation-id': b'c655f153-5e3e-43ec-b679-ee9b7cccd217', 'amz-sdk-request': b'attempt=1', 'Content-Length': '68'}>
2023-05-15 12:12:34,714 [0x00000854] botocore.httpsession DEBUG    Certificate path: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\certifi\cacert.pem
2023-05-15 12:12:34,714 [0x00000854] urllib3.connectionpool DEBUG    Starting new HTTPS connection (1): cognito-identity.us-east-1.amazonaws.com:443
2023-05-15 12:12:34,903 [0x00000854] urllib3.connectionpool DEBUG    https://cognito-identity.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 63
2023-05-15 12:12:34,903 [0x00000854] botocore.parsers DEBUG    Response headers: {'Date': 'Mon, 15 May 2023 16:12:34 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '63', 'Connection': 'keep-alive', 'x-amzn-RequestId': '796c675c-e13e-4ee3-9a80-a8666ac6a35c', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}
2023-05-15 12:12:34,903 [0x00000854] botocore.parsers DEBUG    Response body:
b'{"IdentityId":"us-east-1:2a4b9318-1013-4232-af69-dac7a243d627"}'
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event needs-retry.cognito-identity.GetId: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x00000271F72CB490>>
2023-05-15 12:12:34,903 [0x00000854] botocore.retries.standard DEBUG    Not retrying request.
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event after-call.cognito-identity.GetId: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x00000271F72CA200>>
2023-05-15 12:12:34,903 [0x00000854] enlighten.network.CloudManager DEBUG    getting client credentials for identity
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.cognito-identity.GetCredentialsForIdentity: calling handler <function generate_idempotent_uuid at 0x00000271E8067760>
2023-05-15 12:12:34,903 [0x00000854] botocore.regions DEBUG    Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2023-05-15 12:12:34,903 [0x00000854] botocore.regions DEBUG    Endpoint provider result: https://cognito-identity.us-east-1.amazonaws.com
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event before-call.cognito-identity.GetCredentialsForIdentity: calling handler <function add_recursion_detection_header at 0x00000271E8067400>
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event before-call.cognito-identity.GetCredentialsForIdentity: calling handler <function inject_api_version_header_if_needed at 0x00000271E807D000>
2023-05-15 12:12:34,903 [0x00000854] botocore.endpoint DEBUG    Making request for OperationModel(name=GetCredentialsForIdentity) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'AWSCognitoIdentityService.GetCredentialsForIdentity', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133'}, 'body': b'{"IdentityId": "us-east-1:2a4b9318-1013-4232-af69-dac7a243d627"}', 'url': 'https://cognito-identity.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x00000271F72CA1D0>, 'has_streaming_input': False, 'auth_type': 'none'}}
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event request-created.cognito-identity.GetCredentialsForIdentity: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x00000271F72CA080>>
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event choose-signer.cognito-identity.GetCredentialsForIdentity: calling handler <function disable_signing at 0x00000271E8067BE0>
2023-05-15 12:12:34,903 [0x00000854] botocore.hooks DEBUG    Event request-created.cognito-identity.GetCredentialsForIdentity: calling handler <function add_retry_headers at 0x00000271E807D6C0>
2023-05-15 12:12:34,903 [0x00000854] botocore.endpoint DEBUG    Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://cognito-identity.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'AWSCognitoIdentityService.GetCredentialsForIdentity', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133', 'amz-sdk-invocation-id': b'a9640e3a-535a-4f7e-8674-db9aabf7ec07', 'amz-sdk-request': b'attempt=1', 'Content-Length': '64'}>
2023-05-15 12:12:34,903 [0x00000854] botocore.httpsession DEBUG    Certificate path: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\certifi\cacert.pem
2023-05-15 12:12:34,964 [0x00000854] urllib3.connectionpool DEBUG    https://cognito-identity.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 1760
2023-05-15 12:12:34,964 [0x00000854] botocore.parsers DEBUG    Response headers: {'Date': 'Mon, 15 May 2023 16:12:34 GMT', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1760', 'Connection': 'keep-alive', 'x-amzn-RequestId': '80ecd274-2eb4-4b93-a23e-7e08a21b37ff', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}
2023-05-15 12:12:34,964 [0x00000854] botocore.parsers DEBUG    Response body:
b'{"Credentials":{"AccessKeyId":"*","Expiration":1.684170754E9,"SecretKey":"*","SessionToken":"*"}'
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Event needs-retry.cognito-identity.GetCredentialsForIdentity: calling handler <bound method RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 0x00000271F72CB490>>
2023-05-15 12:12:34,964 [0x00000854] botocore.retries.standard DEBUG    Not retrying request.
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Event after-call.cognito-identity.GetCredentialsForIdentity: calling handler <bound method RetryQuotaChecker.release_retry_quota of <botocore.retries.standard.RetryQuotaChecker object at 0x00000271F72CA200>>
2023-05-15 12:12:34,964 [0x00000854] enlighten.network.CloudManager DEBUG    Parsing credentials
2023-05-15 12:12:34,964 [0x00000854] enlighten.network.CloudManager DEBUG    instantiating client session
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from before-call.apigateway to before-call.api-gateway
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2023-05-15 12:12:34,964 [0x00000854] botocore.hooks DEBUG    Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2023-05-15 12:12:34,964 [0x00000854] botocore.session DEBUG    Setting config variable for region to 'us-east-2'
2023-05-15 12:12:34,980 [0x00000854] enlighten.network.CloudManager DEBUG    Created client session
2023-05-15 12:12:35,027 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\boto3\data\dynamodb\2012-08-10\resources-1.json
2023-05-15 12:12:35,027 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\endpoints.json
2023-05-15 12:12:35,043 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\sdk-default-configuration.json
2023-05-15 12:12:35,043 [0x00000854] botocore.hooks DEBUG    Event choose-service-name: calling handler <function handle_service_name_alias at 0x00000271E8065FC0>
2023-05-15 12:12:35,090 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\dynamodb\2012-08-10\service-2.json
2023-05-15 12:12:35,137 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\dynamodb\2012-08-10\endpoint-rule-set-1.json.gz
2023-05-15 12:12:35,137 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\partitions.json
2023-05-15 12:12:35,137 [0x00000854] botocore.hooks DEBUG    Event creating-client-class.dynamodb: calling handler <function add_generate_presigned_url at 0x00000271E7FD5630>
2023-05-15 12:12:35,137 [0x00000854] botocore.endpoint DEBUG    Setting dynamodb timeout as (60, 60)
2023-05-15 12:12:35,152 [0x00000854] botocore.loaders DEBUG    Loading JSON file: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\botocore\data\_retry.json
2023-05-15 12:12:35,152 [0x00000854] botocore.client DEBUG    Registering retry handlers for service: dynamodb
2023-05-15 12:12:35,152 [0x00000854] boto3.resources.factory DEBUG    Loading dynamodb:dynamodb
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event creating-resource-class.dynamodb.ServiceResource: calling handler <function lazy_call.<locals>._handler at 0x00000271F8791900>
2023-05-15 12:12:35,152 [0x00000854] boto3.resources.factory DEBUG    Loading dynamodb:Table
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event creating-resource-class.dynamodb.Table: calling handler <function lazy_call.<locals>._handler at 0x00000271F8791990>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event creating-resource-class.dynamodb.Table: calling handler <function lazy_call.<locals>._handler at 0x00000271F8791900>
2023-05-15 12:12:35,152 [0x00000854] enlighten.network.CloudManager DEBUG    Finished setting up connection to cloud provider
2023-05-15 12:12:35,152 [0x00000854] enlighten.network.CloudManager DEBUG    loading Andor EEPROM for detector CCD-26826
2023-05-15 12:12:35,152 [0x00000854] boto3.resources.factory DEBUG    Loading dynamodb:Table
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event creating-resource-class.dynamodb.Table: calling handler <function lazy_call.<locals>._handler at 0x00000271F8791990>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event creating-resource-class.dynamodb.Table: calling handler <function lazy_call.<locals>._handler at 0x00000271F8791900>
2023-05-15 12:12:35,152 [0x00000854] boto3.resources.action DEBUG    Calling dynamodb:get_item with {'TableName': 'andor_EEPROM', 'Key': {'detector_serial_number': 'CCD-26826'}}
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event provide-client-params.dynamodb.GetItem: calling handler <function copy_dynamodb_params at 0x00000271F8D87AC0>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.dynamodb.GetItem: calling handler <bound method TransformationInjector.inject_condition_expressions of <boto3.dynamodb.transform.TransformationInjector object at 0x00000271F881F0A0>>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.dynamodb.GetItem: calling handler <bound method TransformationInjector.inject_attribute_value_input of <boto3.dynamodb.transform.TransformationInjector object at 0x00000271F881F0A0>>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.dynamodb.GetItem: calling handler <function generate_idempotent_uuid at 0x00000271E8067760>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-parameter-build.dynamodb.GetItem: calling handler <function block_endpoint_discovery_required_operations at 0x00000271E7F33EB0>
2023-05-15 12:12:35,152 [0x00000854] botocore.regions DEBUG    Calling endpoint provider with parameters: {'Region': 'us-east-2', 'UseDualStack': False, 'UseFIPS': False}
2023-05-15 12:12:35,152 [0x00000854] botocore.regions DEBUG    Endpoint provider result: https://dynamodb.us-east-2.amazonaws.com
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-call.dynamodb.GetItem: calling handler <function add_recursion_detection_header at 0x00000271E8067400>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event before-call.dynamodb.GetItem: calling handler <function inject_api_version_header_if_needed at 0x00000271E807D000>
2023-05-15 12:12:35,152 [0x00000854] botocore.endpoint DEBUG    Making request for OperationModel(name=GetItem) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'DynamoDB_20120810.GetItem', 'Content-Type': 'application/x-amz-json-1.0', 'User-Agent': 'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133 Resource'}, 'body': b'{"TableName": "andor_EEPROM", "Key": {"detector_serial_number": {"S": "CCD-26826"}}}', 'url': 'https://dynamodb.us-east-2.amazonaws.com/', 'context': {'client_region': 'us-east-2', 'client_config': <botocore.config.Config object at 0x00000271F881C970>, 'has_streaming_input': False, 'auth_type': None}}
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event request-created.dynamodb.GetItem: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x00000271F881C8E0>>
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event choose-signer.dynamodb.GetItem: calling handler <function set_operation_specific_signer at 0x00000271E8067640>
2023-05-15 12:12:35,152 [0x00000854] botocore.auth DEBUG    Calculating signature using v4 auth.
2023-05-15 12:12:35,152 [0x00000854] botocore.auth DEBUG    CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.0
host:dynamodb.us-east-2.amazonaws.com
x-amz-date:20230515T161235Z
x-amz-security-token:*
x-amz-target:DynamoDB_20120810.GetItem

content-type;host;x-amz-date;x-amz-security-token;x-amz-target
d843dfd1f372cd9efa62fd00c355110a48a3dedd0f30102350ee8af03cd1695c
2023-05-15 12:12:35,152 [0x00000854] botocore.auth DEBUG    StringToSign:
AWS4-HMAC-SHA256
20230515T161235Z
20230515/us-east-2/dynamodb/aws4_request
*
2023-05-15 12:12:35,152 [0x00000854] botocore.auth DEBUG    Signature:
*
2023-05-15 12:12:35,152 [0x00000854] botocore.hooks DEBUG    Event request-created.dynamodb.GetItem: calling handler <function add_retry_headers at 0x00000271E807D6C0>
2023-05-15 12:12:35,152 [0x00000854] botocore.endpoint DEBUG    Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://dynamodb.us-east-2.amazonaws.com/, headers={'X-Amz-Target': b'DynamoDB_20120810.GetItem', 'Content-Type': b'application/x-amz-json-1.0', 'User-Agent': b'Boto3/1.26.133 Python/3.10.11 Windows/10 Botocore/1.29.133 Resource', 'X-Amz-Date': b'20230515T161235Z', 'X-Amz-Security-Token': b'*, 'Authorization': b'AWS4-HMAC-SHA256 Credential=ASIA2Z3QL476Z6JTFDHC/20230515/us-east-2/dynamodb/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=13ea342b78a1d55add5e1af26ba1252297544f1cf85116e7bf6272ca45057cbf', 'amz-sdk-invocation-id': b'596ece16-76cd-443d-9100-5fa40b7c8bcd', 'amz-sdk-request': b'attempt=1', 'Content-Length': '84'}>
2023-05-15 12:12:35,152 [0x00000854] botocore.httpsession DEBUG    Certificate path: C:\Users\mzieg\miniconda3\envs\conda_enlighten3\lib\site-packages\certifi\cacert.pem
2023-05-15 12:12:35,152 [0x00000854] urllib3.connectionpool DEBUG    Starting new HTTPS connection (1): dynamodb.us-east-2.amazonaws.com:443
2023-05-15 12:12:35,402 [0x00000854] urllib3.connectionpool DEBUG    https://dynamodb.us-east-2.amazonaws.com:443 "POST / HTTP/1.1" 200 496
2023-05-15 12:12:35,402 [0x00000854] botocore.parsers DEBUG    Response headers: {'Server': 'Server', 'Date': 'Mon, 15 May 2023 16:12:35 GMT', 'Content-Type': 'application/x-amz-json-1.0', 'Content-Length': '496', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'H7A52D3POS74DO4MJ4MQGD56ORVV4KQNSO5AEMVJF66Q9ASUAAJG', 'x-amz-crc32': '755374385'}
2023-05-15 12:12:35,402 [0x00000854] botocore.parsers DEBUG    Response body:
b'{"Item":{"excitation_nm_float":{"N":"1063.83"},"detector_serial_number":{"S":"CCD-26826"},"raman_intensity_coeffs":{"L":[{"N":"0.005259877"},{"N":"-0.001453733"},{"N":"0.00002027716"},{"N":"-0.0000001015509"},{"N":"0.0000000002142931"},{"N":"-0.0000000000001533194"}]},"detector_type":{"S":"iDus"},"wp_serial_number":{"S":"WP-01265"},"wp_model":{"S":"WP-1064XL-F15-XR-IC"},"wavelength_coeffs":{"L":[{"N":"1081.88"},{"N":"0.6353086"},{"N":"-0.000007287224"},{"N":"-0.00000002989192"},{"N":"0"}]}}}'
2023-05-15 12:12:35,417 [0x00000854] botocore.hooks DEBUG    Event needs-retry.dynamodb.GetItem: calling handler <botocore.retryhandler.RetryHandler object at 0x00000271F881DFF0>
2023-05-15 12:12:35,417 [0x00000854] botocore.retryhandler DEBUG    No retry needed.
2023-05-15 12:12:35,417 [0x00000854] botocore.hooks DEBUG    Event after-call.dynamodb.GetItem: calling handler <bound method TransformationInjector.inject_attribute_value_output of <boto3.dynamodb.transform.TransformationInjector object at 0x00000271F881F0A0>>
2023-05-15 12:12:35,417 [0x00000854] boto3.resources.action DEBUG    Response: {'Item': {'excitation_nm_float': Decimal('1063.83'), 'detector_serial_number': 'CCD-26826', 'raman_intensity_coeffs': [Decimal('0.005259877'), Decimal('-0.001453733'), Decimal('0.00002027716'), Decimal('-1.015509E-7'), Decimal('2.142931E-10'), Decimal('-1.533194E-13')], 'detector_type': 'iDus', 'wp_serial_number': 'WP-01265', 'wp_model': 'WP-1064XL-F15-XR-IC', 'wavelength_coeffs': [Decimal('1081.88'), Decimal('0.6353086'), Decimal('-0.000007287224'), Decimal('-2.989192E-8'), Decimal('0')]}, 'ResponseMetadata': {'RequestId': 'H7A52D3POS74DO4MJ4MQGD56ORVV4KQNSO5AEMVJF66Q9ASUAAJG', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'Server', 'date': 'Mon, 15 May 2023 16:12:35 GMT', 'content-type': 'application/x-amz-json-1.0', 'content-length': '496', 'connection': 'keep-alive', 'x-amzn-requestid': 'H7A52D3POS74DO4MJ4MQGD56ORVV4KQNSO5AEMVJF66Q9ASUAAJG', 'x-amz-crc32': '755374385'}, 'RetryAttempts': 0}}
2023-05-15 12:12:35,417 [0x00000854] enlighten.Controller DEBUG    andor_eeprom = {'excitation_nm_float': 1063.83, 'detector_serial_number': 'CCD-26826', 'raman_intensity_coeffs': [0.005259877, -0.001453733, 2.027716e-05, -1.015509e-07, 2.142931e-10, -1.533194e-13], 'detector_type': 'iDus', 'wp_serial_number': 'WP-01265', 'wp_model': 'WP-1064XL-F15-XR-IC', 'wavelength_coeffs': [1081.88, 0.6353086, -7.287224e-06, -2.989192e-08, 0.0]}
mzieg commented 1 year ago

So the first observation is that those two HTTP requests which take one second apiece to create from the installer, occur instantly when run from source:

2023-05-15 11:57:08,487 [0x000019c8] urllib3.connectionpool DEBUG    Starting new HTTP connection (1): 169.254.169.254:80
  (one sec)
2023-05-15 11:57:09,503 [0x000019c8] urllib3.connectionpool DEBUG    Starting new HTTP connection (2): 169.254.169.254:80
  (one sec)
mzieg commented 1 year ago

Hah. Well played.

samiebee43 commented 1 year ago

Removing assignment, as I'm taking that to mean "actively in progress". Feel free to readd later

mzieg commented 1 year ago

Purportedly this did work at the QC station on WP-00918 o_O

mzieg commented 8 months ago

Seems to work from 4.0.42 installer with WP-01635. Resolving.