Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Missing key store #24

Closed
tiggeymone opened this issue May 8, 2022 · 15 comments
Closed

Error: Missing key store #24

tiggeymone opened this issue May 8, 2022 · 15 comments

Comments

@tiggeymone
Copy link

tiggeymone commented May 8, 2022

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.

@gabrielrjzx
Copy link

gabrielrjzx commented Jul 25, 2022

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

@cademcniven
Copy link

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

@problemadder
Copy link

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

@Ahmad-A0
Copy link

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

@pwenker
Copy link
Owner

pwenker commented Nov 15, 2022

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).

@problemadder
Copy link

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.

@pwenker
Copy link
Owner

pwenker commented Nov 19, 2022

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?

@problemadder
Copy link

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

@pwenker
Copy link
Owner

pwenker commented Nov 20, 2022

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?

@problemadder
Copy link

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

@jmones
Copy link

jmones commented Jan 30, 2023

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
Copy link

jmones commented Jan 30, 2023

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 ?

store: bool = typer.Option(False, help="Select if fetched games should be stored"),

@fionn-r
Copy link

fionn-r commented Mar 6, 2023

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"),
):

@snorkelbuckle
Copy link

@fionn-r

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

@pwenker
Copy link
Owner

pwenker commented May 5, 2024

@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 pwenker closed this as completed May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants