Invalid Yaml: mapping values are not allowed here - yaml

Can anyone help me to figure out the following error while deploying react app on AWS elastic beanstalk -
2019-08-01 04:37:21 ERROR The configuration file .ebextensions/nodecommand.
config in application version app-5466-190801_100700 contains invalid YAML or JS
ON. YAML exception: Invalid Yaml: mapping values are not allowed here
in "<reader>", line 3, column 16:
option_settings:
^
, JSON exception: Invalid JSON: Unexpected character (/) at position 0.. Update
the configuration file.
2019-08-01 04:37:21 ERROR Failed to deploy application.
Following is my nodecommand.config file -
option_settings:
aws: elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"
Update -
I followed this link to deploy React app on AWS elastic beanstalk and stuck on above error -
https://medium.com/#wlto/how-to-deploy-an-express-application-with-react-front-end-on-aws-elastic-beanstalk-880ff7245008

This is what's shown in the linked tutorial:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"
This is the YAML in your question:
option_settings:
aws: elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"
Can you spot the difference?
Spoiler: You've put a space after aws:. This causes the YAML parser to assume aws: is a mapping key with the value "elasticbeanstalk:container:nodejs:". However, the next line, which also starts with a mapping key (NodeCommand), is indented more, which would only be allowed if the previous line was a mapping key without a value.
If you remove the space, it correctly parses aws:elasticbeanstalk:container:nodejs as a mapping key and the following line as its value.

I was not actually had the problem fixed. I found this document[1] that says because my environment is using Amazon Linux 2, the ebextensions is not recommended. (But some of my ebextensions are still working. I have no idea about that). Instead, Buildfile, Procfile, and platform hooks are recommended. Therefore, I created a Procfile with the following content to make the Node server run with the command node index.js.
Procfile
web: node index.js
[1] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html

Related

Laradock: docker-compose.yml is invalid format (PORT[/PROTOCOL]) on Windows

I try to follow the Laradock getting started tutorial on windows: http://laradock.io/getting-started/
I have the following tools:
Docker version: 20.10.5, build 55c4c88
git version: 2.30.2.windows.1
Windows 10 20H2(19042.867)
I get stuck on the step when trying to start the: docker-compose up -d nginx mysql
Then I get these error:
ERROR: The Compose file '.\docker-compose.yml' is invalid because:
services.proxy.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy2.expose is invalid: should be of the format 'PORT[/PROTOCOL]'
services.proxy.ports contains an invalid type, it should be a number, or an object
services.proxy2.ports contains an invalid type, it should be a number, or an object
...
services.sqs.ports contains an invalid type, it should be a number, or an object
services.sqs.ports contains an invalid type, it should be a number, or an object
services.traefik.ports value [':', ':', ':'] has non-unique elements
Only change I done to the repo is to add the env file and this line:
# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../project-z/
I also created the folder project-z
I saw this text quote but didn´t understand it:
Depending on the host’s operating system you may need to change the
value given to COMPOSE_FILE. When you are running Laradock on Mac OS
the correct file separator to use is :. When running Laradock from a
Windows environment multiple files must be separated with ;.
But think it might be related to my issue and I need to update something to make it work on Windows.
Any idea what could be wrong? Since it almost out of the box I assume it´s something with my Windows environment
I found the solution directly after posted this question.
It was very easy I forgot to add the "." before env when created the file.
I found the solution here: https://github.com/laradock/laradock/issues/1437

Unable to parse YAML in config.yml file when I deployed to circle-ci

situation
I'm issuing with a config processing error in my personal project
success
I added AWS s3 and CloudFront and deploy was a success on circle-ci
fail
I added linting that's causing the error but I'm not using tab t for
indentation
this is my repo
error
!/bin/sh -eo pipefail
Unable to parse YAML
while scanning for the next token
found character '\\t(TAB)' that cannot start any token. (Do not use \\t(TAB) for indentation)
in 'string', line 57, column 34:
- *show-current-branch-name\t
^
-------
Warning: This configuration was auto-generated to show you the message above.
Don't rerun this job. Rerunning will have no effect.
false
You have a TAB char at the end of line 57. remove it and it should pass.

