chapi
chapi copied to clipboard
JobLoadException when Marathon job is not on deployed on Marathon already
In my marathon definitions directory, i have a dirty git state right now, because i am preparing a new marathon definition for a new app:
➜ marathon-jobs git:(master) ✗ git st
On branch master
...
Untracked files:
(use "git add <file>..." to include in what will be committed)
X.json
nothing added to commit but untracked files present (use "git add" to track)
When i trigger a typical status call the JobLoadException will be thrown and i don't get results at all:
➜ chapi git:(master) bin/chapi status
[Chapi\Exception\JobLoadException]
Unable to load json job data from "/my/path/X.json". Please check if the json is valid.
status
Expected results would be that i get a listing of Chronos and Marathon tasks and when i have a dirty state (like X.json) i expect a info or warning note.
I guess the content of the X.json is not valid or empty!?
It contains invalid json.
How to reproduce:
- Go to your marathon-tasks definitions
- Create a file
fail.jsonwith the content
{
"id": "/my/id",
}
- Save it
- Go to chapi and hit
bin/chapi status
Then you see the exception above. I expect a normal status output with a warning