chapi icon indicating copy to clipboard operation
chapi copied to clipboard

JobLoadException when Marathon job is not on deployed on Marathon already

Open andygrunwald opened this issue 8 years ago • 2 comments

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.

andygrunwald avatar Mar 02 '17 10:03 andygrunwald

I guess the content of the X.json is not valid or empty!?

msiebeneicher avatar Mar 02 '17 11:03 msiebeneicher

It contains invalid json.

How to reproduce:

  1. Go to your marathon-tasks definitions
  2. Create a file fail.json with the content
{
    "id": "/my/id",
}
  1. Save it
  2. Go to chapi and hit bin/chapi status

Then you see the exception above. I expect a normal status output with a warning

andygrunwald avatar Mar 03 '17 09:03 andygrunwald