AWS Greengrass v2 - Windows 10

0

Hi there,

I have a problem when I am installing the AWS Greengrass package on a Windows 10 OS. I have followed all the steps provided by the AWS Greengrass set-up webpage, but unfortunatelly, it does not work.

The set-up command I am writing: java "-Droot=C:\greengrass\v2" "-Dlog.store=FILE" -jar .\lib\Greengrass.jar --init-config .\config-CoreDevice01.yaml --component-default-user ggc_user --setup-system-service true

The output from the program: Error while trying to setup Greengrass Nucleus java.lang.RuntimeException: Cannot create all required directories at com.aws.greengrass.lifecyclemanager.KernelCommandLine.initPaths(KernelCommandLine.java:191) at com.aws.greengrass.lifecyclemanager.KernelCommandLine.lambda$parseArgs$0(KernelCommandLine.java:147) at com.aws.greengrass.config.Topic.subscribe(Topic.java:50) at com.aws.greengrass.lifecyclemanager.KernelCommandLine.parseArgs(KernelCommandLine.java:147) at com.aws.greengrass.lifecyclemanager.Kernel.parseArgs(Kernel.java:591) at com.aws.greengrass.easysetup.GreengrassSetup.performSetup(GreengrassSetup.java:296) at com.aws.greengrass.easysetup.GreengrassSetup.main(GreengrassSetup.java:269) Caused by: java.nio.file.attribute.UserPrincipalNotFoundException at java.base/sun.nio.fs.WindowsUserPrincipals.lookup(WindowsUserPrincipals.java:147) at java.base/sun.nio.fs.WindowsFileSystem$LookupService$1.lookupPrincipalByGroupName(WindowsFileSystem.java:250) at com.aws.greengrass.util.platforms.windows.WindowsPlatform$WindowsFileSystemPermissionView.aclEntries(WindowsPlatform.java:413) at com.aws.greengrass.util.platforms.windows.WindowsPlatform$WindowsFileSystemPermissionView.<init>(WindowsPlatform.java:326) at com.aws.greengrass.util.platforms.windows.WindowsPlatform.getFileSystemPermissionView(WindowsPlatform.java:458) at com.aws.greengrass.util.platforms.Platform.setPermissions(Platform.java:167) at com.aws.greengrass.util.platforms.Platform.setPermissions(Platform.java:129) at com.aws.greengrass.util.Permissions.setRootPermission(Permissions.java:93) at com.aws.greengrass.util.NucleusPaths.setRootPath(NucleusPaths.java:99) at com.aws.greengrass.lifecyclemanager.KernelCommandLine.initPaths(KernelCommandLine.java:170)

The yaml file:


system: certificateFilePath: "C:\greengrass\v2\X.cert.pem" privateKeyPath: "C:\greengrass\v2\Y.private.key" rootCaPath: "C:\greengrass\v2\AmazonRootCA1.pem" rootpath: "C:\greengrass\v2" thingName: "co2sink-dev-CoreDevice01" services: aws.greengrass.Nucleus: componentType: "NUCLEUS" version: "2.5.2" configuration: awsRegion: "eu-west-1" iotRoleAlias: "co2sink-dev-TokenExchangeRoleAlias" iotDataEndpoint: "aa598pljtwur1-ats.iot.eu-west-1.amazonaws.com" iotCredEndpoint: "cszj6chx6z301.credentials.iot.eu-west-1.amazonaws.com"

I hope you could help, looking forward to hearing from you.

Kind regards. Daniel.

asked 2 years ago618 views
2 Answers
0

Hi all,

I have seen the following link explaining the issue (or what it appears to be so):

https://stackoverflow.com/questions/70419534/aws-greengrass-installation-on-windows-cannot-create-all-required-directories

It seems that building the AWS Greengrass nucleus source code from scratch fixes it, but changing the OS Windows language to English. In any case, when I include a new component to the implementation (specifically, the aws.greengrass.LogManager component), it crashes forever, being imposible to be restarted in any case... and if I take a look to the log, the output is practically the same as my previous post.

Does the issue affect to all components as well? Is there something extra I should take into consideration?

Thanks beforehand, looking forward to hearing from you.

Kind regards. Daniel.

answered 2 years ago
  • Hi, for the LogManager issue, can you also share the error log/stack trace? That'll be helpful for us to determine the cause. By "include a new component to the implementation", do you mean you're deploying the component? What deployment method did you use (thing/thing group/local)?

0

