awslabs / aws-greengrass-labs-certificate-rotator

Greengrass component and companion cloud backend for rotating the core device certificate and private key
Apache License 2.0
13 stars 2 forks source link

Certificate Job Rotator Job remains in "In Progress State" only #64

Closed pmamkh closed 1 week ago

pmamkh commented 1 month ago

Hi team,

I have successfully deployed the component in Edge device and i have created the Job by defining the target device in Job configuration.

As i checked, Job remains in "In Progress" state and it not getting move neither successful or failed state.

Firstly, i raised the case with AWS support team but they told me to raise the issue in Github with below findings from their end. I had shared the component log and greengrass log with team and their primary finding is below.


2024-07-30T05:23:05.992Z [INFO] (Copier) aws.greengrass.labs.CertificateRotator: Run script exited. {exitCode=0, serviceName=aws.greengrass.labs.CertificateRotator, currentState=RUNNING} ———————————————————————————————————————————————————————————————

The exact reason for the exit seems to be a python version error.

——————————————————————————————————————— AttributeError: module 'typing' has no attribute 'TypedDict'.

gregbreen commented 1 month ago

Hi @pmamkh . What version of Python is running on the core device? It needs to be at least 3.8: https://github.com/awslabs/aws-greengrass-labs-certificate-rotator/tree/main?tab=readme-ov-file#python-requirements

pmamkh commented 1 week ago

Hi @gregbreen ,

Thanks for providing the detail.

Just want know that component itself is creating the virtual environment then i think component should not consider the python version of edge device.

Is my understanding correct?

gregbreen commented 1 week ago

No. The virtual environment is used to install required packages, not the Python version. The component source code uses TypedDict for the typing module, and this attribute was added in Python 3.8: https://peps.python.org/pep-0589/. So you need at least Python 3.8 installed on the device.