question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order only succeeds when logged in once via browser

See original GitHub issue

I do have some strange errors when ordering:

2022-03-09 18:37:57,586 CRITICAL MainThread      400
2022-03-09 18:37:57,586 CRITICAL MainThread      {"errors":[{"text":"order.error.128"}]}

2022-03-14 11:42:02,077 CRITICAL MainThread      500
2022-03-14 11:42:02,077 CRITICAL MainThread      {"errors":[{"text":"Internal server error"}]}

Unfortunately there is no more debug output despite I set

level=logging.DEBUG

I just found out that at least the

{"errors":[{"text":"Internal server error"}]}

error is gone, when I login to degiro once via browser. I guess this is a bug. The session is created correctly:

2022-03-14 12:08:17,645 INFO MainThread get_session_id:response_dict: {'isPassCodeEnabled': True, 'locale': 'de_DE', 'redirectUrl': 'https://trader.degiro.nl/trader/', 'sessionId': 'xxxxxxxxx.prod_a_116_4', 'status': 0, 'statusText': 'success'}

Might always happen after a weekend, when I did not login for a long time, but not sure. No, happened this morning again. Always have to login first, until buy order is executed.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
TommasoBendinellicommented, Apr 30, 2022

I agree that the login process for the web portal is different from DeGiro’s API connect() method. I have noticed that if you log in via the browser or your phone, no errors pop up until midnight of the next day . So right now I am logging in into Degiro every morning as workaround, so that I am sure my daily orders will go through. But it isn’t very pleasant experience, and goes against principle of having automated API where everything supposed to be automated without user intervention.

1reaction
funnel20commented, Apr 29, 2022

@coveritytest I’m glad you brought this up, since I have the same experience. It’s certainly not related to a timeout issue between consecutive API calls, see my remark in this post.

Work-around

  1. Our script with the DeGiro Connector (API) runs dedicated on laptop 1.
  2. We start it 1.5 hours before New York Market opening and let it run for 9 hours in total
  3. Together with the start of the script, we login to DeGiro web portal on laptop 2.
  4. After a random amount of time, the web portal on laptop 2 is logged out automatically.
  5. Orders created with the API on laptop 1 will be executed without issues.

When we omit step 3, step 5 will fail with errors.

Observations

  • Since we use 2 different laptops, nothing can be set on the local machine. So DeGiro must link something to the account.
  • Since the API error is introduced after time (i.e. when not logged in to the web portal for 1 day) it seems to relate to something as an OAuth expiration.
  • Apparently the login to the web portal does something else to the DeGiro account server, than the API connect() method. @Chavithra Do you have any idea what this difference might be?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sign-in form best practices - web.dev
Sign -in form best practices. Use cross-platform browser features to build sign-in forms that are secure, accessible and easy to use.
Read more >
How to log out user from web site using BASIC authentication?
In short, the logout script inverts the logic of the login script, only returning the success page if the user isn't passing the...
Read more >
Chrome Browser Privacy Policy - Google
Chrome takes your privacy very seriously. Here's everything you need to know about your privacy while browsing the web on Chrome.
Read more >
Set Chrome policies for users or browsers - Google Support
You can enforce Chrome policies from your Admin console that apply to: User accounts to sync policies and preferences across a user's devices....
Read more >
Promise - JavaScript - MDN Web Docs
The States and fates document from the original Promise proposal ... if it is only a succeed message, it probably will be. console.log(`Yay!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found