Not able to install AWS-IoT-Greengrass in Windows 10 computer. Running cmd as an Administrator - aws-iot-greengrass

C:\>java "-Droot=C:\greengrass\v2" "-Dlog.store=FILE" -jar .\GreengrassCore\lib\Greengrass.jar --aws-region eu-west-2 --thing-name GreengrassQuickStartCore-181063c79f4 --thing-group-name SaikatGreengrassGroup --component-default-user ggc_user --provision true --setup-system-service true --deploy-dev-tools true
I am using above command to install AWS-IoT-Greengrass. After executing the above command it is throwing below error. Can anyone have idea how to resolve this issue?
Provisioning AWS IoT resources for the device with IoT Thing Name: [GreengrassQuickStartCore-181063c79f4]...
Found IoT policy "GreengrassV2IoTThingPolicy", reusing it
Creating keys and certificate...
Attaching policy to certificate...
Creating IoT Thing "GreengrassQuickStartCore-181063c79f4"...
Attaching certificate to IoT thing...
Successfully provisioned AWS IoT resources for the device with IoT Thing Name: [GreengrassQuickStartCore-181063c79f4]!
Adding IoT Thing [GreengrassQuickStartCore-181063c79f4] into Thing Group: [SaikatGreengrassGroup]...
Successfully added Thing into Thing Group: [SaikatGreengrassGroup]
Setting up resources for aws.greengrass.TokenExchangeService ...
Attaching TES role policy to IoT thing...
No managed IAM policy found, looking for user defined policy...
IAM policy named "GreengrassV2TokenExchangeRoleAccess" already exists. Please attach it to the IAM role if not already
Configuring Nucleus with provisioned resource details...
Root CA file found at "C:\greengrass\v2\rootCA.pem". Contents will be preserved.
Downloading Root CA from "https://www.amazontrust.com/repository/AmazonRootCA1.pem"
Created device configuration
Successfully configured Nucleus with provisioned resource details!
Creating a deployment for Greengrass first party components to the thing group
Configured Nucleus to deploy aws.greengrass.Cli component
Default user creation is only supported on Linux platforms, Greengrass will not make a user for you. Ensure that the user exists and password is stored. Continuing...
Error while trying to setup Greengrass Nucleus
java.lang.ExceptionInInitializerError
at com.aws.greengrass.util.platforms.windows.WindowsPlatform.createNewProcessRunner(WindowsPlatform.java:233)
at com.aws.greengrass.util.orchestration.SystemServiceUtils.runCommand(SystemServiceUtils.java:38)
at com.aws.greengrass.util.orchestration.WinswUtils.setupSystemService(WinswUtils.java:54)
at com.aws.greengrass.easysetup.GreengrassSetup.performSetup(GreengrassSetup.java:328)
at com.aws.greengrass.easysetup.GreengrassSetup.main(GreengrassSetup.java:269)
Caused by: java.nio.file.InvalidPathException: Illegal char <"> at index 0: "
at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
at java.base/java.nio.file.Path.of(Path.java:147)
at java.base/java.nio.file.Paths.get(Paths.java:69)
at com.aws.greengrass.util.Exec.addPathEntries(Exec.java:152)
at com.aws.greengrass.util.Exec.<clinit>(Exec.java:69)
... 5 more

Related

Laravel AWS Elastic Beanslack deployment error- Out of memory error

