search query * -> 'ascii' codec can't encode character u'\xae' in position 3739: ordinal not in range(128)

Bug #1558757 reported by Travis Tripp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-searchlightclient
Invalid
Undecided
Steve McLellan

Bug Description

tripp@ubuntu:/opt/stack/swift$ openstack search query "*"

'ascii' codec can't encode character u'\xae' in position 3739: ordinal not in range(128)

ttripp@ubuntu:/opt/stack/swift$ openstack search query *
usage: openstack search query [-h] [-f {csv,json,table,value,yaml}]
                              [-c COLUMN] [--max-width <integer>] [--noindent]
                              [--quote {all,minimal,none,nonnumeric}] [--json]
                              [--type [<resource-type> [<resource-type> ...]]]
                              [--all-projects] [--source [[<field>,...]]]
                              <query>
openstack search query: error: unrecognized arguments: CHANGELOG CONTRIBUTING.md LICENSE MANIFEST.in README.md babel.cfg bandit.yaml bin doc etc examples requirements.txt setup.cfg setup.py swift swift.egg-info test test-requirements.txt tox.ini
ttripp@ubuntu:/opt/stack/swift$ openstack

(openstack) search query *
'ascii' codec can't encode character u'\xae' in position 3739: ordinal not in range(128)

(openstack) search query "*"
'ascii' codec can't encode character u'\xae' in position 3739: ordinal not in range(128)

(openstack) search query cirros
+--------------------------------------+---------------------------------+------------+-------------------+----------------------+
| ID | Name | Score | Type | Updated |
+--------------------------------------+---------------------------------+------------+-------------------+----------------------+
| 6d1b3cb3-c0fa-44b6-9cad-261f046ae311 | cirros-0.3.3-x86_64-disk | 0.8837948 | OS::Glance::Image | 2016-03-17T18:46:33Z |
| 3fae102d-1b1a-44c5-b9c6-6b1d473973ea | cirros-0.3.4-x86_64-uec-ramdisk | 0.76434696 | OS::Glance::Image | 2016-03-17T18:46:49Z |
| 03d2b846-f273-4891-acd3-cba21eb003b7 | cirros-0.3.4-x86_64-uec-kernel | 0.70952487 | OS::Glance::Image | 2016-03-17T18:46:47Z |
| 6f9e02da-da9e-402b-bcdc-9369a32c7dbf | cirros-0.3.4-x86_64-uec | 0.5477384 | OS::Glance::Image | 2016-03-17T18:46:50Z |
+--------------------------------------+---------------------------------+------------+-------------------+----------------------+

Revision history for this message
Steve McLellan (sjmc7) wrote :

\xae is the 'reserved' character. Hopefully this is happening during the table rendering and should be easy to fix.

Revision history for this message
Steve McLellan (sjmc7) wrote :

Could this be your terminal settings? This works ok for me:

* create a server with the name 'test ®'
* check it's indexed properly

Run a search:

  openstack search query '*' --type OS::Nova::Server

Check that you've got the LANG environment variable set properly - if it's not, try

  export LANG=en_US.UTF-8

Steve McLellan (sjmc7)
Changed in python-searchlightclient:
assignee: nobody → Steve McLellan (sjmc7)
Revision history for this message
Travis Tripp (travis-tripp) wrote :

I found something interesting. When you source devstack/openrc, it resets your lang.

ttripp@ubuntu:~$ echo $LANG
en_US.UTF-8

ttripp@ubuntu:~$ source ~/devstack/openrc admin demo

ttripp@ubuntu:~$ echo $LANG

ttripp@ubuntu:~$

Revision history for this message
Steve McLellan (sjmc7) wrote :

Looks like this condition exists in openstackclient. 'openstack server list' will ALSO raise an error if the console's not set right.

On a devstack machine, you'll need to do:

  export LANG=en_US.UTF-8
  unset LC_ALL

Then openstackclient commands will work. I think we should close this as invalid, though perhaps add to the documentation somewhere.

Steve McLellan (sjmc7)
Changed in python-searchlightclient:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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