FAQ
Could you print the type of the response too?

e.g.
https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78

Romain

On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton wrote:


I created a new Solr collection and can perform queries from the
SolrAdmin, however the Hue Search app fails.

[17/Sep/2013 14:17:58 +0000] middleware INFO Processing exception:
Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293): Traceback
(most recent call last):
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/Django-1.2.3-py2.4.egg/django/core/handlers/base.py",
line 100, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/decorators.py",
line 35, in decorate
return view_func(request, *args, **kwargs)
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/views.py",
line 239, in admin_collection_template
response = SolrApi(SOLR_URL.get(), request.user).query(solr_query,
hue_collection)
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/api.py",
line 78, in query
response = json.loads(response)
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/__init__.py",
line 307, in loads
return _default_decoder.decode(s)
File
"/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/decoder.py",
line 338, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293)
[17/Sep/2013 14:17:58 +0000] api INFO 119

{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
user.name
":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}

I modified api.py to dump out the response, and it looks like valid JSON
to my eye. Anyone else seeing anything like this?


--
You received this message because you are subscribed to the Google Groups
"Search User" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to search-user+unsubscribe@cloudera.org.
For more options, visit
https://groups.google.com/a/cloudera.org/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.

Search Discussions

  • Scott Hamilton at Sep 17, 2013 at 5:26 am
    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems to
    print this out in the log, I assume it was expecting a Map/dict rather than
    String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name', 'hue'),
    ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'), ('rows', 5),
    ('start', 0), ('facet', 'false'), ('facet.limit', 10), ('facet.mincount',
    1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.

    https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78

    Romain


    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton <det.scott...@gmail.com<javascript:>
    wrote:
    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing exception:
    Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293): Traceback
    (most recent call last):
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/Django-1.2.3-py2.4.egg/django/core/handlers/base.py",
    line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/decorators.py",
    line 35, in decorate
    return view_func(request, *args, **kwargs)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/views.py",
    line 239, in admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_query,
    hue_collection)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/api.py",
    line 78, in query
    response = json.loads(response)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/__init__.py",
    line 307, in loads
    return _default_decoder.decode(s)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/decoder.py",
    line 338, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119

    {"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}

    I modified api.py to dump out the response, and it looks like valid JSON
    to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user...@cloudera.org <javascript:>.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 5:31 am
    Actually when I look closer, that code is quite different to what I see;

       def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),
    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)s/select' % solr_query,
    params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems to
    print this out in the log, I assume it was expecting a Map/dict rather than
    String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name', 'hue'),
    ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'), ('rows', 5),
    ('start', 0), ('facet', 'false'), ('facet.limit', 10), ('facet.mincount',
    1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.

    https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78

    Romain

    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton wrote:


    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing exception:
    Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293): Traceback
    (most recent call last):
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/Django-1.2.3-py2.4.egg/django/core/handlers/base.py",
    line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/decorators.py",
    line 35, in decorate
    return view_func(request, *args, **kwargs)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/views.py",
    line 239, in admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_query,
    hue_collection)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/apps/search/src/search/api.py",
    line 78, in query
    response = json.loads(response)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/__init__.py",
    line 307, in loads
    return _default_decoder.decode(s)
    File
    "/opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/lib/python2.4/site-packages/simplejson-2.0.9-py2.4-linux-x86_64.egg/simplejson/decoder.py",
    line 338, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119

    {"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}

    I modified api.py to dump out the response, and it looks like valid JSON
    to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 17, 2013 at 5:45 am
    This is weird. Indeed, it should load back to Json the string.

    Maybe it is Python 2.4. Could you try to type:

    cd /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue

    $ build/env/bin/hue shell
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    Type "copyright", "credits" or "license" for more information.

    IPython 0.10 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object'. ?object also works, ?? prints more.

    In [1]:
    try:
       import json
    except ImportError:
       import simplejson as json

    In [2]:
    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')
    Out[2]:
    {u'response': {u'docs': [],
                    u'maxScore': 1.0,
                    u'numFound': 9031485,
                    u'start': 0},
      u'responseHeader': {u'QTime': 16,
                          u'params': {u'doAs': u'myusername',
                                      u'facet': u'false',
                                      u'facet.limit': u'10',
                                      u'facet.mincount': u'1',
                                      u'facet.sort': u'count',
                                      u'q': u'*:*',
                                      u'rows': u'5',
                                      u'start': u'0',
                                      u'user.name': u'hue',
                                      u'wt': u'json'},
                          u'status': 0}}




    On Mon, Sep 16, 2013 at 10:31 PM, Scott Hamilton wrote:

    Actually when I look closer, that code is quite different to what I see;

    def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),

    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)s/select' % solr_query,
    params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems to
    print this out in the log, I assume it was expecting a Map/dict rather than
    String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name',
    'hue'), ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'),
    ('rows', 5), ('start', 0), ('facet', 'false'), ('facet.limit', 10),
    ('facet.mincount', 1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.
    https://github.com/cloudera/**hue/blob/branch-2.5-bis/apps/**
    search/src/search/api.py#L78<https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78>

    Romain

    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton wrote:


    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing
    exception: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293):
    Traceback (most recent call last):
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/Django-1.2.3-**
    py2.4.egg/django/core/**handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**decorators.py", line 35, in decorate
    return view_func(request, *args, **kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**views.py", line 239, in
    admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_**query,
    hue_collection)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**api.py", line 78, in query
    response = json.loads(response)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/simplejson-2.0.**
    9-py2.4-linux-x86_64.egg/**simplejson/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/simplejson-2.0.**
    9-py2.4-linux-x86_64.egg/**simplejson/decoder.py", line 338, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 -
    293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119
    {"responseHeader":{"status":0,**"QTime":16,"params":{"facet":"**
    false","facet.mincount":"1","**facet.sort":"count","start":"**0","
    user.name":"hue","q":"*:*"**,"facet.limit":"10","doAs":"**
    myusername","wt":"json","rows"**:"5"}},"response":{"numFound":**
    9031485,"start":0,"maxScore":**1.0,"docs":[]}}

    I modified api.py to dump out the response, and it looks like valid
    JSON to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@cloudera.org.
    For more options, visit https://groups.google.com/a/**
    cloudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 6:18 am
    Ah yes, it's python 2.4 on RHEL 5

    # build/env/bin/hue shell
    /usr/lib64/python2.4/posixfile.py:59: DeprecationWarning: The posixfile
    module is obsolete and will disappear in the future
       DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)

    I'll try and upgrade the OS to python 2.6....
    That could explain some troubles I've been having with the HBase app on Hue
    as well....




    On Tuesday, 17 September 2013 15:45:06 UTC+10, Romain Rigaux wrote:

    This is weird. Indeed, it should load back to Json the string.

    Maybe it is Python 2.4. Could you try to type:

    cd /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue

    $ build/env/bin/hue shell
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    Type "copyright", "credits" or "license" for more information.

    IPython 0.10 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object'. ?object also works, ?? prints more.

    In [1]:
    try:
    import json
    except ImportError:
    import simplejson as json

    In [2]:
    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')
    Out[2]:
    {u'response': {u'docs': [],
    u'maxScore': 1.0,
    u'numFound': 9031485,
    u'start': 0},
    u'responseHeader': {u'QTime': 16,
    u'params': {u'doAs': u'myusername',
    u'facet': u'false',
    u'facet.limit': u'10',
    u'facet.mincount': u'1',
    u'facet.sort': u'count',
    u'q': u'*:*',
    u'rows': u'5',
    u'start': u'0',
    u'user.name': u'hue',
    u'wt': u'json'},
    u'status': 0}}





    On Mon, Sep 16, 2013 at 10:31 PM, Scott Hamilton <det.scott...@gmail.com<javascript:>
    wrote:
    Actually when I look closer, that code is quite different to what I see;

    def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),

    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)s/select' % solr_query,
    params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems to
    print this out in the log, I assume it was expecting a Map/dict rather than
    String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name',
    'hue'), ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'),
    ('rows', 5), ('start', 0), ('facet', 'false'), ('facet.limit', 10),
    ('facet.mincount', 1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.
    https://github.com/cloudera/**hue/blob/branch-2.5-bis/apps/**
    search/src/search/api.py#L78<https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78>

    Romain


    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton <det.scott...@gmail.com
    wrote:
    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing
    exception: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293):
    Traceback (most recent call last):
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/Django-1.2.3-**
    py2.4.egg/django/core/**handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**decorators.py", line 35, in decorate
    return view_func(request, *args, **kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**views.py", line 239, in
    admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_**query,
    hue_collection)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/apps/search/src/search/**api.py", line 78, in query
    response = json.loads(response)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/simplejson-2.0.**
    9-py2.4-linux-x86_64.egg/**simplejson/__init__.py", line 307, in
    loads
    return _default_decoder.decode(s)
    File "/opt/cloudera/parcels/CDH-4.**4.0-1.cdh4.4.0.p0.39/share/**
    hue/build/env/lib/python2.4/**site-packages/simplejson-2.0.**
    9-py2.4-linux-x86_64.egg/**simplejson/decoder.py", line 338, in
    decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 -
    293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119
    {"responseHeader":{"status":0,**"QTime":16,"params":{"facet":"**
    false","facet.mincount":"1","**facet.sort":"count","start":"**0","
    user.name":"hue","q":"*:*"**,"facet.limit":"10","doAs":"**
    myusername","wt":"json","rows"**:"5"}},"response":{"numFound":**
    9031485,"start":0,"maxScore":**1.0,"docs":[]}}

    I modified api.py to dump out the response, and it looks like valid
    JSON to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@cloudera.org.
    For more options, visit https://groups.google.com/a/**
    cloudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user...@cloudera.org <javascript:>.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 6:29 am
    So now I've got python2.6 installed, the CDH/share/hue/build/env/lib still
    has python2.4 so if I do a make apps from that build directory it still
    uses 2.4, how do I get 2.6 known to hue (which I assume I need).

    thanks
       S.

    On Tuesday, 17 September 2013 16:18:51 UTC+10, Scott Hamilton wrote:


    Ah yes, it's python 2.4 on RHEL 5
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 17, 2013 at 6:31 am
    HBase app was not compatible with 2.4, there is a patch here:
    https://github.com/cloudera/hue/commit/5be3d0437fe01ab651f3e39a595f60809fe19ce0

    I am not sure about 2.4 for Search.

    When you are in the shell, you could just type:

    import simplejson as json

    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')


    About making it use 2.6, you need to do a 'make clean' before doing the
    'make apps'.

    Romain

    On Mon, Sep 16, 2013 at 11:18 PM, Scott Hamilton wrote:


    Ah yes, it's python 2.4 on RHEL 5

    # build/env/bin/hue shell
    /usr/lib64/python2.4/posixfile.py:59: DeprecationWarning: The posixfile
    module is obsolete and will disappear in the future
    DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)

    I'll try and upgrade the OS to python 2.6....
    That could explain some troubles I've been having with the HBase app on
    Hue as well....




    On Tuesday, 17 September 2013 15:45:06 UTC+10, Romain Rigaux wrote:

    This is weird. Indeed, it should load back to Json the string.

    Maybe it is Python 2.4. Could you try to type:

    cd /opt/cloudera/parcels/CDH-4.4.**0-1.cdh4.4.0.p0.39/share/hue

    $ build/env/bin/hue shell
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    Type "copyright", "credits" or "license" for more information.

    IPython 0.10 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object'. ?object also works, ?? prints more.

    In [1]:
    try:
    import json
    except ImportError:
    import simplejson as json

    In [2]: json.loads('{"responseHeader":**{"status":0,"QTime":16,"**
    params":{"facet":"false","**facet.mincount":"1","facet.**
    sort":"count","start":"0","use**r.name <http://user.name>
    ":"hue","q":"*:*","**facet.limit":"10","doAs":"**
    myusername","wt":"json","rows"**:"5"}},"response":{"numFound":**
    9031485,"start":0,"maxScore":**1.0,"docs":[]}}')
    Out[2]:
    {u'response': {u'docs': [],
    u'maxScore': 1.0,
    u'numFound': 9031485,
    u'start': 0},
    u'responseHeader': {u'QTime': 16,
    u'params': {u'doAs': u'myusername',
    ** u'facet': u'false',
    ** u'facet.limit': u'10',
    ** u'facet.mincount': u'1',
    ** u'facet.sort': u'count',
    ** u'q': u'*:*',
    ** u'rows': u'5',
    ** u'start': u'0',
    ** u'user.name': u'hue',
    ** u'wt': u'json'},
    u'status': 0}}




    On Mon, Sep 16, 2013 at 10:31 PM, Scott Hamilton wrote:

    Actually when I look closer, that code is quite different to what I see;

    def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),

    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)**s/select' %
    solr_query, params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems to
    print this out in the log, I assume it was expecting a Map/dict rather than
    String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name',
    'hue'), ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'),
    ('rows', 5), ('start', 0), ('facet', 'false'), ('facet.limit', 10),
    ('facet.mincount', 1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.
    https://github.com/cloudera/**hu**e/blob/branch-2.5-bis/apps/**sea**
    rch/src/search/api.py#L78<https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78>

    Romain


    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton <
    det.scott...@gmail.com> wrote:
    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing
    exception: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293):
    Traceback (most recent call last):
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**build/env/lib/python2.4/**site-**packages/Django-1.2.3-**
    py2.4.**egg/django/core/**handlers/base.**py", line 100, in
    get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**apps/search/src/search/**decorat**ors.py", line 35, in
    decorate
    return view_func(request, *args, **kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**apps/search/src/search/**views.**py", line 239, in
    admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_**
    query**, hue_collection)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**apps/search/src/search/**api.py"**, line 78, in query
    response = json.loads(response)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**build/env/lib/python2.4/**site-**packages/simplejson-2.0.**
    9-py2.**4-linux-x86_64.egg/**simplejson/**__init__.py", line 307,
    in loads
    return _default_decoder.decode(s)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/*
    *hue/**build/env/lib/python2.4/**site-**packages/simplejson-2.0.**
    9-py2.**4-linux-x86_64.egg/**simplejson/**decoder.py", line 338, in
    decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 -
    293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119
    {"responseHeader":{"status":0,****"QTime":16,"params":{"facet":"****
    false","facet.mincount":"1","**f**acet.sort":"count","start":"**0"**
    ,"user.name":"hue","q":"*:*"**,"**facet.limit":"10","doAs":"**myus**
    ername","wt":"json","rows"**:"5"**}},"response":{"numFound":**9031**
    485,"start":0,"maxScore":**1.0,"**docs":[]}}

    I modified api.py to dump out the response, and it looks like valid
    JSON to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to search-user...@cloudera.org.
    For more options, visit https://groups.google.com/a/**cl**
    oudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@**cloudera.org.
    For more options, visit https://groups.google.com/a/**
    cloudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 6:37 am

    # build/env/bin/hue shell
    /usr/lib64/python2.4/posixfile.py:59: DeprecationWarning: The posixfile
    module is obsolete and will disappear in the future
    DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)
    import simplejson as json

    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","user.name":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')
    {'responseHeader': {'status': 0, 'QTime': 16, 'params': {'q': '*:*',
    'facet.mincount': '1', 'facet.sort': 'count', 'facet.limit': '10', 'doAs':
    'myusername', 'facet': 'false', 'start': '0', 'wt': 'json', 'user.name':
    'hue', 'rows': '5'}}, 'response': {'start': 0, 'maxScore': 1.0, 'numFound':
    9031485, 'docs': []}}

    interesting... it doesn't give an error...
    Shall I attempt the clean,apps build, or is there something else you want
    to look at?


    S.

    On Tuesday, 17 September 2013 16:31:22 UTC+10, Romain Rigaux wrote:

    HBase app was not compatible with 2.4, there is a patch here:
    https://github.com/cloudera/hue/commit/5be3d0437fe01ab651f3e39a595f60809fe19ce0

    I am not sure about 2.4 for Search.

    When you are in the shell, you could just type:

    import simplejson as json


    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')


    About making it use 2.6, you need to do a 'make clean' before doing the
    'make apps'.

    Romain


    On Mon, Sep 16, 2013 at 11:18 PM, Scott Hamilton <det.scott...@gmail.com<javascript:>
    wrote:
    Ah yes, it's python 2.4 on RHEL 5

    # build/env/bin/hue shell
    /usr/lib64/python2.4/posixfile.py:59: DeprecationWarning: The posixfile
    module is obsolete and will disappear in the future
    DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)

    I'll try and upgrade the OS to python 2.6....
    That could explain some troubles I've been having with the HBase app on
    Hue as well....




    On Tuesday, 17 September 2013 15:45:06 UTC+10, Romain Rigaux wrote:

    This is weird. Indeed, it should load back to Json the string.

    Maybe it is Python 2.4. Could you try to type:

    cd /opt/cloudera/parcels/CDH-4.4.**0-1.cdh4.4.0.p0.39/share/hue

    $ build/env/bin/hue shell
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    Type "copyright", "credits" or "license" for more information.

    IPython 0.10 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object'. ?object also works, ?? prints more.

    In [1]:
    try:
    import json
    except ImportError:
    import simplejson as json

    In [2]: json.loads('{"responseHeader":**{"status":0,"QTime":16,"**
    params":{"facet":"false","**facet.mincount":"1","facet.**
    sort":"count","start":"0","use**r.name <http://user.name>
    ":"hue","q":"*:*","**facet.limit":"10","doAs":"**
    myusername","wt":"json","rows"**:"5"}},"response":{"numFound":**
    9031485,"start":0,"maxScore":**1.0,"docs":[]}}')
    Out[2]:
    {u'response': {u'docs': [],
    u'maxScore': 1.0,
    u'numFound': 9031485,
    u'start': 0},
    u'responseHeader': {u'QTime': 16,
    u'params': {u'doAs': u'myusername',
    ** u'facet': u'false',
    ** u'facet.limit': u'10',
    ** u'facet.mincount': u'1',
    ** u'facet.sort': u'count',
    ** u'q': u'*:*',
    ** u'rows': u'5',
    ** u'start': u'0',
    ** u'user.name': u'hue',
    ** u'wt': u'json'},
    u'status': 0}}





    On Mon, Sep 16, 2013 at 10:31 PM, Scott Hamilton <det.scott...@gmail.com
    wrote:
    Actually when I look closer, that code is quite different to what I see;

    def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),

    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)**s/select' %
    solr_query, params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems
    to print this out in the log, I assume it was expecting a Map/dict rather
    than String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name',
    'hue'), ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'),
    ('rows', 5), ('start', 0), ('facet', 'false'), ('facet.limit', 10),
    ('facet.mincount', 1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.
    https://github.com/cloudera/**hu**e/blob/branch-2.5-bis/apps/**sea**
    rch/src/search/api.py#L78<https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78>

    Romain


    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton <
    det.scott...@gmail.com> wrote:
    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing
    exception: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293):
    Traceback (most recent call last):
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**build/env/lib/python2.4/**site-**packages/Django-1.2.3-**
    py2.4.**egg/django/core/**handlers/base.**py", line 100, in
    get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**apps/search/src/search/**decorat**ors.py", line 35, in
    decorate
    return view_func(request, *args, **kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**apps/search/src/search/**views.**py", line 239, in
    admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_**
    query**, hue_collection)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**apps/search/src/search/**api.py"**, line 78, in query
    response = json.loads(response)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**build/env/lib/python2.4/**site-**packages/simplejson-2.0.**
    9-py2.**4-linux-x86_64.egg/**simplejson/**__init__.py", line 307,
    in loads
    return _default_decoder.decode(s)
    File "/opt/cloudera/parcels/CDH-4.**4**.0-1.cdh4.4.0.p0.39/share/
    **hue/**build/env/lib/python2.4/**site-**packages/simplejson-2.0.**
    9-py2.**4-linux-x86_64.egg/**simplejson/**decoder.py", line 338,
    in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5 -
    293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119
    {"responseHeader":{"status":0,****"QTime":16,"params":{"facet":"***
    *false","facet.mincount":"1","**f**acet.sort":"count","start":"**0"
    **,"user.name":"hue","q":"*:*"**,"**facet.limit":"10","doAs":"**
    myus**ername","wt":"json","rows"**:"5"**}},"response":{"numFound":*
    *9031**485,"start":0,"maxScore":**1.0,"**docs":[]}}

    I modified api.py to dump out the response, and it looks like valid
    JSON to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to search-user...@cloudera.org.
    For more options, visit https://groups.google.com/a/**cl**
    oudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@**cloudera.org.
    For more options, visit https://groups.google.com/a/**
    cloudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user...@cloudera.org <javascript:>.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 17, 2013 at 7:29 am
    I am pretty sure that you are hitting this:
    http://stackoverflow.com/questions/7512934/simplejson-in-python-throws-value-error

    I think the best would be to try to cleanup the string just before loading
    it
    https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L79
    .

    Could you do:
    LOG.info(repr(response))
    ?

    Then try a replace if something shows up?

    Romain



    On Mon, Sep 16, 2013 at 11:37 PM, Scott Hamilton wrote:

    # build/env/bin/hue shell
    /usr/lib64/python2.4/posixfile.py:59: DeprecationWarning: The posixfile
    module is obsolete and will disappear in the future
    DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)
    import simplejson as json

    json.loads('{"responseHeader":{"status":0,"QTime":16,"params":{"facet":"false","facet.mincount":"1","facet.sort":"count","start":"0","
    user.name
    ":"hue","q":"*:*","facet.limit":"10","doAs":"myusername","wt":"json","rows":"5"}},"response":{"numFound":9031485,"start":0,"maxScore":1.0,"docs":[]}}')
    {'responseHeader': {'status': 0, 'QTime': 16, 'params': {'q': '*:*',
    'facet.mincount': '1', 'facet.sort': 'count', 'facet.limit': '10', 'doAs':
    'myusername', 'facet': 'false', 'start': '0', 'wt': 'json', 'user.name':
    'hue', 'rows': '5'}}, 'response': {'start': 0, 'maxScore': 1.0, 'numFound':
    9031485, 'docs': []}}

    interesting... it doesn't give an error...
    Shall I attempt the clean,apps build, or is there something else you want
    to look at?


    S.

    On Tuesday, 17 September 2013 16:31:22 UTC+10, Romain Rigaux wrote:

    HBase app was not compatible with 2.4, there is a patch here:
    https://github.com/cloudera/**hue/commit/**5be3d0437fe01ab651f3e39a595f60
    **809fe19ce0<https://github.com/cloudera/hue/commit/5be3d0437fe01ab651f3e39a595f60809fe19ce0>

    I am not sure about 2.4 for Search.

    When you are in the shell, you could just type:

    import simplejson as json

    json.loads('{"responseHeader":**{"status":0,"QTime":16,"**
    params":{"facet":"false","**facet.mincount":"1","facet.**
    sort":"count","start":"0","use**r.name <http://user.name>
    ":"hue","q":"*:*","**facet.limit":"10","doAs":"**
    myusername","wt":"json","rows"**:"5"}},"response":{"numFound":**
    9031485,"start":0,"maxScore":**1.0,"docs":[]}}')


    About making it use 2.6, you need to do a 'make clean' before doing the
    'make apps'.

    Romain

    On Mon, Sep 16, 2013 at 11:18 PM, Scott Hamilton wrote:


    Ah yes, it's python 2.4 on RHEL 5

    # build/env/bin/hue shell
    /usr/lib64/python2.4/**posixfile.py:59: DeprecationWarning: The
    posixfile module is obsolete and will disappear in the future
    DeprecationWarning)
    Python 2.4.3 (#1, May 1 2012, 13:55:48)
    [GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    (InteractiveConsole)

    I'll try and upgrade the OS to python 2.6....
    That could explain some troubles I've been having with the HBase app on
    Hue as well....




    On Tuesday, 17 September 2013 15:45:06 UTC+10, Romain Rigaux wrote:

    This is weird. Indeed, it should load back to Json the string.

    Maybe it is Python 2.4. Could you try to type:

    cd /opt/cloudera/parcels/CDH-4.4.****0-1.cdh4.4.0.p0.39/share/hue

    $ build/env/bin/hue shell
    Python 2.7.3 (default, Apr 10 2013, 06:20:15)
    Type "copyright", "credits" or "license" for more information.

    IPython 0.10 -- An enhanced Interactive Python.
    ? -> Introduction and overview of IPython's features.
    %quickref -> Quick reference.
    help -> Python's own help system.
    object? -> Details about 'object'. ?object also works, ?? prints more.

    In [1]:
    try:
    import json
    except ImportError:
    import simplejson as json

    In [2]: json.loads('{"responseHeader":****{"status":0,"QTime":16,"**
    params**":{"facet":"false","**facet.**mincount":"1","facet.**sort":"**
    count","start":"0","use**r.name <http://user.name>"**:"hue","q":"*:*","
    **facet.limit"**:"10","doAs":"**myusername","wt"**:"json","rows"**
    :"5"}},"**response":{"numFound":**9031485,**"start":0,"maxScore":**
    1.0,"**docs":[]}}')
    Out[2]:
    {u'response': {u'docs': [],
    u'maxScore': 1.0,
    u'numFound': 9031485,
    u'start': 0},
    u'responseHeader': {u'QTime': 16,
    u'params': {u'doAs': u'myusername',
    **** u'facet': u'false',
    **** u'facet.limit': u'10',
    **** u'facet.mincount': u'1',
    **** u'facet.sort': u'count',
    **** u'q': u'*:*',
    **** u'rows': u'5',
    **** u'start': u'0',
    **** u'user.name': u'hue',
    **** u'wt': u'json'},
    u'status': 0}}





    On Mon, Sep 16, 2013 at 10:31 PM, Scott Hamilton <
    det.scott...@gmail.com> wrote:
    Actually when I look closer, that code is quite different to what I
    see;

    def query(self, solr_query, hue_core):
    try:
    params = self._get_params() + (
    ('q', solr_query['q'] or EMPTY_QUERY.get()),

    ('wt', 'json'),
    ('rows', solr_query['rows']),
    ('start', solr_query['start']),
    )
    params += hue_core.get_query(solr_query)
    fqs = solr_query['fq'].split('|')
    for fq in fqs:
    if fq:
    params += (('fq', fq),)

    response = self._root.get('%(collection)**s**/select' %
    solr_query, params)
    LOG.info(params)
    LOG.info(type(response))
    if type(response) != dict:
    # Got 'plain/text' mimetype instead of 'application/json'
    LOG.info(response)
    response = json.loads(response)
    return response
    except RestException, e:
    raise PopupException('Error while accessing Solr: %s' % e)





    On Tuesday, 17 September 2013 15:26:44 UTC+10, Scott Hamilton wrote:

    Hi ya Roman,

    I'm not a python developer, I just took a guess at the syntax, seems
    to print this out in the log, I assume it was expecting a Map/dict rather
    than String;

    [17/Sep/2013 15:24:33 +0000] api INFO <type 'str'>
    [17/Sep/2013 15:24:33 +0000] api INFO (('user.name',
    'hue'), ('doAs', <User: myusername>), ('q', '*:*'), ('wt', 'json'),
    ('rows', 5), ('start', 0), ('facet', 'false'), ('facet.limit', 10),
    ('facet.mincount', 1), ('facet.sort', u'count'))
    On Tuesday, 17 September 2013 15:09:43 UTC+10, Romain Rigaux wrote:

    Could you print the type of the response too?

    e.g.
    https://github.com/cloudera/**hu****e/blob/branch-2.5-bis/apps/**sea
    ****rch/src/search/api.py#L78<https://github.com/cloudera/hue/blob/branch-2.5-bis/apps/search/src/search/api.py#L78>

    Romain


    On Mon, Sep 16, 2013 at 9:40 PM, Scott Hamilton <
    det.scott...@gmail.com> wrote:
    I created a new Solr collection and can perform queries from the
    SolrAdmin, however the Hue Search app fails.

    [17/Sep/2013 14:17:58 +0000] middleware INFO Processing
    exception: Extra data: line 2 column 1 - line 6 column 1 (char 5 - 293):
    Traceback (most recent call last):
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****build/env/lib/python2.4/**
    site-**p**ackages/Django-1.2.3-**py2.4.**egg**/django/core/**
    handlers/base.**py"**, line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****apps/search/src/search/**
    decorat****ors.py", line 35, in decorate
    return view_func(request, *args, **kwargs)
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****apps/search/src/search/**
    views.**p**y", line 239, in admin_collection_template
    response = SolrApi(SOLR_URL.get(), request.user).query(solr_**
    query****, hue_collection)
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****apps/search/src/search/**
    api.py"****, line 78, in query
    response = json.loads(response)
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****build/env/lib/python2.4/**
    site-**p**ackages/simplejson-2.0.**9-py2.**4**-linux-x86_64.egg/**
    simplejson/**_**_init__.py", line 307, in loads
    return _default_decoder.decode(s)
    File "/opt/cloudera/parcels/CDH-4.**4****
    .0-1.cdh4.4.0.p0.39/share/**hue/****build/env/lib/python2.4/**
    site-**p**ackages/simplejson-2.0.**9-py2.**4**-linux-x86_64.egg/**
    simplejson/**d**ecoder.py", line 338, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
    ValueError: Extra data: line 2 column 1 - line 6 column 1 (char 5
    - 293)
    [17/Sep/2013 14:17:58 +0000] api INFO 119
    {"responseHeader":{"status":0,******"QTime":16,"params":{"facet":"
    ******false","facet.mincount":"1","**f****
    acet.sort":"count","start":"**0"****,"user.name":"hue","q":"*:*"**
    ,"****facet.limit":"10","doAs":"**myus****
    ername","wt":"json","rows"**:"5"****}},"response":{"numFound":**
    9031****485,"start":0,"maxScore":**1.0,"****docs":[]}}

    I modified api.py to dump out the response, and it looks like valid
    JSON to my eye. Anyone else seeing anything like this?


    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to search-user...@cloudera.org.
    For more options, visit https://groups.google.com/a/**cl****
    oudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@**cloudera.org.
    For more options, visit https://groups.google.com/a/**cl**
    oudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google
    Groups "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to search-user...@**cloudera.org.
    For more options, visit https://groups.google.com/a/**
    cloudera.org/groups/opt_out<https://groups.google.com/a/cloudera.org/groups/opt_out>
    .
    --
    You received this message because you are subscribed to the Google Groups
    "Search User" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to search-user+unsubscribe@cloudera.org.
    For more options, visit
    https://groups.google.com/a/cloudera.org/groups/opt_out.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 7:52 am
    Ooops I seemed to have trashed it.. I stopped the hue Service in CM, and
    now when attempting to start it I get;

    + echo Executing
    /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/bin/hue
    beeswax_server
    + exec
    /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/bin/hue
    beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should redeploy
    everything?

    S.

    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Scott Hamilton at Sep 17, 2013 at 9:11 am
    I rebuilt it from the git source, nice new interface, took awhile to get
    all the dependencies in place, now just needs to be reconfigured it, and
    the beeswax_server still isn't there, but that might just be configuration
    also.
    At least it fixed the HBase and Search apps, they both work fine now, using
    the new source and python 2.6


    cheers
        S.

    On Tuesday, 17 September 2013 17:52:56 UTC+10, Scott Hamilton wrote:


    Ooops I seemed to have trashed it.. I stopped the hue Service in CM, and
    now when attempting to start it I get;

    + echo Executing
    /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/bin/hue
    beeswax_server
    + exec
    /opt/cloudera/parcels/CDH-4.4.0-1.cdh4.4.0.p0.39/share/hue/build/env/bin/hue
    beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should
    redeploy everything?

    S.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 17, 2013 at 8:43 pm
    Beeswaxd does not exist anymore in Hue 3, it is replaced by HiveServer2. I
    kind of recommend to go back to CDH4.4 if you are planning to use Hive (or
    2.5-bis branch, which is the last stable release
    https://github.com/cloudera/hue/tree/branch-2.5-bis).

    About fixing Search, if you give use the output of:

    LOG.info(repr(response))

    I could put a fix on https://issues.cloudera.org/browse/HUE-1577

    Romain


    On Tue, Sep 17, 2013 at 2:11 AM, Scott Hamilton wrote:


    I rebuilt it from the git source, nice new interface, took awhile to get
    all the dependencies in place, now just needs to be reconfigured it, and
    the beeswax_server still isn't there, but that might just be configuration
    also.
    At least it fixed the HBase and Search apps, they both work fine now,
    using the new source and python 2.6


    cheers
    S.

    On Tuesday, 17 September 2013 17:52:56 UTC+10, Scott Hamilton wrote:


    Ooops I seemed to have trashed it.. I stopped the hue Service in CM, and
    now when attempting to start it I get;

    + echo Executing /opt/cloudera/parcels/CDH-4.4.**
    0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue beeswax_server
    + exec /opt/cloudera/parcels/CDH-4.4.**0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue
    beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should
    redeploy everything?

    S.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to hue-user+unsubscribe@cloudera.org.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 17, 2013 at 9:17 pm
    I would replace the code by this and check:

           if type(response) != dict:
             # Got 'plain/text' mimetype instead of 'application/json'
             try:
               response = json.loads(response)
             except ValueError, e:
               # Got some null bytes in the response
               LOG.error('%s: %s' % (unicode(e), repr(response)))
               response = json.loads(response.replace('\x00', ''))
           return response

    Romain
    On Tue, Sep 17, 2013 at 1:43 PM, Romain Rigaux wrote:

    Beeswaxd does not exist anymore in Hue 3, it is replaced by HiveServer2. I
    kind of recommend to go back to CDH4.4 if you are planning to use Hive (or
    2.5-bis branch, which is the last stable release
    https://github.com/cloudera/hue/tree/branch-2.5-bis).

    About fixing Search, if you give use the output of:

    LOG.info(repr(response))

    I could put a fix on https://issues.cloudera.org/browse/HUE-1577

    Romain



    On Tue, Sep 17, 2013 at 2:11 AM, Scott Hamilton <
    det.scott.hamilton@gmail.com> wrote:
    I rebuilt it from the git source, nice new interface, took awhile to get
    all the dependencies in place, now just needs to be reconfigured it, and
    the beeswax_server still isn't there, but that might just be configuration
    also.
    At least it fixed the HBase and Search apps, they both work fine now,
    using the new source and python 2.6


    cheers
    S.

    On Tuesday, 17 September 2013 17:52:56 UTC+10, Scott Hamilton wrote:


    Ooops I seemed to have trashed it.. I stopped the hue Service in CM, and
    now when attempting to start it I get;

    + echo Executing /opt/cloudera/parcels/CDH-4.4.**
    0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue beeswax_server
    + exec /opt/cloudera/parcels/CDH-4.4.**0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue
    beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should
    redeploy everything?

    S.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to hue-user+unsubscribe@cloudera.org.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Suhas Satish at Sep 18, 2013 at 9:02 pm
    2.5-bis - when was the release GA date?

    On Tuesday, September 17, 2013 1:43:33 PM UTC-7, Romain Rigaux wrote:

    Beeswaxd does not exist anymore in Hue 3, it is replaced by HiveServer2. I
    kind of recommend to go back to CDH4.4 if you are planning to use Hive (or
    2.5-bis branch, which is the last stable release
    https://github.com/cloudera/hue/tree/branch-2.5-bis).

    About fixing Search, if you give use the output of:

    LOG.info(repr(response))

    I could put a fix on https://issues.cloudera.org/browse/HUE-1577

    Romain



    On Tue, Sep 17, 2013 at 2:11 AM, Scott Hamilton <det.scott...@gmail.com<javascript:>
    wrote:
    I rebuilt it from the git source, nice new interface, took awhile to get
    all the dependencies in place, now just needs to be reconfigured it, and
    the beeswax_server still isn't there, but that might just be configuration
    also.
    At least it fixed the HBase and Search apps, they both work fine now,
    using the new source and python 2.6


    cheers
    S.

    On Tuesday, 17 September 2013 17:52:56 UTC+10, Scott Hamilton wrote:


    Ooops I seemed to have trashed it.. I stopped the hue Service in CM, and
    now when attempting to start it I get;

    + echo Executing /opt/cloudera/parcels/CDH-4.4.**
    0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue beeswax_server
    + exec /opt/cloudera/parcels/CDH-4.4.**0-1.cdh4.4.0.p0.39/share/hue/**build/env/bin/hue
    beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should
    redeploy everything?

    S.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to hue-user+u...@cloudera.org <javascript:>.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.
  • Romain Rigaux at Sep 18, 2013 at 11:56 pm
    2.5-bis was a utility branch, not an official release. 2.5-bis is close to
    CDH4.4 (released at the beginning of this month).

    Romain

    On Wed, Sep 18, 2013 at 2:02 PM, Suhas Satish wrote:

    2.5-bis - when was the release GA date?

    On Tuesday, September 17, 2013 1:43:33 PM UTC-7, Romain Rigaux wrote:

    Beeswaxd does not exist anymore in Hue 3, it is replaced by HiveServer2.
    I kind of recommend to go back to CDH4.4 if you are planning to use Hive
    (or 2.5-bis branch, which is the last stable release
    https://github.com/cloudera/**hue/tree/branch-2.5-bis<https://github.com/cloudera/hue/tree/branch-2.5-bis>
    ).

    About fixing Search, if you give use the output of:

    LOG.info(repr(response))

    I could put a fix on https://issues.cloudera.org/**browse/HUE-1577<https://issues.cloudera.org/browse/HUE-1577>

    Romain


    On Tue, Sep 17, 2013 at 2:11 AM, Scott Hamilton wrote:


    I rebuilt it from the git source, nice new interface, took awhile to get
    all the dependencies in place, now just needs to be reconfigured it, and
    the beeswax_server still isn't there, but that might just be configuration
    also.
    At least it fixed the HBase and Search apps, they both work fine now,
    using the new source and python 2.6


    cheers
    S.

    On Tuesday, 17 September 2013 17:52:56 UTC+10, Scott Hamilton wrote:


    Ooops I seemed to have trashed it.. I stopped the hue Service in CM,
    and now when attempting to start it I get;

    + echo Executing /opt/cloudera/parcels/CDH-4.4.****
    0-1.cdh4.4.0.p0.39/share/hue/**b**uild/env/bin/hue beeswax_server
    + exec /opt/cloudera/parcels/CDH-4.4.****0-1.cdh4.4.0.p0.39/share/hue/
    **b**uild/env/bin/hue beeswax_server
    Unknown command: 'beeswax_server'
    Type 'hue help' for usage.

    If I remove it and add it back as a new Service in CM, that should
    redeploy everything?

    S.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to hue-user+u...@cloudera.**org.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to hue-user+unsubscribe@cloudera.org.
    To unsubscribe from this group and stop receiving emails from it, send an email to hue-user+unsubscribe@cloudera.org.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouphue-user @
categorieshadoop
postedSep 17, '13 at 5:10a
activeSep 18, '13 at 11:56p
posts15
users3
websitecloudera.com
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase