Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in dagobah log if a deleted job is accessed #36

Closed
utsengar opened this issue Sep 11, 2013 · 3 comments
Closed

Error in dagobah log if a deleted job is accessed #36

utsengar opened this issue Sep 11, 2013 · 3 comments
Assignees
Labels

Comments

@utsengar
Copy link

I get this error continuously (due to constant ajax calls) if a deleted job is accessed in the log and internal server error in the browser.

ERROR [dagobah.daemon.daemon] Exception on /api/job [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/Flask_Login-0.2.6-py2.7.egg/flask_login.py", line 663, in decorated_view
    return func(*args, **kwargs)
  File "/home/stack/dagobah/dagobah/daemon/util.py", line 47, in wrapper
    result = fn(*args, **kwargs)
  File "/home/stack/dagobah/dagobah/daemon/api.py", line 32, in get_job
    return job._serialize()
AttributeError: 'NoneType' object has no attribute '_serialize'

Maybe appropriate error for non existent jobs should be returned.

@ghost ghost assigned thieman Sep 11, 2013
@thieman
Copy link
Owner

thieman commented Sep 12, 2013

Could you give me some more steps to reproduce this? Which page are you looking at in the frontend when this happens? My best guess is that you left a window open on a job detail page after deleting it from the jobs page?

@utsengar
Copy link
Author

Two ways to reproduce the error:

  1. Access a random job which does not exist. Like: http://HOST:9000/job/87333
    You will get Internal server error and this error in the log:

    ERROR [dagobah.daemon.daemon] Exception on /job/87333 [GET]
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
        response = self.full_dispatch_request()
      File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
        rv = self.handle_user_exception(e)
      File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
        reraise(exc_type, exc_value, tb)
      File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
        rv = self.dispatch_request()
      File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
        return self.view_functions[rule.endpoint](**req.view_args)
      File "/usr/local/lib/python2.7/dist-packages/Flask_Login-0.2.6-py2.7.egg/flask_login.py", line 663, in decorated_view
        return func(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/dagobah-0.2.0-py2.7.egg/dagobah/daemon/views.py", line 37, in job_detail
        job = [job for job in jobs if str(job['job_id']) == job_id][0]
    IndexError: list index out of range
    
  2. Open a job which exists, say http://HOST:9000/job/1, now open a dagobah in a new window and delete the job_id=1. You will start seeing the errors mentioned in the original bug since http://HOST:9000/job/1 is already open and making ajax calls.

@thieman
Copy link
Owner

thieman commented Sep 12, 2013

Understood. I'm going to make it throw a reasonable error in both cases and, in the second case, wipe pretty much the entire DOM and let you know there's nothing there anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants