UncleGoogle / galaxy-integration-humblebundle

Humble Bundle integration for GOG Galaxy 2.0
GNU General Public License v3.0
186 stars 19 forks source link

Connection Lost if I close GOG Galaxy #48

Closed jackcaos1 closed 4 years ago

jackcaos1 commented 4 years ago

everytime I close GOG Galaxy and reopen it ( as when I am starting the PC) I have to reestablish the Connection to Humble bundle

UncleGoogle commented 4 years ago

It shouldn't happen. Can you send your log files? Log location is given when you create new issue-bug report

jackcaos1 commented 4 years ago

plugin-humble-f0ca3d80-a432-4d35-a9e3-60f27161ac3a.log

Somehow i created this issue without the template ...

UncleGoogle commented 4 years ago

I apologize for late response. I'm not sure if this is the exact problem, but there is parse error in logs: TomlDecodeError('Reserved escape sequence used (line 30 column 1 char 1620)')

and sometimes in char 1612. Probably you should try with two backslashes \\ in all paths instead of one \. You can also use / I suppose. Definitely I need to add some tests for parsing config...

I it doesn't help paste you config, please.

13xforever commented 4 years ago

this happens if you have any issues with config.ini (e.g. if you specify a non-existent path, which is normal and can happen for a number of reasons)

on restart it will error out and will reset everything, including connection and config.ini (probably as part of the new connection setup)

2019-11-18 17:40:49,468 - root - ERROR - Parsing config file has failed. Details:
ValueError('Path C:\\Games\\Humble does not exists')
2019-11-18 17:40:49,470 - root - DEBUG - local config: {}

also if you make config.ini read-only, you'll have another set of issues with the connection setup

2019-11-18 17:49:55,928 - root - ERROR - Unexpected exception raised in plugin handler
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\jsonrpc.py", line 199, in handle
    result = await callback(*bound_args.args, **bound_args.kwargs)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\plugin.py", line 174, in method
    result = await handler_(*args, **kwargs)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\plugin.py", line 186, in wrapper
    return await self._external_task_manager.create_task(handler(*args, **kwargs), name, False)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\task_manager.py", line 17, in task_wrapper
    result = await coro
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\plugin.py", line 109, in pass_login_credentials
    self._settings.open_config_file()
AttributeError: 'NoneType' object has no attribute 'open_config_file'
2019-11-18 17:49:55,933 - root - ERROR - Task manager jsonrpc server: exception raised in task 14 (pass_login_credentials)
Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\jsonrpc.py", line 199, in handle
    result = await callback(*bound_args.args, **bound_args.kwargs)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\plugin.py", line 174, in method
    result = await handler_(*args, **kwargs)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\plugin.py", line 186, in wrapper
    return await self._external_task_manager.create_task(handler(*args, **kwargs), name, False)
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\task_manager.py", line 17, in task_wrapper
    result = await coro
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\plugin.py", line 109, in pass_login_credentials
    self._settings.open_config_file()
AttributeError: 'NoneType' object has no attribute 'open_config_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\task_manager.py", line 17, in task_wrapper
    result = await coro
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\jsonrpc.py", line 209, in handle
    self._send_error(request.id, UnknownError(str(e)))
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\jsonrpc.py", line 252, in _send_error
    "error": error.json()
  File "C:\Users\user\AppData\Local\GOG.com\Galaxy\plugins\installed\humble\galaxy\api\jsonrpc.py", line 28, in json
    obj["error"]["data"] = self.data
KeyError: 'error'

then it hangs forever and never finishes the setup

UncleGoogle commented 4 years ago

@13xforever Theoretically loading settings and connections are separated. And parsing local config should fallback to defaults.

But in your example 2 (read-only file) this is indeed a problem. Was it read-only by default or there is a usecase to make it RO?

PS I want to make GUI for this, so manual editing config is temporal solution

13xforever commented 4 years ago

it was resetting config.ini when it was failing the directory check, importing keys, which I do not want, so I made it read only trying to force the config I want

UncleGoogle commented 4 years ago

@13xforever @jackcaos1, Strict syntax of config should no longer be a problem as new graphical interface is introduced #83 Release 0.7.0 should be available via Galaxy soon.