I deployed my Application in AWS Elastic Beanslack. Intially I deployed my application directly in Aws console. After configuring all the things. I zipped my code and upload it in a console. At that time its working perfect.
But now I tried to deploy with cli, its shows error. I put eb deploy command
Creating application version archive "app-xxxxxxxxx".
Uploading: [##################################################] 100% Done...
2020-03-14 18:51:49 INFO Environment update is starting.
2020-03-14 18:51:55 INFO Deploying new version to instance(s).
2020-03-14 18:52:22 ERROR [Instance: i-xxxxxxxxx] Command failed on instance. Return code: 255 Output: (TRUNCATED)...ar/src/Composer/DependencyResolver/GenericRule.php on line 36
Fatal error: Out of memory (allocated 809508864) (tried to allocate 8192 bytes) in phar:///opt/elasticbeanstalk/support/composer.phar/src/Composer/DependencyResolver/GenericRule.php on line 36.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2020-03-14 18:52:22 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-03-14 18:52:22 ERROR Unsuccessful command execution on instance id(s) 'i-xxxxxxxxx'. Aborting the operation.
2020-03-14 18:52:23 ERROR Failed to deploy application.
From Internet I tried these all these things
1) I extended memory in php.ini but still its not working
2) I created ebextensions folder and do some configurations but thats also not working
My guess was Initially I deployed manually, so at that time I zipped with vendor folder also. Now when I tried with cli it wont take vendor folder. Instead of its by using composer install
So I think I'm facing this issues due to these things
Please let us know, If any other thing I want to do
This is a configuration inside de ElasticBeanstalk Environment.
To increase de memory limit:
Access the Elastic Beanstalk section
Open to your environment
Go to Configuration , then Software
Find the Memory limit field. The default value is 1024M.
Update the value to what you want
Apply the change
Redeploy your application
When deploy with ElasticBeanstalk (ELB) we should check Environment. With memory_limit, you can config this in Software tab (Configuration)
Follow:
Access the ELB
Open to your environment
Go to Configuration , then Software tab
Find the Memory limit field.
Change the value for what you want
Redeploy

salt master minion communication error in aws instances

I have installed salt-master and minion on aws ec2 instances and configured cloud in the below formatenter image description here
and i came up with the error like permission denied(publickey) can any one suggest me a better solution
Owner of the key file must be the same user that start your services (salt-master/minion).
Otherwise OS won't allow you to read such file
The command is:
chown this_maybe_salt_user /path/to/your/key

Datastore permission denied when running bookshelf sample app locally

I am getting a PERMISSION_DENIED error when attempting to run the sample bookshelf app provided by Google CloudPlatform.
On https://cloud.google.com/java/getting-started/using-forms it says to run the following command:
mvn -Plocal clean jetty:run-exploded -DprojectID=[YOUR-PROJECT-ID]
The error I am getting is:
[WARNING] Failed startup of context o.e.j.m.p.JettyWebAppContext#25e203e6{/,file:///Users/markfriesen/Documents/workspace/getting-started-java/bookshelf/2-structured-data/target/bookshelf-2-1.0-SNAPSHOT/,UNAVAILABLE}{/Users/markfriesen/Documents/workspace/getting-started-java/bookshelf/2-structured-data/target/bookshelf-2-1.0-SNAPSHOT}
com.google.cloud.datastore.DatastoreException: Missing or insufficient permissions.
at com.google.cloud.datastore.spi.v1.HttpDatastoreRpc.translate(HttpDatastoreRpc.java:128)
...
Caused by: com.google.datastore.v1.client.DatastoreException: Missing or insufficient permissions., code=PERMISSION_DENIED
at com.google.datastore.v1.client.RemoteRpc.makeException(RemoteRpc.java:126)
at com.google.datastore.v1.client.RemoteRpc.makeException(RemoteRpc.java:169)
I am able to launch the datastore emulator using the command:
gcloud beta emulators datastore start --project=[YOUR-PROJECT-ID]
I am running:
macOS Sierra
Java version: 1.8.0_112
Anyone got ideas?
Thanks
From the error message, it appears that the code is in fact connecting to the real GCD, not the Emulator, and you do not have the Datastore API enabled for the project. I would recommend logging into GCD and enable the Datastore API and try again.
I ran into this problem in a docker context :
I was running the datastore emulator in a docker container within a docker-compose network
I was trying to connect to it from my local machine.
When I ran the command/script from another container connected to the network of the datastore it worked. I guess it's the localhost exception or something like that.

InvalidIamUserArnException when registering on prem instance

