-
Notifications
You must be signed in to change notification settings - Fork 19
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
Error { data: [], meta: { msg: 'api.err.LoginRequired', rc: 'error' } } #3
Comments
Which version is that? I could make it if it see loginrequired to
automatically try to repeat the last login and then to repeat the call?
…On Thu, May 25, 2017, 00:19 Nkansah Rexford ***@***.***> wrote:
After the server keeps running for a while, making a request returns the
error:
Error { data: [],
meta: { msg: 'api.err.LoginRequired', rc: 'error' } }
A simple workaround I'm thinking of is logging in per each transaction.
That's the right way? Or there's a setting somewhere I'm missing?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG7Zv7YEGfA0Mo7NGrlxXKTwzAMsvF2ks5r9Kz_gaJpZM4NlvQE>
.
|
My unifi controller is 5.4.15 This is what I did, by attempting to login each time, however it still brings up the same error: seanmavley/unifi-guest-bundle-check@5f27aa9#diff-bb503f3d9047bcd4a5730559f1e16560R59
I don't know if that'll fix it, but if so, that'll be great. |
I actually happened to have such a code. Within lib/unifi-request.js there
is a line:
if ((resp && resp.statusCode == 401) || (typeof error == 'string' &&
error.match('api.err.LoginRequired'))) {
.. and then it retry the connection once (because it will become a forever
loop if it retry forever because of wrong credentials or anything else
wrong)
Maybe there is an error in my algorithm or a bug, or you use a different
code.
Would it be possible for you to send me the following info:
1) What version of the node-unifiapi you use (npm ls node-unifiapi) and if
it is not 0.44 please upgrade to 0.44 and retry again?
2) Send me sample of your code you use to connect (so I can see how do you
initialize it, may be there is a bug in the package that depends on the way
how it is used), please replace the credentials with something else, I dont
need them
3) Send me a debug output (you can enable it, by setting debug: true and
debugNet: true in the initialization options), you can also replace the
credentials in the debug with something different, I just want to see
if/when it has seen the err.loginRequired it has retried to login and it
has done it with the correct credentials
…On Thu, May 25, 2017 at 11:17 AM Nkansah Rexford ***@***.***> wrote:
My unifi controller is 5.4.15
I'm using Node 7 (I don't know if that matters)
And using the latest of node-unifiapi
This is what I did, by attempting to login each time, however it still
brings up the same error: ***@***.***
#diff-bb503f3d9047bcd4a5730559f1e16560R59
<seanmavley/unifi-guest-bundle-check@5f27aa9#diff-bb503f3d9047bcd4a5730559f1e16560R59>
I could make it if it see loginrequired to
automatically try to repeat the last login and then to repeat the call?
I don't know if that'll fix it, but if so, that'll be great.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG7Zk_VKg-gB5I_wuMYeclyey-N1VQAks5r9UckgaJpZM4NlvQE>
.
|
Thanks for getting in touch.
The only available versions in npm for node-unifapi is 0.0.45, 0.0.44, 0.0.40, 0.0.39, 0.0.38, 0.0.37, 0.0.36, thus I think I have the latest which is 0.0.45.
And this my credentials:
When I enable the |
So it seems to be working. Per each transaction, I logout at the end. Thus, any next transaction needs to reauthenticate. Which seems to be working pretty as expected. I do not know the down side to doing it that way, but at least it gets it working for now. |
Could you look into this? Explicitly logging out per each transaction doesn't solve the problem in the long run. Still throws the error:
|
After the server keeps running for a while, making a request returns the error:
A simple workaround I'm thinking of is logging in per each transaction.
That's the right way? Or there's a setting somewhere I'm missing?
The text was updated successfully, but these errors were encountered: