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

(nucleus): issues with init-config flag when installing greengrass #876

Closed
ankitm123 opened this issue Feb 26, 2021 · 9 comments
Closed
Labels
bug Something isn't working needs-triage Needs eyeballs

Comments

@ankitm123
Copy link

Describe the bug
I am using terraform to create the AWS resources required by greengrass beforehand (The ones outlined in the manual installation page: https://docs.aws.amazon.com/greengrass/v2/developerguide/manual-installation.html).
After that I use ansible to

  • copy over the cert files to the root directory (/greengrass/v2),
  • copy over the installer zip to the GreengrassCore directory and create a config file (~/GreengrassCore/config.yml)
    and run the command:
sudo -E java -Droot="{{greengrass_root_dir}}" -Dlog.store=FILE \
      -jar "{{greengrass_installer_dir}}"/lib/Greengrass.jar \
      --init-config "{{greengrass_installer_dir}}"/config.yaml \
      --component-default-user {{ggc_user}}:{{ggc_group}} \
      --setup-system-service true

I get a message that:

"Added ggc_user to ggc_group ",
"Successfully set up Nucleus as a system service"

However, when I check the effectiveConfig.yaml file, I see that the thing name, iot end point etc. are all
empty. Checking the greengrass logs, I see the warning:

2021-02-26T15:08:34.687Z [WARN] (main) com.aws.greengrass.deployment.IotJobsHelper: Device not configured to talk to AWS Iot cloud. IOT job deployment is offline: [thingName cannot be empty, certificateFilePath cannot be empty, privateKeyPath cannot be empty, rootCaPath cannot be empty, iotDataEndpoint cannot be empty, iotCredEndpoint cannot be empty]. {}

To Reproduce
See above.

Expected behavior
Installation is successful and core device is created in the greengrass console

Actual behavior
Core device is not created

Environment

  • OS: Ubuntu 20.04
  • JDK version: openjdk version "1.8.0_282"
  • Nucleus version: 2.0.4

Additional context
If I use the provision flag, and specify the thing name and other parameters as outlined in the quick install, it does work. But creates a new certificate, and attaches it to the thing. But there are 2 issues with it:

  • I have to provide AWS credentials to the installer
  • Certficates are created on the fly and not in terraform state, which is a problem.

For quick install (which was successful), I see that the greengrass client was successfully created:

com.aws.greengrass.componentmanager.GreengrassComponentServiceClientFactory: initialize-greengrass-client. {service-region=us-east-2, service-endpoint=https://greengrass-ats.iot.us-east-2.amazonaws.com:8443}

So may be there are some other arguments that need to be passed for the manual step to work?

@ankitm123 ankitm123 added bug Something isn't working needs-triage Needs eyeballs labels Feb 26, 2021
@MikeDombo
Copy link
Contributor

MikeDombo commented Feb 26, 2021

What is the config file which you are using? It must not have setup the thing name and so on.

Additionally, the quotes around your template variables seems wrong. Please remove the quotes.

@ankitm123
Copy link
Author

ankitm123 commented Feb 26, 2021

What is the config file which you are using? It must not have setup the thing name and so on.

Additionally, the quotes around your template variables seems wrong. Please remove the quotes.

This is the config generated by ansible in the GreengrassCore directory (which is supplied to the installer using the --init-config flag);

---
system:
  certificateFilePath: "/greengrass/v2/device.pem.crt"
  privateKeyPath: "/greengrass/v2/private.pem.key"
  rootCaPath: "/greengrass/v2/AmazonRootCA1.pem"
  rootpath: "/greengrass/v2"
  thingName: "test-ggv2-poc"
services:
  aws.greengrass.Nucleus:
    componentType: "NUCLEUS"
    version: "2.0.4"
    configuration:
      awsRegion: "us-east-2"
      iotRoleAlias: "XXXX-role-alias"
      iotDataEndpoint: "XXXX-ats.iot.us-east-2.amazonaws.com"
      iotCredEndpoint: "XXXX.credentials.iot.us-east-2.amazonaws.com"

The quotes are removed once ansible evaluates the variables and prints out the config.
The config keys mentioned as missing in the logs are all present in the config, hence I am a bit suprised that ggv2 installer cannot find them.

@MikeDombo
Copy link
Contributor

MikeDombo commented Feb 26, 2021

What is in the effective config yaml file under the config directory in the greengrass root directory?

Please provide the full log output from the setup Java command.

@ankitm123
Copy link
Author

ankitm123 commented Feb 26, 2021

system:
  certificateFilePath: ""
  privateKeyPath: ""
  rootCaPath: ""
  rootpath: "/greengrass/v2"
  thingName: ""
services:
  aws.greengrass.Nucleus:
    componentType: "NUCLEUS"
    configuration:
      awsRegion: "us-east-2"
      componentStoreMaxSizeBytes: 10000000000
      deploymentPollingFrequencySeconds: 15
      iotCredEndpoint: ""
      iotDataEndpoint: ""
      logging: {}
      mqtt:
        spooler: {}
      networkProxy:
        proxy: {}
      platformOverride: {}
      runWithDefault:
        posixUser: "ggc_user:ggc_group"
      telemetry: {}
    dependencies: []
    version: "2.0.4"
  DeploymentService:
    dependencies: []
    version: "0.0.0"
  FleetStatusService:
    dependencies: []
  main:
    dependencies:
    - "aws.greengrass.Nucleus"
    lifecycle: {}
  TelemetryAgent:
    dependencies: []
    runtime:
      lastPeriodicAggregationMetricsTime: 1614363337396
      lastPeriodicPublishMetricsTime: 1614363337396
    version: "0.0.0"
  UpdateSystemPolicyService:
    dependencies: []
    version: "0.0.0"

This is the full output from the installer:

Added ggc_user to ggc_group 
Successfully set up Nucleus as a system service

And the corresponding log:

021-02-26T18:15:33.222Z [INFO] (main) com.aws.greengrass.util.platforms.Platform: Getting platform instance com.aws.greengrass.util.platforms.unix.UnixPlatform.. {}
2021-02-26T18:15:33.241Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: No ongoing deployment detected. Proceed as default. {}
2021-02-26T18:15:33.288Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.yaml}
2021-02-26T18:15:33.767Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.yaml}
2021-02-26T18:15:33.768Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for services to shutdown. {}
2021-02-26T18:15:34.218Z [ERROR] (Copier) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. {stderr=Created symlink /etc/systemd/system/multi-user.target.wants/greengrass.service → /etc/systemd/system/greengrass.service., command=systemctl enable greengrass.service}
2021-02-26T18:15:34.432Z [INFO] (main) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. Successfully set up systemd service. {}
2021-02-26T18:15:34.432Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: system-shutdown. {main=null}
2021-02-26T18:15:34.433Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.yaml}
2021-02-26T18:15:34.433Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for services to shutdown. {}
2021-02-26T18:15:34.434Z [INFO] (Serialized listener processor) com.aws.greengrass.lifecyclemanager.KernelLifecycle: executor-service-shutdown-initiated. {}
2021-02-26T18:15:34.434Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for executors to shutdown. {}
2021-02-26T18:15:34.434Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: executor-service-shutdown-complete. {}
2021-02-26T18:15:34.434Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: context-shutdown-initiated. {}
2021-02-26T18:15:34.435Z [INFO] (Serialized listener processor) com.aws.greengrass.dependency.Context: Interrupted while running tasks. Publish thread will exit now.. {}
2021-02-26T18:15:34.435Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: context-shutdown-complete. {}
2021-02-26T18:15:36.497Z [INFO] (main) com.aws.greengrass.util.platforms.Platform: Getting platform instance com.aws.greengrass.util.platforms.unix.UnixPlatform.. {}
2021-02-26T18:15:36.515Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: No ongoing deployment detected. Proceed as default. {}
2021-02-26T18:15:36.515Z [INFO] (main) com.aws.greengrass.config.Configuration: config-loading. Read configuration from a file path. {path=/greengrass/v2/config/config.tlog}
2021-02-26T18:15:36.595Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.yaml}
2021-02-26T18:15:37.054Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: system-start. Launch Nucleus. {configPath=/greengrass/v2/config, rootPath=/greengrass/v2, version=2.0.4}
2021-02-26T18:15:37.159Z [INFO] (main) software.amazon.awssdk.eventstreamrpc.RpcServer: IpcServer started.... {}
2021-02-26T18:15:37.177Z [INFO] (main) com.aws.greengrass.mqttclient.spool.Spool: Spooler has been configured. {maxSizeInBytes=2621440, storageType=Memory, keepQos0WhenOffline=false}
2021-02-26T18:15:37.245Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Found Plugin: DeploymentService. {}
2021-02-26T18:15:37.247Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Found Plugin: UpdateSystemPolicyService. {}
2021-02-26T18:15:37.247Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Found Plugin: FleetStatusService. {}
2021-02-26T18:15:37.248Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Found Plugin: TelemetryAgent. {}
2021-02-26T18:15:37.248Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Found Plugin: TokenExchangeService. {}
2021-02-26T18:15:37.249Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: serviceImplementors: {UpdateSystemPolicyService:class com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService...}. {}
2021-02-26T18:15:37.250Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=aws.greengrass.Nucleus}
2021-02-26T18:15:37.256Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: generic-service-loaded. {serviceName=aws.greengrass.Nucleus}
2021-02-26T18:15:37.257Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=main}
2021-02-26T18:15:37.259Z [INFO] (main) com.aws.greengrass.lifecyclemanager.GenericExternalService: Waiting for the desired state list. {serviceName=main, currentState=NEW}
2021-02-26T18:15:37.260Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: generic-service-loaded. {serviceName=main}
2021-02-26T18:15:37.261Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=DeploymentService}
2021-02-26T18:15:37.262Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: service-loaded. {serviceName=DeploymentService}
2021-02-26T18:15:37.346Z [WARN] (main) com.aws.greengrass.deployment.IotJobsHelper: Device not configured to talk to AWS Iot cloud. IOT job deployment is offline: [thingName cannot be empty, certificateFilePath cannot be empty, privateKeyPath cannot be empty, rootCaPath cannot be empty, iotDataEndpoint cannot be empty, iotCredEndpoint cannot be empty]. {}
2021-02-26T18:15:37.348Z [WARN] (main) com.aws.greengrass.deployment.ShadowDeploymentListener: Device not configured to talk to AWS Iot cloud. Single device deployment is offline. {}
2021-02-26T18:15:37.349Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=UpdateSystemPolicyService}
2021-02-26T18:15:37.350Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: service-loaded. {serviceName=UpdateSystemPolicyService}
2021-02-26T18:15:37.350Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=TelemetryAgent}
2021-02-26T18:15:37.398Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: service-loaded. {serviceName=TelemetryAgent}
2021-02-26T18:15:37.403Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.yaml}
2021-02-26T18:15:37.403Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: system-start. {main=services.main:NEW}
2021-02-26T18:15:37.405Z [INFO] (TelemetryAgent-lifecycle) com.aws.greengrass.telemetry.TelemetryAgent: service-report-state. {serviceName=TelemetryAgent, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (TelemetryAgent-lifecycle) com.aws.greengrass.telemetry.TelemetryAgent: service-set-state. {serviceName=TelemetryAgent, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (FleetStatusService-lifecycle) com.aws.greengrass.status.FleetStatusService: service-report-state. {serviceName=FleetStatusService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (FleetStatusService-lifecycle) com.aws.greengrass.status.FleetStatusService: service-set-state. {serviceName=FleetStatusService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (DeploymentService-lifecycle) com.aws.greengrass.deployment.DeploymentService: service-report-state. {serviceName=DeploymentService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (UpdateSystemPolicyService-lifecycle) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-report-state. {serviceName=UpdateSystemPolicyService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=aws.greengrass.Nucleus, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.405Z [INFO] (DeploymentService-lifecycle) com.aws.greengrass.deployment.DeploymentService: service-set-state. {serviceName=DeploymentService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (UpdateSystemPolicyService-lifecycle) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-set-state. {serviceName=UpdateSystemPolicyService, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.Nucleus, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-8) com.aws.greengrass.telemetry.TelemetryAgent: service-awaiting-start. waiting for dependencies to start. {serviceName=TelemetryAgent, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-12) com.aws.greengrass.status.FleetStatusService: service-awaiting-start. waiting for dependencies to start. {serviceName=FleetStatusService, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-8) com.aws.greengrass.telemetry.TelemetryAgent: service-starting. {serviceName=TelemetryAgent, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-12) com.aws.greengrass.status.FleetStatusService: service-starting. {serviceName=FleetStatusService, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=main, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-8) com.aws.greengrass.telemetry.TelemetryAgent: service-report-state. {serviceName=TelemetryAgent, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-10) com.aws.greengrass.deployment.DeploymentService: service-awaiting-start. waiting for dependencies to start. {serviceName=DeploymentService, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-12) com.aws.greengrass.status.FleetStatusService: service-report-state. {serviceName=FleetStatusService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=NEW, newState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-10) com.aws.greengrass.deployment.DeploymentService: service-starting. {serviceName=DeploymentService, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (TelemetryAgent-lifecycle) com.aws.greengrass.telemetry.TelemetryAgent: service-set-state. {serviceName=TelemetryAgent, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (FleetStatusService-lifecycle) com.aws.greengrass.status.FleetStatusService: service-set-state. {serviceName=FleetStatusService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-10) com.aws.greengrass.deployment.DeploymentService: service-report-state. {serviceName=DeploymentService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-awaiting-start. waiting for dependencies to start. {serviceName=main, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (DeploymentService-lifecycle) com.aws.greengrass.deployment.DeploymentService: service-set-state. {serviceName=DeploymentService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-9) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-awaiting-start. waiting for dependencies to start. {serviceName=UpdateSystemPolicyService, currentState=INSTALLED}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-8) com.aws.greengrass.telemetry.TelemetryAgent: service-report-state. {serviceName=TelemetryAgent, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-10) com.aws.greengrass.status.FleetStatusService: service-report-state. {serviceName=FleetStatusService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-9) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-starting. {serviceName=UpdateSystemPolicyService, currentState=INSTALLED}
2021-02-26T18:15:37.406Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-awaiting-start. waiting for dependencies to start. {serviceName=aws.greengrass.Nucleus, currentState=INSTALLED}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-9) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-report-state. {serviceName=UpdateSystemPolicyService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentService: Starting up the Deployment Service. {serviceName=DeploymentService, currentState=STARTING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-starting. {serviceName=aws.greengrass.Nucleus, currentState=INSTALLED}
2021-02-26T18:15:37.407Z [INFO] (UpdateSystemPolicyService-lifecycle) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-set-state. {serviceName=UpdateSystemPolicyService, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentService: service-report-state. {serviceName=DeploymentService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=aws.greengrass.Nucleus, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.407Z [INFO] (FleetStatusService-lifecycle) com.aws.greengrass.status.FleetStatusService: service-set-state. {serviceName=FleetStatusService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentService: Running deployment service. {serviceName=DeploymentService, currentState=STARTING}
2021-02-26T18:15:37.407Z [INFO] (DeploymentService-lifecycle) com.aws.greengrass.deployment.DeploymentService: service-set-state. {serviceName=DeploymentService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (pool-2-thread-9) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-report-state. {serviceName=UpdateSystemPolicyService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (UpdateSystemPolicyService-lifecycle) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-set-state. {serviceName=UpdateSystemPolicyService, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.407Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.Nucleus, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.408Z [INFO] (TelemetryAgent-lifecycle) com.aws.greengrass.telemetry.TelemetryAgent: service-set-state. {serviceName=TelemetryAgent, currentState=STARTING, newState=RUNNING}
2021-02-26T18:15:37.408Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=aws.greengrass.Nucleus, currentState=STARTING, newState=FINISHED}
2021-02-26T18:15:37.409Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=aws.greengrass.Nucleus, currentState=STARTING, newState=STOPPING}
2021-02-26T18:15:37.409Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-finished. Nothing done. {serviceName=aws.greengrass.Nucleus, currentState=STARTING}
2021-02-26T18:15:37.409Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.Nucleus, currentState=STARTING, newState=FINISHED}
2021-02-26T18:15:37.409Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.Nucleus, currentState=FINISHED, newState=STOPPING}
2021-02-26T18:15:37.409Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: Shutdown initiated. {serviceName=aws.greengrass.Nucleus, currentState=STOPPING}
2021-02-26T18:15:37.409Z [INFO] (pool-2-thread-11) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-shutdown. {serviceName=aws.greengrass.Nucleus, currentState=STOPPING}
2021-02-26T18:15:37.410Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-starting. {serviceName=main, currentState=INSTALLED}
2021-02-26T18:15:37.410Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=aws.greengrass.Nucleus, currentState=STOPPING, newState=FINISHED}
2021-02-26T18:15:37.410Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=main, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.410Z [INFO] (aws.greengrass.Nucleus-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=aws.greengrass.Nucleus, currentState=STOPPING, newState=FINISHED}
2021-02-26T18:15:37.410Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=INSTALLED, newState=STARTING}
2021-02-26T18:15:37.410Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=main, currentState=STARTING, newState=FINISHED}
2021-02-26T18:15:37.410Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-finished. Nothing done. {serviceName=main, currentState=STARTING}
2021-02-26T18:15:37.410Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=main, currentState=STARTING, newState=STOPPING}
2021-02-26T18:15:37.410Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=STARTING, newState=FINISHED}
2021-02-26T18:15:37.411Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=FINISHED, newState=STOPPING}
2021-02-26T18:15:37.411Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: Shutdown initiated. {serviceName=main, currentState=STOPPING}
2021-02-26T18:15:37.411Z [INFO] (pool-2-thread-12) com.aws.greengrass.lifecyclemanager.GenericExternalService: generic-service-shutdown. {serviceName=main, currentState=STOPPING}
2021-02-26T18:15:37.411Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-report-state. {serviceName=main, currentState=STOPPING, newState=FINISHED}
2021-02-26T18:15:37.411Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=STOPPING, newState=FINISHED}

@MikeDombo
Copy link
Contributor

Please remove the quotes and ensure that the config file does exist.

It is working for me using

 sudo -E java -Droot=/greengrass/v2 -jar GreengrassCore/lib/Greengrass.jar --init-config t.yaml --setup-system-service true

Where t.yaml is

 system:
    certificateFilePath: "/greengrass/v2/device.pem.crt"
    privateKeyPath: "/greengrass/v2/private.pem.key"
    rootCaPath: "/greengrass/v2/AmazonRootCA1.pem"
    rootpath: "/greengrass/v2"
    thingName: "test-ggv2-poc"

My logs show the line "2021-02-27T00:01:43.469Z [INFO] (main) com.aws.greengrass.config.Configuration: config-loading. Read configuration from a file path. {path=t.yaml}"

So you can see that it is reading from the t.yaml file. I see no such line in your logs which tells me that it was not able to find the file at the path that you provided. Either due to the quotes or due to the path not existing.

@MikeDombo
Copy link
Contributor

I see you thumbed up my last comment; if that works for you, please let us know and close the issue.

@ankitm123
Copy link
Author

I am trying ur suggestions, I will update the ticket once it works. Thanks for the help :)

@ankitm123
Copy link
Author

@MikeDombo it works! The actual issue was that my config file had the yml file extension and not yaml. Once I changed it to yaml (I saw in ur example u have the yaml extension), it worked, and I can see the core device registered in the console.

It's a bit weird that yml is not supported as an extension. What's even more weird is that I did not see that error when running remotely in ansible, but saw the error when running locally on the edge device. However, that's an ansible issue, and not greengrass.

Thanks for the tip!

@MikeDombo
Copy link
Contributor

OK, I'm glad to hear that worked. I'll add a task in our backlog to recognize yml as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs eyeballs
Projects
None yet
Development

No branches or pull requests

2 participants