No matter what instance name I choose, whenever I perform the following on an on prem instance:
aws deploy register --instance-name test --tags "Key=Name,Value=test" --region us-west-2 --debug
The following exception is thrown (always):
2016-04-12 11:02:52,625 - MainThread - awscli.errorhandler - DEBUG - HTTP Response Code: 400
ERROR
A client error (InvalidIamUserArnException) occurred when calling the RegisterOnPremisesInstance operation: Iam User ARN
arn:aws:iam::xxx:user/AWS/CodeDeploy/test is not in a valid format
Register the on-premises instance by following the instructions in "Configure Existing On-Premises Instances by Using AWS CodeDeploy" in the AWS CodeDeploy User Guide.
Despite this error, the user gets created on amazon, and I can continue to register the on prem instance with the following:
aws deploy register-on-premises-instance --instance-name test --iam-user-arn arn:aws:iam::xxx:user/test
aws deploy install --override-config --config-file codedeploy.onpremises.yml --region us-west-2 --agent-installer s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.msi
The instance is registered and the user is created, but when deploying to it, I always get "No hosts succeeded". The logs for the codedeploy agent show no errors.
I am not sure whats happening here either since no logs on either end, in codedeploy console or on the on prem machine codedeploy agent. Any ideas?
Please note I am using Windows Embedded Standard 2010 (which is not in the supported list) with the latest version of aws cli but I have successfully deployed to it in the past (with previous version of aws cli).
Figured it out, seems to be broken* if you try and let 'aws deploy register' create IAM user for you. However, if you create the user first (via console or aws cli), then it will work.
You can pass in the option '--iam-user-arn arn:aws:iam::xxx:user/OnPremCodeDeploy' with the 'aws deploy register' command afterwards.
I created the on prem yml manually with the correct access keys from manually creating user and then finally ran:
aws deploy install --overide-config --config-file conf.onpremises.yml --region us-west-2 --agent-installer s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.msi
* at least w/ codedeployagent OFFICIAL_1.0.1.950_msi and windows embedded
Could you check if the IAM user you registered the on-premises instance with CodeDeploy has proper permissions? Including the following.
"iam:CreateAccessKey",
"iam:CreateUser",
"iam:DeleteAccessKey",
"iam:DeleteUser",
"iam:DeleteUserPolicy",
"iam:ListAccessKeys",
"iam:ListUserPolicies",
"iam:PutUserPolicy",
"iam:GetUser"
This can also be referred here: http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-configure-on-premises-host.html#how-to-configure-on-premises-host-prerequisites

Packer and AWS credentials: CryptProtectData failed

I am provisioning a Windows machine using Packer. I use a Powershell Script to do most of the provisioning.
An important provisioning step is to download some software from a private S3 bucket. In attempt to first set AWS credentials I run this snippit:
echo "Configure AWS"
echo "AWS_ACCESS_KEY_ID: ${env:AWS_ACCESS_KEY_ID}"
echo "AWS_SECRET_ACCESS_KEY: ${env:AWS_SECRET_ACCESS_KEY}"
echo "AWS_DEFAULT_REGION: ${env:AWS_DEFAULT_REGION}"
Set-AWSCredentials -AccessKey ${env:AWS_ACCESS_KEY_ID} -SecretKey ${env:AWS_SECRET_ACCESS_KEY} -StoreAs default
And invariably get an error when Packer runs it on the machine:
amazon-ebs: Set-AWSCredentials : CryptProtectData failed.
amazon-ebs: At C:\Windows\Temp\script.ps1:15 char:1
amazon-ebs: + Set-AWSCredentials -AccessKey ${env:AWS_ACCESS_KEY_ID} -SecretKey
amazon-ebs: ${env:AWS_SECR ...
If I run this command directly on the Windows instance it works fine.
Thanks,
Jevon
from the PowerShell doc:
The PowerShell Tools can use either of two credentials stores.
The AWS SDK store, which encrypts your credentials and stores them in your home folder. The AWS SDK for .NET and AWS Toolkit for Visual
Studio can also use the AWS SDK store.
The credentials file, which is also located in your home folder, but stores credentials as plain text. By default, the credentials file is
stored here: `C:\Users\username.aws. The AWS SDKs and the AWS Command
Line Interface can also use the credentials file. If you are running a
script outside of your AWS user context, be sure that the file that
contains your credentials is copied to a location where all user
accounts (local system and user) can access your credentials.
From google search, it seems people turn to use BasicAWSCredentials
I am not sure this is something you can do (depending if you use an SDK or not), if not you can use the second approach described in doc and store the variables in C:\Users\username\.aws and use S3 command with the credentials stored from this file

Resources