Home › Forums › FABRIC General Questions and Discussion › error in slice submit : `refresh_token` must not be `None`
Tagged: slicemanager
- This topic has 7 replies, 4 voices, and was last updated 1 year, 9 months ago by Paul Ruth.
-
AuthorPosts
-
September 1, 2022 at 11:48 am #2800
For either Fabric Release 1.2.x or 1.3 client-side I am now seeing an error in slice submit :
ValueError: Invalid value for
refresh_token
, must not beNone
for scripts that were working, say early August. Is there an update for settings for tokens client side ?
I have the standard FABRIC_TOKEN_LOCATION set.September 1, 2022 at 11:56 am #2804Hi Gregory,
Thank you for reporting this issue. Could you please share the snapshot of the stacktrace if available where this error is observed or share your notebook?
Also, could you please share the output of the command below?
cat /opt/conda/lib/python3.9/site-packages/fabrictestbed/__init__.py
Also, are you using the Jupyter Hub or local desktop environment?
If you are using the desktop environment, please consider updating the python environment using the following command:
pip install fabrictestbed-extensions==1.3.0
Thanks and Regards,
Komal
September 1, 2022 at 2:31 pm #2814I am working in a bash shell (‘local desktop’) and 1.3.0 is installed .
The lib/python3.9/site-packages/fabrictestbed/__init__.py shows__VERSION__ = “1.3.0”
and the lib/python3.9/site-packages/fabrictestbed_extensions/__init__.py shows
#
__VERSION__ = “1.3.0”
I’ll try to gather more details.
September 1, 2022 at 2:47 pm #2815The stacktrace looked like the following :
Exception: Invalid value for
refresh_token
, must not beNone
Traceback (most recent call last):
File “/global/u2/g/gdaues/Get2/create_utah_salt_L2.py”, line 44, in <module>
slice = fablib.new_slice(name=slice_name)
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 335, in new_slice
return fablib.get_default_fablib_manager().new_slice(name)
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 57, in get_default_fablib_manager
fablib.default_fablib_manager = FablibManager()
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 662, in __init__
self.build_slice_manager()
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 757, in build_slice_manager
raise e
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 745, in build_slice_manager
self.slice_manager = SliceManager(oc_host=self.orchestrator_host,
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 70, in __init__
self.initialize()
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 79, in initialize
self.__load_tokens()
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 124, in __load_tokens
self.refresh_tokens(refresh_token=refresh_token)
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 157, in refresh_tokens
status, tokens = self.cm_proxy.refresh(project_id=self.project_id, scope=self.scope,
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/credmgr_proxy.py”, line 89, in refresh
body = swagger_client.Request(refresh_token)
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/swagger_client/models/request.py”, line 42, in __init__
self.refresh_token = refresh_token
File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/swagger_client/models/request.py”, line 65, in refresh_token
raise ValueError(“Invalid value for
refresh_token
, must not beNone
“) # noqa: E501ValueError: Invalid value for
refresh_token
, must not beNone
September 1, 2022 at 3:58 pm #2817Could you please invoke the
show_config()
and share the output before invoking new slice?
Also, could you please verify that the token file hasrefresh_token
and json looks like below:P.S: You may already have it in correct format.
{"id_token": "YOUR ID Token", "refresh_token": "YOUR Refresh Token", "created_at": "timestamp"}
fablib.default_fablib_manager = FablibManager() fablib.show_config()
show_config would list the token file being used, please verify that it is correct.
Thanks,
Komal
September 1, 2022 at 5:38 pm #2818Yes it looks like a matter of an invalid or corrupted token. Somehow I ended up working with a token with
these contents:> cat cmbs4_1_tokens.json
{“id_token”: null, “refresh_token”: null, “created_at”: “2022-09-01 15:31:47”}
I have since worked through the credential manager , and downloaded a token with valid entries,
and slice submission has succeeded. So I guess I may have worked through the credential manager with an expired session(?) or something to obtain / download such a malformed token.
So I think my issue is resolved, where I will examine the downloaded tokens as a check.Thanks,
Greg
January 18, 2023 at 5:17 pm #3628I am getting :
“Exception: b'{\n “errors”: [\n {\n “details”: “(invalid_grant) invalid refresh token”,\n “message”: “Internal Server Error”\n }\n ],\n “size”: 1,\n “status”: 500,\n “type”: “error”\n}'” as shown in the picture.
What am I doing wrong?
January 30, 2023 at 9:34 am #3688The most likely reasons for this are either the token expired or you config is not pointing to the valid token.
If you are in the FABRIC JupyterHub, you can get a new token by logging out the back in. If you still see this error then you should confirm you configuration is correct. You can print you configuration with
fablib.show_config()
. The default location of the token in the FABRIC JupyterHub is:/home/fabric/.tokens.json
-
AuthorPosts
- You must be logged in to reply to this topic.