chessli icon indicating copy to clipboard operation
chessli copied to clipboard

Error: Missing key store

Open tiggeymone opened this issue 3 years ago • 13 comments

Hello, thank you for this app. It is exactly what I was searching for and I was excited to test it.

Unfortunately, after installing and configuring the app following the installation instructions I'm stuck with the following error: File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 470, in _get_node raise ConfigKeyError(f"Missing key {key}") omegaconf.errors.ConfigAttributeError: Missing key store.

The show-configs command for my user ouputs the following configuration:

INFO     General Config                                    main.py:88
INFO     {'user': 'Myusername', 'token':          main.py:89
              'mytoken'}
INFO     User Games Config                             main.py:90
INFO     {}                                                           main.py:91
INFO     User Openings Config                         main.py:92
INFO     {}    

What am I missing?

Thank you in advance for your patience.

tiggeymone avatar May 08 '22 16:05 tiggeymone

I did the procedures as indicated in the instructions, but after listing the openings I get this error

`C:\Users\Gabriel>chessli openings ankify --since last-week 🔥 CHESSLI OPENINGS 🔥

[09:28:13] Fetching games of Gabrielzx. games.py:66 Traceback (most recent call last): File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\Scripts\chessli.exe_main.py", line 7, in File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\typer\main.py", line 214, in call return get_command(self)(*args, **kwargs) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 829, in call return self.main(*args, **kwargs) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 782, in main rv = self.invoke(ctx) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 610, in invoke return callback(*args, **kwargs) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\typer\main.py", line 497, in wrapper return callback(**use_params) # type: ignore File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\chessli\cli\openings.py", line 76, in ankify games = GamesFetcher(chessli_paths, cli_config).fetch_games() File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\chessli\games.py", line 114, in fetch_games if self.config.store: File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 357, in getattr self._format_and_raise( File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\base.py", line 231, in _format_and_raise format_and_raise( File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf_utils.py", line 873, in format_and_raise _raise(ex, cause) File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf_utils.py", line 771, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 353, in getattr return self._get_impl( File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 444, in _get_impl node = self._get_child( File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\basecontainer.py", line 73, in _get_child child = self._get_node( File "C:\Users\Gabriel\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 482, in _get_node raise ConfigKeyError(f"Missing key {key!s}") omegaconf.errors.ConfigAttributeError: Missing key store full_key: store object_type=dict

gabrielrjzx avatar Jul 25 '22 12:07 gabrielrjzx

Same-ish issue here

  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\Scripts\chessli.exe\__main__.py", line 4, in <module>
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\chessli\__init__.py", line 137, in <module>
    berserk_client = get_berserk_client(main_config.token)
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\base.py", line 231, in _format_and_raise
    format_and_raise(
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\_utils.py", line 900, in format_and_raise
    _raise(ex, cause)
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\_utils.py", line 798, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "C:\Users\eminent\AppData\Local\Programs\Python\Python310\lib\site-packages\omegaconf\dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key token
    full_key: token
    object_type=dict

cademcniven avatar Oct 01 '22 18:10 cademcniven

Any solution yet, I have the same problem with Python Python 3.10.1. Knd regards

problemadder avatar Oct 31 '22 09:10 problemadder

I ran into the same issue on Linux with the same config posted above. Python 3.10.8, pip 22.3.1

Traceback (most recent call last):
  File "/home/aa0/.local/bin/chessli", line 8, in <module>
    sys.exit(app())
  File "/home/aa0/.local/lib/python3.10/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aa0/.local/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/aa0/.local/lib/python3.10/site-packages/typer/main.py", line 497, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/aa0/.local/lib/python3.10/site-packages/chessli/cli/openings.py", line 76, in ankify
    games = GamesFetcher(chessli_paths, cli_config).fetch_games()
  File "/home/aa0/.local/lib/python3.10/site-packages/chessli/games.py", line 114, in fetch_games
    if self.config.store:
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 357, in __getattr__
    self._format_and_raise(
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/_utils.py", line 873, in format_and_raise
    _raise(ex, cause)
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/_utils.py", line 771, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 353, in __getattr__
    return self._get_impl(
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 444, in _get_impl
    node = self._get_child(
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/home/aa0/.local/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 482, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key store
    full_key: store
    object_type=dict

Ahmad-A0 avatar Nov 14 '22 21:11 Ahmad-A0

Hey all,

sorry for the undescriptive error message. If I find some time in the future, I will improve upon the user experience.

Until then, can you please check if the errors persist if you follow the instructions here:

How to set up chessli - Chessli

So in short, you need to

  1. Get an API key from lichess: Lichess API authentification
  2. Add this API key and your user name in the general config file:

In my case, the config file is located at: /home/pwenker/.config/chessli/config.yml

And it has the following content:

user: pwenker
token: <Lichess API key> 

(of course with <lichess API key> replaced by the actual token).

pwenker avatar Nov 15 '22 10:11 pwenker

I appreciate the help! On Mac I cant find a "chessli/config.yml" file after installing with the terminal app. I anybody has success. Please share the knowledge.

problemadder avatar Nov 15 '22 18:11 problemadder

I appreciate the help! On Mac I cant find a "chessli/config.yml" file after installing with the terminal app. I anybody has success. Please share the knowledge.

On Mac it should be at ~/Library/Preferences/chessli/. Can you verify?

pwenker avatar Nov 19 '22 09:11 pwenker

Cant verify. No Chessli folder, after "pip install chessli" only message: Requirement already satisfied: ... Searched the whole filesystem even hidden files.

problemadder avatar Nov 19 '22 17:11 problemadder

Sorry, unfortunately I do not own a Mac, so I cannot debug it on my side. Could you try creating a config.yml file yourself inside ~/Library/Preferences/chessli/ and then enter the user name and credentials as described above and see if it works out?

pwenker avatar Nov 20 '22 15:11 pwenker

I tried it with no success. So if there is anybody using mac. hints would be great. @pwenker thanks for your help again

problemadder avatar Nov 30 '22 19:11 problemadder

In a mac, the file is located at ~/Library/Application Support/chessli/ Here you can find the list of directories for each operating system (chessli uses appdirs to choose the directory): https://pypi.org/project/appdirs/ Note also that it you run the program without setting the configuration, it seems to generate an empty file. So you can always run it and search for a folder called chessli within your home.

jmones avatar Jan 30 '23 19:01 jmones

I experience the same thing as @gabrielrjzx

First solved the issue with full_key: token described by @cademcniven by adding the config.yml with user and token.

Now I get the issue with full_key: store described by @gabrielrjzx when trying to use the ankify command (but not fetch). Could it be the problem in the following parameter being defined for fetch but not for ankify ? https://github.com/pwenker/chessli/blob/a3fdbc828e33ced5e25fbd7599be06dc4a46a0ab/chessli/cli/games.py#L60

jmones avatar Jan 30 '23 21:01 jmones

I've made a pull request to fix the issue.

It looks like you were right, if you add store: bool = typer.Option(False, help="Select if fetched games should be stored"), to

@app.command()
def ankify(

then it works.

For anyone wanting to manually do it:

  1. Call pip show chessli. Under Location: this will show the install location of chessi e.g. /usr/lib/python3/dist-packages or /home/user/projects/chessli/venv/lib/python3.10/site-packages.
  2. Open up chessli/cli/games.py (so /usr/lib/python3/dist-packages/chessli/cli/games.py in above example)
  3. Add store: bool = typer.Option(False, help="Select if fetched games should be stored"), to function (becomes line 96 so call is:
def ankify(
    ctx: typer.Context,
    new_games_only: bool = typer.Option(
        True, help="Fetch new games and only ankify those"
    ),
    since_enum: SinceEnum = typer.Option(
        SinceEnum.last_time,
        "--since",
        help="Filter fetching of games to those played since `since`",
        callback=since_callback,
    ),
    max: Optional[int] = typer.Option(30, help="Limit fetching of games to `max`",),
    perf_type: Optional[List[PerfType]] = typer.Option(
        None, help="Filter fetching of games to the selected `perf_types`"
    ),
    export_only: bool = typer.Option(
        True,
        "--export-only/--directly",
        help="Select to only export the created anki cards",
    ),
    store: bool = typer.Option(False, help="Select if fetched games should be stored"),
):

fionn-r avatar Mar 06 '23 12:03 fionn-r

@fionn-r

FYI, I tried your code edit suggestion; I still get same error...

snorkelbuckle avatar May 02 '24 02:05 snorkelbuckle

@snorkelbuckle: I am drafting a new version that's easier to use over at https://github.com/pwenker/chessli2 That should fix everything involving this issue.

pwenker avatar May 05 '24 08:05 pwenker