1

Token/Login intermittently returns either error 8 or error 1003

Тема: Token/Login intermittently returns either error 8 or error 1003

Let me get you some background on how and what we are doing. This is running on C#.

Scenario: Rename Unit , Update a CustomField, Update ProfileField in sequential operation.
This is the sequence of actions are:

1)    “token/login” to obtain SID
2)     “item/update_name”
3)    “token/login” to obtain SID
4)    “item/update_profile_field”
5)    “token/login” to obtain SID
6)    “item/update_custom_field”


Concurrently, there is another machine that queries Unit data every 5 minutes using the same account.
The sequence of actions for that are:

1)    “token/login” to obtain SID
2)    “core/search_items” for the Units






The problem I’m having is during the “token/login” call on my “Update” operation.

I'm getting either:

{"error":8, "reason":"INVALID_AUHT_TOKEN"}

or

{"error":1003, "reason":"LIMIT invalid_logins"}

If I retry it a couple of time, then it will be fine.


Any idea why?

could the 2 machines using the same account has any bearing on this? (i did try to run my "update" operation while the "query" is not running but still getting the either error 8 or 1003).

Is there a limit on how many queries i can make within a time limit?

Regards,

Anson

2

Token/Login intermittently returns either error 8 or error 1003

Re: Token/Login intermittently returns either error 8 or error 1003

You execute to many token/logins.. You should do it once, grab sid and use that sid in all following requests. Something like that

1)    “token/login” to obtain SID
2)     “item/update_name”
3)    “item/update_profile_field”
4)    “item/update_custom_field”
5)    ....
..)    "core/logout"

I added core logout in the end, it's good practice to shutdown your session when you don't need it anymore

3

Token/Login intermittently returns either error 8 or error 1003

Re: Token/Login intermittently returns either error 8 or error 1003

Thanks for the info.

so what triggered these 2 errors?

{"error":8, "reason":"INVALID_AUHT_TOKEN"}


{"error":1003, "reason":"LIMIT invalid_logins"}


It looks like i'm hitting some kind of limitations (according to this:  https://sdk.wialon.com/wiki/en/sidebar/ … ts/limits) 
However,  i'm not sure what i'm hitting.

According to the page:

Limits for logins and sessions
No more than 10 failed logins from one IP address in a minute;
No more than 120 successful logins from one IP address in a minute;
No more than 100 active sessions of one user from one IP address;
No more than 4 invalid two-factor authentication codes in 100 seconds.

it doesn't look like i'm hitting any of these criteria.

Anson