azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

'az find' always gives error (MacOS)

Open amit-kumar-4 opened this issue 8 years ago • 5 comments


Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows) :

Installed using Brew on MacOS 10.12.6 Shell: Bash and Zsh

azure-cli (2.0.27)

acr (2.0.21)
acs (2.0.26)
advisor (0.1.2)
appservice (0.1.26)
backup (1.0.6)
batch (3.1.10)
batchai (0.1.5)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.10)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.1)
container (0.1.18)
core (2.0.27)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.19)
eventgrid (0.1.10)
extension (0.0.9)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.16)
iot (0.1.17)
keyvault (2.0.18)
lab (0.0.17)
monitor (0.1.2)
network (2.0.23)
nspkg (3.0.1)
profile (2.0.19)
rdbms (0.0.12)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.23)
role (2.0.19)
servicefabric (0.0.10)
sql (2.0.21)
storage (2.0.25)
vm (2.0.26)

Python location '/usr/local/opt/python3/bin/python3.6'
Extensions directory '/Users/aku105/.azure/cliextensions'

Python (Darwin) 3.6.4 (default, Jan  6 2018, 11:51:15)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

Legal docs and information: aka.ms/AzureCliLegal

az find command with any search string (using either -q or --search-query parameters) fails with below error:

'ascii' codec can't decode byte 0x80 in position 4: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/knack/cli.py", line 194, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in execute
    six.reraise(*sys.exc_info())
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 304, in execute
    result = cmd(params)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 168, in __call__
    return super(AzCliCommand, self).__call__(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/knack/commands.py", line 109, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 348, in default_command_handler
    result = op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/azure/cli/command_modules/find/custom.py", line 112, in find
    results = searcher.search(q)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/searching.py", line 786, in search
    self.search_with_collector(q, c)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/searching.py", line 819, in search_with_collector
    collector.run()
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/collectors.py", line 143, in run
    self.set_subsearcher(subsearcher, offset)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/collectors.py", line 171, in set_subsearcher
    self.matcher = self.q.matcher(subsearcher, self.context)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/query/compound.py", line 211, in matcher
    m = self._matcher(subs, searcher, context)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/query/compound.py", line 369, in _matcher
    scale=self.scale).matcher(searcher, context)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/query/compound.py", line 211, in matcher
    m = self._matcher(subs, searcher, context)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/query/compound.py", line 451, in _matcher
    scored=scored)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/matching/combo.py", line 183, in __init__
    self._docnum = self._min_id()
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/matching/combo.py", line 194, in _min_id
    return min(subm.id() for subm in active)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/matching/combo.py", line 194, in <genexpr>
    return min(subm.id() for subm in active)
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/codec/whoosh3.py", line 980, in id
    self._read_ids()
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/codec/whoosh3.py", line 1082, in _read_ids
    self._read_data()
  File "/usr/local/Cellar/azure-cli/2.0.27/libexec/lib/python3.6/site-packages/whoosh/codec/whoosh3.py", line 1077, in _read_data
    self._data = loads(b)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 4: ordinal not in range(128)

amit-kumar-4 avatar Feb 14 '18 12:02 amit-kumar-4

What query string are you using? I cannot reproduce this on my MacBook.

tjprescott avatar Feb 14 '18 19:02 tjprescott

Any search string. For instance, I just tried az find -q redis and az find -q kubernetes and both gave me the same error.

amit-kumar-4 avatar Feb 15 '18 09:02 amit-kumar-4

add to S165.

yonzhan avatar Dec 22 '19 12:12 yonzhan

@aku105 Could you please install the latest version of azure-cli(2.0.81) and try using az find "redis" to solve your problem? If you still hava some problems, please feel free to let us know.

zhoxing-ms avatar Feb 11 '20 06:02 zhoxing-ms

Yeah, this seems to be working for me now. Tried multiple search strings and I got no errors this time around.

amit-kumar-4 avatar Feb 11 '20 10:02 amit-kumar-4