sayli talathi
sayli talathi

Reputation: 127

YAML unmarshal error cannot unmarshal !!str ` ` to str

I am trying to push my Spring Boot application on Pivotal Cloud Foundry (PCF) via manifest.yml file.

While pushing the app i am getting the following error:

{ 
Pushing from manifest to org mastercard_connect / space developer-sandbox as e069875...

Using manifest file C:\Sayli\Workspace\PCF\healthwatch-api\healthwatch-api\manifest.yml

yaml: unmarshal errors:

line 6: cannot unmarshal !!str `healthw...` into []string
FAILED }

Here is the manifest.yml file:

{applications:
- name: health-watch-api

memory: 2GB

instances: 1

paths: healthwatch-api-jar\target\healthwatch-api-jar-0.0.1-SNAPSHOT.jar

services: healthwatch-api-database 
  }

Upvotes: 8

Views: 77565

Answers (3)

Nishith Baravkar
Nishith Baravkar

Reputation: 31

Unmarshal error also occurs when the service you are using expects the manifest.yml file to be written in a different manner. You can refer the docs to check the documentation and mention version in your manifest file corresponding to the apt version of the service.

Upvotes: 0

Jordan
Jordan

Reputation: 80

I got this error while using Pulumi, using GitHub Actions. The cause was not having a Variable available in the GH yaml config. This resulted in the value that I was trying to add to pulumi.dev.yaml being added as 'null'; after correcting this issue, I could see the correct value.

Upvotes: 1

Daniel Mikusa
Daniel Mikusa

Reputation: 15051

Your manifest is not valid. The link @K.AJ posted is a good reference.

https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html

Here's an example, which uses the values from your file.

---
applications:
- name: health-watch-api
  memory: 2G
  path: healthwatch-api-jar/target/healthwatch-api-jar-0.0.1-SNAPSHOT.jar
  services:
  - healthwatch-api-database

You don't need the leading/trailing { }'s, it's path not paths and services is an array. I think the last one is what the cli is complaining about the most.

Hope that helps!

Upvotes: 4

Related Questions