Support Questions
Find answers, ask questions, and share your expertise

HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

Solved Go to solution

HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

Expert Contributor

Hi, suddenly we've clicked

"GET /oozie/list_workflows/ HTTP/1.1"

 

And got exception. What do we do wrong?

 

 

19:19:54.000INFOaccess
10.100.141.164 devops - "GET /oozie/list_workflows/ HTTP/1.1"
19:19:54.000INFOmiddleware
Processing exception: User matching query does not exist.: Traceback (most recent call last):
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Django-1.2.3-py2.6.egg/django/core/handlers/base.py", line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/apps/oozie/src/oozie/views/editor.py", line 70, in list_workflows
'json_jobs': json.dumps(list(data.values_list('id', flat=True))),
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/desktop/core/src/desktop/lib/django_util.py", line 221, in render
**kwargs)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/desktop/core/src/desktop/lib/django_util.py", line 144, in _render_to_response
return django_mako.render_to_response(template, *args, **kwargs)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/desktop/core/src/desktop/lib/django_mako.py", line 117, in render_to_response
return HttpResponse(render_to_string(template_name, data_dictionary), **kwargs)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/desktop/core/src/desktop/lib/django_mako.py", line 106, in render_to_string_normal
result = template.render(**data_dict)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Mako-0.7.2-py2.6.egg/mako/template.py", line 412, in render
return runtime._render(self, self.callable_, args, data)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py", line 766, in _render
**_kwargs_for_callable(callable_, data))
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py", line 798, in _render_context
_exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Mako-0.7.2-py2.6.egg/mako/runtime.py", line 824, in _exec_template
callable_(context, *args, **kwargs)
File "/tmp/tmp6o407q/oozie/editor/list_workflows.mako.py", line 219, in render_body
__M_writer(escape(unicode( workflow.owner.username )))
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Django-1.2.3-py2.6.egg/django/db/models/fields/related.py", line 302, in __get__
rel_obj = QuerySet(self.field.rel.to).using(db).get(**params)
File "/opt/cloudera/parcels/CDH-4.3.0-1.cdh4.3.0.p0.22/share/hue/build/env/lib/python2.6/site-packages/Django-1.2.3-py2.6.egg/django/db/models/query.py", line 341, in get
% self.model._meta.object_name)
DoesNotExist: User matching query does not exist.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

Expert Contributor

Magic tricks with ids didn't help. They brought more problem during migration later.
We did partial migration (users+their saved pig/hive/impala scripts/queries) from sqlite to postgre and the problem gone.
The problem is solved for us.

View solution in original post

10 REPLIES 10

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

In the Hue shell, can you find the culprit?

 

build/env/bin/hue shell
>

 

from django.contrib.auth.models import User
from oozie.models import Workflow

sample_user = User.objects.get(username='sample')

for workflow in Workflow.objects.all():
  try:
    workflow.owner
  except Exception, e:
    print e
    print workflow
 
Workflow.objects.filter(owner=None).update(owner=sample_user)

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

This is very probably this bug: https://issues.cloudera.org/browse/HUE-1091 (workaround explained there)

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

Expert Contributor

We are now migrating to 4.4, thanks, we'll check.

 

We are still in progress, I'll report later how thing go on.

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

New Contributor

We tried to do as described here: https://issues.cloudera.org/browse/HUE-1091

 

Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import User
>>> User.objects.create(id=1100713, username='oozie_sample')
<User: oozie_sample>

 

But we still have an error

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

You should try to get the workflows with the missing user with the above script.

 

If it is not enought, you could try removing the 'oozie_sample' and replace him with

 

User.objects.create(id=1100713, username='sample')

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

New Contributor

How can I delete user?

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

e.g.

 

User.objects.get(username='oozie_sample').delete()

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

And I would recommend this:

 

from django.contrib.auth.models import User
from oozie.models import Workflow

sample_user = User.objects.get(username='sample')

for workflow in Workflow.objects.all():
  try:
    workflow.owner
  except Exception, e:
    print e
    print workflow
 
Workflow.objects.filter(owner=None).update(owner=s

ample_user)

Re: HUE 2.3, CDH 4.3 list_workflows, list_coordinators exceptions

New Contributor

I tryed

>>> User.objects.get(username='oozie_sample').delete()
>>> User.objects.get(username='sample').delete()
>>>

 

But user 'sample' is still present on "useradmin" page... What do I do wrong?