jgolob / awsbw

A small CLI utility to view jobs in an AWS batch queue
MIT License
5 stars 2 forks source link

Error when viewing job detail #3

Open sean-smith opened 5 years ago

sean-smith commented 5 years ago

Error encountered when seeing detail D of the job:

Traceback (most recent call last):
  File "/Users/seaam/.pyenv/versions/3.7.0/bin/awsbw", line 10, in <module>
    sys.exit(main())
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/site-packages/awsbw/awsbw.py", line 724, in main
    wrapper(start, args)
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/site-packages/awsbw/awsbw.py", line 712, in start
    awsbw.actionLoop()
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/site-packages/awsbw/awsbw.py", line 702, in actionLoop
    self.handleInput(c)
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/site-packages/awsbw/awsbw.py", line 689, in handleInput
    self.detail_panel()
  File "/Users/seaam/.pyenv/versions/3.7.0/lib/python3.7/site-packages/awsbw/awsbw.py", line 458, in detail_panel
    jobDetails['container']['image'],
KeyError: 'container'

Here's what the output of aws batch describe-jobs --jobs [job id] shows me:

{                                                                                                                                                                
    "jobs": [
        {
            "jobName": "example-mpi-job",
            "jobId": "b0b0zb25-3b46-4936-8954-155zbf6a2190",
            "jobQueue": "arn:aws:batch:us-east-1:922957487318:job-queue/TEST-Batch-JobQueue",
            "status": "SUCCEEDED",
            "attempts": [
                {
                    "container": {
                        "exitCode": 0,
                        "logStreamName": "TEST-MPI-JobDefinition/default/b7085d57-4f31-4584-a96b-6be73b26c3ag",
                        "networkInterfaces": []
                    },
                    "startedAt": 1564446997548,
                    "stoppedAt": 1564447081164,
                    "statusReason": "Essential container in task exited"
                }
            ],
jgolob commented 5 years ago

I believe I have fixed this bug with version 0.0.5. Please let me know if the changes addressed your bug

brainstorm commented 5 years ago

Works fine for me on awsbw 0.0.4 (the one published on PyPi?).