shuichiro-makigaki / mendeley_cli

CLI for Mendeley
MIT License
4 stars 0 forks source link

Does not work after upgarding to the latest version #3

Closed A3EKV closed 2 years ago

A3EKV commented 2 years ago

After upgrading, It seems that it doesn't work, here is what I get when I run:

MENDELEY_CLIENT_ID=10209 MENDELEY_CLIENT_SECRET='p6TmD0blabla' MENDELEY_REDIRECT_URI='http://localhost:8888' mendeley get token
Opening in existing browser session.
[416803:416803:0929/085051.338460:ERROR:broker_posix.cc(43)] Invalid node channel message
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49276)
Traceback (most recent call last):
  File "/usr/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.8/socketserver.py", line 347, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.8/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/lib/python3.8/http/server.py", line 427, in handle
    self.handle_one_request()
  File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
    method()
  File "/home/AE3X/.local/lib/python3.8/site-packages/mendeley_cli/__init__.py", line 50, in do_GET
    mendeley_session = auth.authenticate(f'{mendeley_client.redirect_uri}{self.path}')
  File "/home/AE3X/.local/lib/python3.8/site-packages/mendeley/auth.py", line 65, in authenticate
    token = self.oauth.fetch_token(self.token_url,
  File "/home/AE3X/.local/lib/python3.8/site-packages/requests_oauthlib/oauth2_session.py", line 199, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/home/AE3X/.local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 409, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/home/AE3X/.local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 376, in parse_token_response
    validate_token_parameters(params)
  File "/home/AE3X/.local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 386, in validate_token_parameters
    raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
shuichiro-makigaki commented 2 years ago

Could you double-check your MENDELEY_CLIENT_SECRET? I could reproduce your problem using the wrong secret. Your secret seems to be short... It may be copy&paste miss?

And, the secret should not be open. Please regenerate your secret, and fully copy&paste it.

A3EKV commented 2 years ago

Thank you, Before posting this I have tried to update the secret code several times. Now I have regenerated it as per your recommendation and it works! Sorry, I guess this is a side effect of staying too late at night. Thanks

A3EKV commented 2 years ago

Maybe those mistakes can be added in README as an FAQ?