Error : Max number of tokens exceeded for this user
I have been trying to integrate cinder with coprHD and have run into the problem mentioned in the title. Whenever I try to authenticate my user through Viprcli it returns the error mentioned.
./viprcli authenticate -u root -d /tmp/cinder
Password :
The token is not generated by authentication service.Max number of tokens exceeded for this user
The same message is seen on coprHD GUI. I am running Viprcli on my cinder host.
If someone can please explain why this error is returned and how to rectify it, it would be greatly appreciated. Thanking you in anticipation.
ViPR Controller has a limit internally of 100 tokens on users. If your automation code logs in with every execution but does not log out, then there is a strong chance that you would exceed 100 tokens for the account you are using.
Tokens take up to 8 hours to expire, unless logged out. There is also an api to expire all tokens, but one has to be logged in as administrator level user to issue such api call (or himself for his own tokens).
Solutions I recommend is to script such that you either log out at the end of execution (or for any exception/exit procedure), or alternatively that your script implements a basic 'whoami' api call to check whether it is logged in, prior to actually attempting to log in.
I don't favor second option because chances are token in use token might expire right in the middle of your automated execution. I recommend you make sure you log out no matter what at the end of your script.
Thank you so much for your response as I was quite stuck with this. The current situation is that my administrator account is locked out due to above error. how can I rectify this issue.
I haven't used any automation scripts. Following work has been done by me till now:
1. Deployed coprHD
2. Installed Viprcli and added Vipr drivers.
3. Added keystone as authentication provider ( had to do it manually as coprHD Keystone Auth provider was not adding the endpoint with correct region )
2016-10-13 06:45:36.881 130137 DEBUG oslo_db.sqlalchemy.session [req-dc5674b7-59e0-4e84-8074-bd005a756bf7 - - - - -] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/lib/python2.7/dist-packages/oslo_db/sqlalchemy/session.py:513
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup result = function(*args, **kwargs)
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/service.py", line 488, in run_service
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup VolumeBackendAPIException: Bad or unexpected response from the storage volume backend API:
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup ViPR Exception: The token is not generated by authentication service.Max number of tokens exceeded for this user
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/bin/viprcli-3.0-py2.7.egg/viprcli/authentication.py", line 173, in authenticate_user
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup "The token is not generated by authentication service."+details_str)
2016-10-13 06:45:36.937 130137 TRACE cinder.openstack.common.threadgroup SOSError: 'The token is not generated by authentication service.Max number of tokens exceeded for this user'
I completely removed Viprcli from my cinder host, cleared the CoprHD DB and brought it back to fresh install state. Re-installed Viprcli again and as soon as I try to authenticate the same error is repeated. I am really stuck with this and unable to move forward.
A side note in this is that cinder successfully lists volume information
are you trying to use ViPR as a storage provider for Openstack or are you trying to use Openstack Cinder as a storage provider for a 3rd party array that ViPR doesn't support?
Hello, Thank you for your response. Basically, I'm trying to integrate EMC SAN storage with OpenStack Cloud. For this purpose I'm using CoprHD/ViPR controller.
So basically to my understanding any storage provisioned through ViPR GUI catalog or through ViPR CLI should be visible to Cinder. Which can then be provisioned in OpenStack.
That's okay. I'm going to be trying to figure out a way to somehow refresh or release the tokens. Anyways thank you for all the help, it is much appreciated ! cheers.
Velik1
36 Posts
2604
2
Posted October 12th, 2016 08:00
Hi Mustafa,
thank you for your question
ViPR Controller has a limit internally of 100 tokens on users. If your automation code logs in with every execution but does not log out, then there is a strong chance that you would exceed 100 tokens for the account you are using.
Tokens take up to 8 hours to expire, unless logged out. There is also an api to expire all tokens, but one has to be logged in as administrator level user to issue such api call (or himself for his own tokens).
Solutions I recommend is to script such that you either log out at the end of execution (or for any exception/exit procedure), or alternatively that your script implements a basic 'whoami' api call to check whether it is logged in, prior to actually attempting to log in.
I don't favor second option because chances are token in use token might expire right in the middle of your automated execution. I recommend you make sure you log out no matter what at the end of your script.
Stanislav