How to set the "cluster" property in prisma.yml

Thanks for reading my question in advance. I am just start to use graphql and prisma following this tutorial.
I have the following Error when Deploying the Prisma database service:
Error: No cluster set. Please set the "cluster" property in your prisma.yml
at /Users/judy/howtographql/server/node_modules/graphql-config-extension-prisma/src/index.ts:89:11
at step (/Users/judy/howtographql/server/node_modules/graphql-config-extension-prisma/dist/index.js:40:23)
at Object.next (/Users/judy/howtographql/server/node_modules/graphql-config-extension-prisma/dist/index.js:21:53)
at fulfilled (/Users/judy/howtographql/server/node_modules/graphql-config-extension-prisma/dist/index.js:12:58)
at <anonymous>
error Command failed with exit code 1.
ERROR: "playground" exited with 1.
error Command failed with exit code 1.
I looked over the tutorial to find that there is nothing about how to set the cluster. I wonder how to fix this problem.
The default prisma.yaml is:
# the name for the service (will be part of the service's HTTP endpoint)
service: hackernews-graphql-js
# the cluster and stage the service is deployed to
stage: dev
# to disable authentication:
# disableAuth: true
secret: mysecret123
# the file path pointing to your data model
datamodel: datamodel.graphql
It could be just that you may have entered an incorrect endpoint address. Please refer https://github.com/prisma/graphql-config-extension-graphcool/issues/8

compiling error when using community golang buildpack on bluemix

One of my bluemix application worked for weeks but it start to report parse error with Buildpack compilation step failed when pushing app to bluemix:
-----> Downloaded app package (556K)
Cloning into '/tmp/buildpacks/buildpack-go'...
Submodule 'compile-extensions' (https://github.com/cloudfoundry-incubator/compile-extensions.git) registered for path 'compile-extensions'
Cloning into 'compile-extensions'...
Submodule path 'compile-extensions': checked out 'f752ecf4b27d2f31bb082dfe7a47c76fefc769d7'
-------> Buildpack version 1.4.0
parse error: Expected separator between values at line 32, column 3
Staging failed: Buildpack compilation step failed
Here's my manifest.yml file:
---
applications:
- name: joystick
memory: 128M
path: .
buildpack: https://github.com/cloudfoundry/buildpack-go.git
Update: I carefully read the error message and figured out it is application space problem caused by Godeps.json parsing error caused by code merging where one comma is missed. I can not reproduce this locally because I checked in _workspace directory where it never parse Godeps.json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
The error message parse error: Expected separator between values at line 32, column 3 comes from jq command within buildpack code, where it tries to read import path from Godeps/Godeps.json by assuming it's a valid JSON file. see line #64 of /bin/compile.
It will stop buildpack if the Godeps.json is not json.
I created issue 86 to improve this buildpack to provide more information for such kind of error message.
Thanks for everyone who spent time on this problem.
Update: issue 86 was fixed in heroku golang buildpack by adding new step to checking Godeps.json format.

Error while connecting Elastic Map Reduce ruby client

I am following the steps mentioned on the AWS to use an interactive Hive session using SSH.
I used the following resources
https://github.com/ucbtwitter/getting-started/wiki/Using-Elastic-Map-Reduce-via-Command-Line
http://docs.amazonwebservices.com/ElasticMapReduce/latest/GettingStartedGuide/SignUp.html
I was getting this error initially "Error: Missing key access-id" and then I fixed my JSON file. The JSON file is in the same format as mentioned in the above links.
When I run this command
./elastic-mapreduce
I am getting the following error :-
Error: Unable to parse credentials.json: can't convert String into Integer.
I checked the values required in JSON at AWS as well.
Does anyone has an idea why am I getting this error?
The region value in the credentials.json must be of int type.
{......
......
"region": 1
}

Resources