This non-English Windows issue has been fixed but not released yet. Before that, you may develop with a Nucleus built from source. The reason you're seeing the same error again after deploying LogManger is that, during deployment, the Nucleus version gets resolved again because LogManger depends on it. The version resolution process will return latest public version which is 2.5.3 right now. It'll then overwrite your custom-built nucleus with 2.5.3, which fails to restart because it doesn't contain the fix. The solution before the fix is released would be creating a private Nucleus version in your account, for example version 2.5.49. Then when you deploy LogManager, it won't overwrite nucleus with a version that doesn't have the fix. Remember to change the version in conf/recipe.yaml when you build nucleus from source.

Recipe you may use to help create a private Nucleus version:

{
  "RecipeFormatVersion": "2020-01-25",
  "ComponentName": "aws.greengrass.Nucleus",
  "ComponentVersion": "2.5.49",
  "ComponentType": "aws.greengrass.nucleus",
  "ComponentDescription": "Core functionality for device side orchestration of deployments and lifecycle management for execution of Greengrass components and applications. This includes features such as starting, stopping, and monitoring execution of components and apps, interprocess communication server for communication between components, component installation and configuration management.",
  "ComponentPublisher": "AWS",
  "ComponentConfiguration": {
    "DefaultConfiguration": {
      "jvmOptions": "",
      "iotDataEndpoint": "",
      "iotCredEndpoint": "",
      "greengrassDataPlanePort": "8443",
      "awsRegion": "",
      "iotRoleAlias": "",
      "mqtt": {},
      "networkProxy": {},
      "runWithDefault": {},
      "deploymentPollingFrequencySeconds": "15",
      "componentStoreMaxSizeBytes": "10000000000",
      "platformOverride": {}
    }
  },
  "Manifests": [
    {
      "Platform": {
        "os": "linux"
      },
      "Lifecycle": {
        "bootstrap": {
          "requiresPrivilege": true,
          "script": "\nset -eu\nKERNEL_ROOT=\"{kernel:rootPath}\"\nUNPACK_DIR=\"{artifacts:decompressedPath}/aws.greengrass.nucleus\"\nrm -r \"$KERNEL_ROOT\"/alts/current/*\necho \"{configuration:/jvmOptions}\" > \"$KERNEL_ROOT/alts/current/launch.params\"\nln -sf \"$UNPACK_DIR\" \"$KERNEL_ROOT/alts/current/distro\"\nexit 100"
        }
      },
      "Artifacts": [
        {
          "Uri": "s3://gg-test-artifacts/custom-nuc-2.5.49/aws.greengrass.nucleus.zip",
          "Unarchive": "ZIP",
          "Permission": {
            "Read": "ALL",
            "Execute": "ALL"
          }
        }
      ]
    },
    {
      "Platform": {
        "os": "darwin"
      },
      "Lifecycle": {
        "bootstrap": {
          "requiresPrivilege": true,
          "script": "\nset -eu\nKERNEL_ROOT=\"{kernel:rootPath}\"\nUNPACK_DIR=\"{artifacts:decompressedPath}/aws.greengrass.nucleus\"\nrm -r \"$KERNEL_ROOT\"/alts/current/*\necho \"{configuration:/jvmOptions}\" > \"$KERNEL_ROOT/alts/current/launch.params\"\nln -sf \"$UNPACK_DIR\" \"$KERNEL_ROOT/alts/current/distro\"\nexit 100"
        }
      },
      "Artifacts": [
        {
          "Uri": "s3://gg-test-artifacts/custom-nuc-2.5.49/aws.greengrass.nucleus.zip",
          "Unarchive": "ZIP",
          "Permission": {
            "Read": "ALL",
            "Execute": "ALL"
          }
        }
      ]
    },
    {
      "Platform": {
        "os": "windows"
      },
      "Lifecycle": {
        "bootstrap": {
          "requiresPrivilege": true,
          "script": "copy {kernel:rootPath}\\alts\\current\\distro\\bin\\greengrass.xml {artifacts:decompressedPath}\\aws.greengrass.nucleus\\bin\\greengrass.xml& del /q {kernel:rootPath}\\alts\\current\\*&& for /d %x in ({kernel:rootPath}\\alts\\current\\*) do @rd /s /q \"%x\"&& echo {configuration:/jvmOptions} > {kernel:rootPath}\\alts\\current\\launch.params&& mklink /d {kernel:rootPath}\\alts\\current\\distro {artifacts:decompressedPath}\\aws.greengrass.nucleus&& exit 100"
        }
      },
      "Artifacts": [
        {
          "Uri": "s3://gg-test-artifacts/custom-nuc-2.5.49/aws.greengrass.nucleus.zip",
          "Unarchive": "ZIP",
          "Permission": {
            "Read": "ALL",
            "Execute": "ALL"
          }
        }
      ]
    }
  ],
  "Lifecycle": {}
}
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.

Guidelines for Answering Questions