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

Login after token refresh times out #19

Open
signag opened this issue Jul 26, 2023 · 4 comments
Open

Login after token refresh times out #19

signag opened this issue Jul 26, 2023 · 4 comments

Comments

@signag
Copy link

signag commented Jul 26, 2023

I have an issue with login after tokens have been refreshed.
This one seems to be different from #16.

From my main program, I cyclically call get_vsr from nativeAPI.py every 15 minutes.
This works fine for 5 cycles (about 1 hour) using the cached session data,
In the 6th cycle (see attached trace file starting at line 260), tokens are found to be expired and a new login is made.
However, __get_url, called from __force_login, times out after ~15 minutes with ConnectionError 'Remote end closed connection without response'

The attached trace file covers the entire test run and has the exception output included at the end.

Thanks for support
monitorVW_02.log

@trocotronic
Copy link
Owner

Try replacing line 250 of NativeAPI

            if (scope in self.__oauth and 'refresh_token' in self.__oauth[scope]):

By

            if (scope in self.__oauth and 'refresh_token' in self.__oauth['sc2:fal']):

It’s something wrong with cubic token.

@signag
Copy link
Author

signag commented Jul 26, 2023

Thanks for the quick response.

I tried the suggested modification but I am running into the same issue.

Here is the modification:
image

Note that the difference in line numbers in my version is due to minor modifications which do not have any influence on functionality:

  • instantiation of extended logging (logging_plus)
  • modification of init(self) by passing credentials rather than reading these from the credentials file
  • prints removed in __get_idk(self, soup)

I have attached the new trace file.
What is different now is that tokens are expired already in the first cycle (starts at line 26), because I had started with existing weconnectAPI.access and weconnectAPI.session.
In this initial cycle, the forced login works fine.
However, in the 6th cycle (starting at line 266), the login has a timeout again.
monitorVW_07.log

@trocotronic
Copy link
Owner

Which is the current status of this issue? Still persists?

@signag
Copy link
Author

signag commented Nov 5, 2023

Issue still persists

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

2 participants