AWS "amplify push" failed with "Command failed with exit code 1: yarn --production" - amazon-web-services

I was following this tutorial to add a lambda function in my AWS amplify node.js proejct, when I
amplify push
It ends up with this error:
Current Environment: dev
| Category | Resource name | Operation | Provider plugin |
| -------- | ------------- | --------- | ----------------- |
| Function | mylambda | Create | awscloudformation |
| Api | myapi | Create | awscloudformation |
✖ An error occurred when pushing the resources to the cloud
Packaging lambda function failed with the error
Command failed with exit code 1: yarn --production
An error occurred during the push operation: Packaging lambda function failed with the error
Command failed with exit code 1: yarn --production
I tried recreate the amplify project, but ends up with the same error.

Try this:
First go to path:
/myproject-backend/amplify/backend/function/lambdaName/src
Second:
npm install
Later:
amplify push

I was getting the same error. In my case, I had Hadoop yarn installed on my macOS. yarn command on my terminal was invoking Hadoop yarn.
I removed(renamed) the /usr/local/Cellar/hadoop directory to remove the Hadoop. After that, amplify push ran successfully.

I experienced the same issue with Amplify in Ubuntu (WSL). But the windows system had no such issue. I suspect that it was due to yarn not being installed properly in WSL...as yarn --version shows 0.32+git. I am having trouble with uninstalling yarn in WSL...
A follow-up...I figured out what's happening with the yarn in ubuntu...it was contained in cmdtest package - removed that and yarn was also deleted then amplify pushed successfully

Related

Connecting to Camunda

Am not able to connect to Camunda Cloud via nodejs
12:04:22.537 | zeebe | INFO: Error connecting to Camunda Cloud.
12:04:22.656 | zeebe | ERROR: [topology]: Attempt 7 (max: -1).
12:04:22.661 | zeebe | ERROR: [topology]: 14 UNAVAILABLE: DNS resolution failed
Make sure the environment variables documented here: https://docs.camunda.io/docs/apis-clients/cli-client/ are set correctly.
export ZEEBE_ADDRESS='[Zeebe API]'
export ZEEBE_CLIENT_ID='[Client ID]'
export ZEEBE_CLIENT_SECRET='[Client Secret]'
export ZEEBE_AUTHORIZATION_SERVER_URL='[OAuth API]'
https://docs.camunda.io/docs/guides/setup-client-connection-credentials/
should you how to create and download these.
Since the DNS resolution fails, you may have gotten the ZEEBE_ADDRESS wrong.

AWS Elastic Beanstalk error while setting env var via .ebextentions

I am trying to set environment variables in AWS EB using .ebextentions as sited in https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-env-variables-shell/
My current config is:
commands:
setvars:
command: /opt/elasticbeanstalk/bin/get-config environment | jq -r 'to_entries | .[] | "export \(.EB_ENV_NAME)=\"\(.r-service)\""' > /etc/profile.d/sh.local
While running the command to deploy the application to EB, I encounter the following error:
Command failed on instance. Return code: 3 Output: (TRUNCATED)...t <top-level>, line 1:
to_entries | .[] | "export \(.EB_ENV_NAME)=\"\(.r-service)\""
jq: error: b/0 is not defined at <top-level>, line 1:
to_entries | .[] | "export \(.EB_ENV_NAME)=\"\(.r-service)\""
jq: 3 compile errors.
command setvars in .ebextensions/00_setvars.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
Can someone please let me help this solve this error? Thanks.

Multiple build pipelines triggered when a tag is pushed

I have created multiple build pipelines in Azure DevOps for different branches in a repository.
My intention is to trigger each pipeline when a specific tag is pushed.
The tag is structured in a way that it is unique for each pipeline.
Example :
--MyRepository
|
--master
|
--ops
|
--dev
|
--qa
A build pipeline for dev,ops and qa each:
dev should be triggered when iff dev-v* is pushed
ops should be triggered when iff ops-v* is pushed
qa should be triggered when iff qa-v* is pushed
Here's what my yaml file looks like(similar ones for the other pipelines):
trigger:
branches:
include:
- refs/tags/ops-v*
exclude:
- refs/tags/qa*
- refs/tags/dev*
stages:
- stage: Init
jobs:
- job: CheckoutInit
steps:
- checkout: self
- script: *do something*
Now what happens when I push say dev-v1.0.0 is that all the the pipelines are triggered although only the dev pipeline should start. What am I doing wrong or is it something I am overlooking?
Any help is greatly appreciated. Cheers!
Note : I am fairly new to working with Azure Devops.
Based on my test, your Yaml triggers could be right.
I could reproduce the similar issue when the yaml files have the same name in each branch.
For example:
--MyRepository
|
--master
|
--ops
-- azure-pipelines.yml
|
--dev
-- azure-pipelines.yml
|
--qa
-- azure-pipelines.yml
So you could check if the yaml files have the same name.
To solve this issue, you could change each Yaml file name and make sure that they are unique.
--MyRepository
|
--master
|
--ops
-- azure-pipelines-ops.yml
|
--dev
-- azure-pipelines-dev.yml
|
--qa
-- azure-pipelines-qa.yml
Then you need to create new pipelines with the yaml file(new name) again.

AWS CodeDeploy - appspec.yml not found

I am attempting to deploy via AWS CodeDeploy. However it always fails at before-insatll with the following error.
No such file or directory -
/opt/codedeploy-agent/deployment-root/xxxxx/xxxxxx/deployment-archive/appspec.yml
The ZIP files that I have loaded in S3 bucket is following the defined structure here.
|--content (subfolder)
| |--myTextFile.txt
| |--mySourceFile.rb
| |--myExecutableFile.exe
| |--myInstallerFile.msi
| |--myPackage.rpm
| |--myImageFile.png
|--scripts (subfolder)
| |--myShellScript.sh
| |--myBatchScript.bat
| |--myPowerShellScript.ps1
|--appspec.yml
I really can't figure out what is going wrong. Any help would be greatly appreciated.
It seems CodeDeploy cannot find the component files, which results in a failed deployment. Could you make sure that when unzip the bundle, all the files are extracted to the current directory not a new folder?
Not sure if you are bundling in mac os, but we do have a troubleshooting on this page: http://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting.html#troubleshooting-bundle-with-finder

ERRO export KUBERNETES_PROVIDER = aws; curl -sS https://get.k8s.io | bash

I'm running on AWS EC2 Getting started, command:
export KUBERNETES_PROVIDER = aws; curl -sS https://get.k8s.io | bash
But the error occurs:
But the error occurs "salt-master failed to start on 52.24.95.100 Your cluster is unlikely to work Correctly. Please run ./cluster/kube-down.sh and re-create the cluster. (sorry!)
Any suggestion?
I'm not sure about this specific error, but there have been some problems in AWS that cropped up recently. Please see this PR for the fixes:
https://github.com/GoogleCloudPlatform/kubernetes/pull/10877