weaviate / weaviate-cli

CLI tool for Weaviate
https://weaviate.io/developers/weaviate/client-libraries/cli
BSD 3-Clause "New" or "Revised" License
11 stars 11 forks source link

[critical] "weaviate.exceptions.MissingScopeException" on every command #61

Open dandv opened 1 year ago

dandv commented 1 year ago

I get the error below on every weaviate command, including weaviate version:

Traceback (most recent call last):
  File "/home/dandv/.local/bin/weaviate", line 8, in <module>
    sys.exit(main())
  File "/home/dandv/.local/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/dandv/.local/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/dandv/.local/lib/python3.10/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/home/dandv/.local/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/dandv/.local/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/dandv/.local/lib/python3.10/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/dandv/.local/lib/python3.10/site-packages/cli.py", line 14, in main
    "config": Configuration(config_file)
  File "/home/dandv/.local/lib/python3.10/site-packages/semi/config/configuration.py", line 41, in __init__
    self.client = _create_client_from_config(self.config)
  File "/home/dandv/.local/lib/python3.10/site-packages/semi/config/configuration.py", line 81, in _create_client_from_config
    return weaviate.Client(config["url"], cred)
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/client.py", line 146, in __init__
    self._connection = Connection(
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/connect/connection.py", line 584, in __init__
    super().__init__(
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/connect/connection.py", line 117, in __init__
    self._create_session(auth_client_secret)
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/connect/connection.py", line 159, in _create_session
    self._session = _auth.get_auth_session()
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/connect/authentication.py", line 69, in get_auth_session
    session = self._get_session_client_credential(self._credentials)
  File "/home/dandv/.local/lib/python3.10/site-packages/weaviate/connect/authentication.py", line 120, in _get_session_client_credential
    raise MissingScopeException
weaviate.exceptions.MissingScopeException

This happened after pip install weaviate-cli followed by weaviate version, which claimed "Config creation was complete":

No config was found, creating a new one.
Please give a weaviate url: https://shower-thoughts-osv1ce32.weaviate.network
Please choose:
1) No authentication
2) Client secret
3) Username and password
Enter number: 2
Please specify the client secret: 
Config creation complete

Traceback (most recent call last):
...
weaviate.exceptions.MissingScopeException
dandv commented 1 year ago

Breakage still present in v2.2.0, albeit in a different form - #64.

cakesoft-chaitanya commented 1 year ago

Facing same issue.

othersideofphase commented 1 year ago

I just installed the cli today to test on an M2 Mac running 13.5.2 (22G91) and have the same issue, although my config is defined correctly:

Note that I also encountered the issue in #64 but manually creating the directory was a workaround until that fix is released.

$ weaviate version
2.2.0

$ weaviate config view
{
    "url": "https://{sub-domain}.weaviate.network",
    "auth": {
        "type": "client_secret",
        "secret": "{secret-key}"
    }
}

$ weaviate ping
Traceback (most recent call last):
  File "/opt/homebrew/bin/weaviate", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/semi/misc.py", line 21, in main_ping
    ping(get_client_from_context(ctx))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/semi/utils.py", line 16, in get_client_from_context
    return ctx.obj["config"].get_client()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/semi/config/commands.py", line 103, in get_client
    return weaviate.Client(self.config["url"], cred)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/weaviate/client.py", line 150, in __init__
    self._connection = Connection(
                       ^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/weaviate/connect/connection.py", line 165, in __init__
    self._create_session(auth_client_secret)
  File "/opt/homebrew/lib/python3.11/site-packages/weaviate/connect/connection.py", line 222, in _create_session
    self._session = _auth.get_auth_session()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/weaviate/connect/authentication.py", line 76, in get_auth_session
    session = self._get_session_client_credential(self._credentials)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/weaviate/connect/authentication.py", line 127, in _get_session_client_credential
    raise MissingScopeException
weaviate.exceptions.MissingScopeException