500 error when using the submit job ui when requesting a device_type that doesn't exist

Bug #1228050 reported by Matthew Hart
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LAVA Scheduler (deprecated)
Fix Released
Medium
Neil Williams

Bug Description

I was trying to use the submit job ui on v.l.o with:

{
    "actions": [
        {
            "command": "deploy_linaro_kernel",
            "parameters": {
                "dtb": "http://community.validation.linaro.org/images/keystone/uImage-rt-k2hk-evm.dtb",
                "firmware": "http://community.validation.linaro.org/images/keystone/skern-keystone-evm.bin",
                "kernel": "http://community.validation.linaro.org/images/keystone/uImage-rt-keystone-evm.bin",
                "ramdisk": "http://community.validation.linaro.org/images/keystone/test.cpio.gz"
            }
        },
        {
            "command": "boot_linaro_image"
        }
    ],
    "device_type": "keystone",
    "health_check": false,
    "job_name": "Keystone Boot Test",
    "logging_level": "DEBUG",
    "timeout": 18000
}

and was getting a HTTP 500 error.
In the uswgi logs I see:

ERROR:django.request:Internal Server Error: /scheduler/jobsubmit
Traceback (most recent call last):
  File "/srv/lava/.cache/eggs/Django-1.4.2-py2.7.egg/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/lava/.cache/git-cache/exports/lava-scheduler/2013-09-18-a38e6cf/lava_scheduler_app/views.py", line 600, in job_submit
    request.POST.get("json-input"), request.user)
  File "/srv/lava/.cache/git-cache/exports/lava-scheduler/2013-09-18-a38e6cf/lava_scheduler_app/models.py", line 481, in from_json_and_user
    device_type = DeviceType.objects.get(name=job_data['device_type'])
  File "/srv/lava/.cache/eggs/Django-1.4.2-py2.7.egg/django/db/models/manager.py", line 131, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/srv/lava/.cache/eggs/Django-1.4.2-py2.7.egg/django/db/models/query.py", line 366, in get
    % self.model._meta.object_name)
DoesNotExist: DeviceType matching query does not exist.

Which showed that I was trying to request a device type that didn't exist.

It would be much better if the UI was able to give me this error rather than just the HTTP 500 page.

Dave Pigott (dpigott)
Changed in lava-scheduler:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → Neil Williams (codehelp)
Neil Williams (codehelp)
Changed in lava-scheduler:
status: Confirmed → Fix Committed
status: Fix Committed → In Progress
Neil Williams (codehelp)
Changed in lava-scheduler:
status: In Progress → Fix Committed
Dave Pigott (dpigott)
Changed in lava-scheduler:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.