On Tue, 31 Jul 2018 at 09:17, LABBE Corentin <clabbe@baylibre.com> wrote:
On Tue, Jul 31, 2018 at 09:10:21AM +0100, Neil Williams wrote:
> On Tue, 31 Jul 2018 at 09:02, LABBE Corentin <clabbe@baylibre.com> wrote:
>
> > Hello
> >
> > I have queued jobs that I want to cancel but I get instead:
> > 500 Internal Server Error
> > [Errno 2] No such file or directory:
> > '/var/lib/lava-server/default/media/job-output/2018/07/10/7181/job_data.gz'
> > when I click on cancel.
> >
> >
> You should find more information on the details in
> /var/log/lava-server/django.log - there is already a check that the path
> exists in views.py. This could be a logic error in models.py
>
> https://projects.linaro.org/browse/LAVA-1397

I have this in django.log
ERROR 2018-07-31 07:49:51,917 exception Internal Server Error: /scheduler/job/7181/cancel
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3/dist-packages/lava_scheduler_app/views.py", line 1583, in job_cancel
    job.save()
  File "/usr/lib/python3/dist-packages/django_restricted_resource/models.py", line 71, in save
    return super(RestrictedResource, self).save(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 796, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 820, in save_base
    update_fields=update_fields)
  File "/usr/lib/python3/dist-packages/django/dispatch/dispatcher.py", line 191, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/lib/python3/dist-packages/lava_scheduler_app/signals.py", line 121, in testjob_notifications
    send_notifications(job)
  File "/usr/lib/python3/dist-packages/lava_scheduler_app/notifications.py", line 262, in send_notifications
    callback.invoke_callback()
  File "/usr/lib/python3/dist-packages/lava_scheduler_app/models.py", line 2295, in invoke_callback
    with gzip.open(job_data_file, 'wb') as output:
  File "/usr/lib/python3.5/gzip.py", line 53, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/usr/lib/python3.5/gzip.py", line 163, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/lava-server/default/media/job-output/2018/07/10/7181/job_data.gz'

Even /var/lib/lava-server/default/media/job-output/2018/07/10/7181 does not exists


Yes, job.output_dir does not exist because the job has not started yet. I've got a proposed change in review.


--

Neil Williams
=============
neil.williams@linaro.org
http://www.linux.codehelp.co.uk/