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

Initialization Problems. #14

Closed
kimichen13 opened this issue Nov 19, 2021 · 4 comments · Fixed by #25
Closed

Initialization Problems. #14

kimichen13 opened this issue Nov 19, 2021 · 4 comments · Fixed by #25

Comments

@kimichen13
Copy link

kimichen13 commented Nov 19, 2021

I am really interested in your idea of lobbyboy. But I know nothing about python.

So here is my problems during initialization, can you help me to figure it out?

  1. I configure my own data_dir but service start with an error.
    obbyboy.utils: Error when reading available_servers.json, [Errno 2] No such file or directory: '~/Software/lobbyboy/data/available_servers.json'
    Even I create the available_servers.json file, it does not work. Until I write {} to the file.
    But I'm not sure if this is ok for the lobbyboy service
  2. When I ssh with ssh Kimi@127.0.0.1 -p 12200, the logs shows an error below:
ERR [20211119-17:40:41.664] thr=123145413386240 paramiko.transport: Unknown exception: too many values to unpack (expected 2)
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport: Traceback (most recent call last):
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:   File "/usr/local/lib/python3.9/site-packages/paramiko/transport.py", line 2109, in run
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:     handler(self.auth_handler, m)
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:   File "/usr/local/lib/python3.9/site-packages/paramiko/auth_handler.py", line 525, in _parse_userauth_request
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:     result = self.transport.server_object.check_auth_publickey(
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:   File "/usr/local/lib/python3.9/site-packages/lobbyboy/server.py", line 103, in check_auth_publickey
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport:     _, _key_pub = line.split(" ", 2)
ERR [20211119-17:40:41.667] thr=123145413386240 paramiko.transport: ValueError: too many values to unpack (expected 2)

I did some research but it's really difficult for me to understand python.

So if you can give me a hand, that's would be nice.

Thank you.

@kimichen13 kimichen13 changed the title Install Problem. Initialization Problems. Nov 19, 2021
laixintao added a commit that referenced this issue Nov 20, 2021
also, fix the key spliting problems.

related #14
@laixintao
Copy link
Collaborator

laixintao commented Nov 20, 2021

hi @kimichen13 thanks for reporting this issue.

for 1: it is ok to see this error, because lobbyboy will start to clean up the spare servers (start a thread called server-killer) once it started. Because you don't have any servers yet so the db file is not exist. it is ok for this error. however, I have changed to log level into warning.

for 2: I think there might be extra space in your rsa key config: https://github.com/laixintao/lobbyboy/blob/1df9317202104872e69e2688816eea420fbb1130/lobbyboy/conf/lobbyboy_config.toml#L18
so the split failed.

but it is also a bug, we should only split the key once, but the current code is split twice. As its format should be sth like ssh-rsa AAAAB3Nz..., (only 1 space)

fixed here: 1df9317#diff-0ac1b5794560c86cf87d34d7bc30b18b0875d637c7dc9b1c596e6517d90b3a14L103

those patches were released to 0.2.4, cloud you please upgrade then try again?

This project might lack some tests, if you found anything abnormal, inconvenience, or if you have any issues, feedbacks, advice, feel free to file an issue here :)

@kimichen13
Copy link
Author

Thanks for your reply.

After upgraded, I get lobbyboy-0.3.0.

  1. Run lobbyboy-server -c config.toml, it gets an error:
Traceback (most recent call last):
  File "/usr/local/bin/lobbyboy-server", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/main.py", line 101, in main
    config: LBConfig = load_config(Path(args.config_path))
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/config.py", line 172, in load_config
    config = replace(config, **config_file_file)
  File "/usr/local/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/dataclasses.py", line 1284, in replace
    return obj.__class__(**changes)
  File "<string>", line 13, in __init__
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/config.py", line 90, in __post_init__
    self.confirm_data_type()
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/config.py", line 107, in confirm_data_type
    self.provider = {p: confirm_dc_type(config, LBConfigProvider) for p, config in self.provider.items()}
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/config.py", line 107, in <dictcomp>
    self.provider = {p: confirm_dc_type(config, LBConfigProvider) for p, config in self.provider.items()}
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/utils.py", line 105, in confirm_dc_type
    return should_be(**value)
TypeError: __init__() got an unexpected keyword argument 'loadmodule'
  1. I try to regenerate the configuration file with command lobbyboy-config-example > config.toml, but still get error below:
Traceback (most recent call last):
  File "/usr/local/bin/lobbyboy-config-example", line 8, in <module>
    sys.exit(print_example_config())
  File "/usr/local/lib/python3.9/site-packages/lobbyboy/scripts.py", line 6, in print_example_config
    with open(example_config_file, "r") as conf:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/lobbyboy/conf/lobbyboy_config.tom/conf/lobbyboy_config.tomll'

I just found that the last line of the error maybe a typo. The template file in your project is lobbyboy_config.toml, not lobbyboy_config.tomll.

However, I still cannot figure out the reason of the first error. Could you help me to solve it?

Thank you.

@luxiaba
Copy link
Collaborator

luxiaba commented Dec 1, 2021

hi @kimichen13 thank you for your patience.
for 1, it's correct to configuration config, we've change some configuartions to make it easier to read for human.
for 2, this is indeed a typo error, we'll fix it.

thank you very much for your feedback.

@kimichen13
Copy link
Author

Thanks. I manually replace the configuration file, it works.

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

Successfully merging a pull request may close this issue.

3 participants