Skip to content

Stream Manager deployment failure

0

Hi!

I have a problem with StreamManger. I created a custom component to upload files to S3. When I deployed the component with the requirements of StreamManager the deployment fails.

If I try to deploy only the StreamManager component (without the custom component) the result is the same. Adding the TokenExchangeService in the deployment I have the same result.

The greengrass.log show:

2024-10-04T09:54:56.017Z [INFO] (pool-2-thread-23) com.aws.greengrass.deployment.DeploymentStatusKeeper: Stored deployment status. {DeploymentId=2339f6e2-67b8-4637-8502-4c3d4ba3cafa, GreengrassDeploymentId=edd550dc-4182-410b-bf20-3c17438fffe7, DeploymentStatus=FAILED} 2024-10-04T09:54:56.017Z [INFO] (pool-2-thread-23) com.aws.greengrass.deployment.IotJobsHelper: Updating status of persisted deployment. {Status=FAILED, StatusDetails={deployment-error-stack=[DEPLOYMENT_FAILURE, COMPONENT_UPDATE_ERROR, COMPONENT_BROKEN], deployment-error-types=[AWS_COMPONENT_ERROR], deployment-failure-cause=Service aws.greengrass.StreamManager in broken state after deployment, detailed-deployment-status=FAILED_ROLLBACK_COMPLETE}, ThingName=my_thing, JobId=2339f6e2-67b8-4637-8502-4c3d4ba3cafa}

The StreamManager.log show: 2024-10-04T09:54:45.075Z [INFO] (Copier) aws.greengrass.StreamManager: Startup script exited. {exitCode=1, serviceName=aws.greengrass.StreamManager, currentState=STARTING} 2024-10-04T09:54:45.077Z [INFO] (pool-2-thread-70) aws.greengrass.StreamManager: shell-runner-start. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=STARTING, command=["java -cp /greengrass/v2/packages/artifacts/aws.greengrass.StreamManager/2.1.1..."]} 2024-10-04T09:54:45.165Z [WARN] (Copier) aws.greengrass.StreamManager: stderr. Error: Could not find or load main class com.amazonaws.iot.greengrass.streammanager.StreamManagerService. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=STARTING} 2024-10-04T09:54:45.165Z [WARN] (Copier) aws.greengrass.StreamManager: stderr. Caused by: java.lang.ClassNotFoundException: com.amazonaws.iot.greengrass.streammanager.StreamManagerService. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=STARTING}

For more info I have the Greengrass in a docker container and there is any problem with the files and directory permisions.

I another AWS account of a friend the custom component deployed well and works perfectly; and we compare the policys of the TokenExchangeRole and seems equal.

Why the StreamManager can't download the jars to install?

asked 2 years ago359 views

2 Answers
0

The StreamManager deployment is failing due to a Java class loading issue. The error message indicates that the main class "com.amazonaws.iot.greengrass.streammanager.StreamManagerService" could not be found or loaded. This suggests that there might be a problem with the Java classpath or the required JAR files for StreamManager.

To resolve this issue, you can try the following steps:

  1. Verify that all the necessary JAR files for StreamManager are present in the correct location within your Greengrass core device (in this case, your Docker container).

  2. Check the Java classpath configuration to ensure it includes the directory containing the StreamManager JAR files.

  3. Make sure that the Java version installed in your Docker container is compatible with the version required by StreamManager.

  4. Review the permissions of the StreamManager-related files and directories within the Docker container to ensure the Greengrass process has read and execute access.

  5. Try cleaning the Greengrass core device by removing any cached or temporary files related to previous deployments, then attempt the deployment again.

  6. Verify that your Docker container has sufficient resources (memory, CPU) allocated to run StreamManager and other Greengrass components.

  7. Check your network connectivity to ensure the Greengrass core can download any required dependencies during the deployment process.

If the issue persists after trying these steps, you may want to compare the Docker container configuration and environment between your setup and your friend's working setup. Look for any differences in Java installation, environment variables, or Greengrass core configuration that might explain why it works in one environment but not in yours.

Additionally, you might want to review the Greengrass logs for any earlier messages that could provide more context about why the StreamManager service is failing to start properly.

If you continue to experience issues, consider reaching out to AWS support for further assistance, as they may be able to provide more specific guidance based on your account and configuration details.

Sources
Stream manager - AWS IoT Greengrass
Use StreamManagerClient to work with streams - AWS IoT Greengrass

answered 2 years ago

0

An old similar problem - https://repost.aws/questions/QUr5sBuHjySWWG1k6l9NjXMw/streammanager-error-could-not-find-or-load-main-class-com-amazonaws-iot-gre.

Please check and make sure user "ggc_user" has permission to read the greengrass directories.

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.