Home › Forums › FABRIC General Questions and Discussion › Refresh Token Error
- This topic has 2 replies, 2 voices, and was last updated 10 months ago by Robin Schelstraete.
-
AuthorPosts
-
January 15, 2024 at 4:13 am #6337
Hi all,
I’ve been trying to work on my thesis the last three days, but everytime I try to run:
from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
fablib = fablib_manager()
fablib.show_config();I get the following error:
--------------------------------------------------------------------------- SliceManagerException Traceback (most recent call last) Cell In[1], line 7 1 from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager 2 # from fabrictestbed_extensions.fablib.fablib import FablibManager as slice_manager 3 # from fabrictestbed.slice_manager import SliceManager, Status 4 5 # id_token, refresh_token = slice_manager.refresh_tokens() ----> 7 fablib = fablib_manager() 9 fablib.show_config(); File ~/.local/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:796, in FablibManager.__init__(self, fabric_rc, credmgr_host, orchestrator_host, fabric_token, project_id, bastion_username, bastion_key_filename, log_level, log_file, data_dir, output, execute_thread_pool_size, offline) 793 self.facility_ports = None 795 if not offline: --> 796 self.build_slice_manager() File ~/.local/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:985, in FablibManager.build_slice_manager(self) 982 except Exception as e: 983 # logging.error(f"{e}") 984 logging.error(e, exc_info=True) --> 985 raise e 987 return self.slice_manager File ~/.local/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:971, in FablibManager.build_slice_manager(self) 961 try: 962 logging.info( 963 f"oc_host={self.orchestrator_host}," 964 f"cm_host={self.credmgr_host}," (...) 968 f"scope='all'" 969 ) --> 971 self.slice_manager = SliceManager( 972 oc_host=self.orchestrator_host, 973 cm_host=self.credmgr_host, 974 project_id=self.project_id, 975 token_location=self.fabric_token, 976 initialize=True, 977 scope="all", 978 ) 980 # Initialize the slice manager 981 self.slice_manager.initialize() File ~/.local/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:71, in SliceManager.__init__(self, cm_host, oc_host, token_location, project_id, scope, initialize) 67 raise SliceManagerException(f"Invalid initialization parameters: cm_proxy={self.cm_proxy}, " 68 f"oc_proxy={self.oc_proxy}, token_location={self.token_location}, " 69 f"project_id={self.project_id}") 70 if initialize: ---> 71 self.initialize() File ~/.local/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:80, in SliceManager.initialize(self) 74 """ 75 Initialize the Slice Manager object 76 - Load the tokens 77 - Refresh if needed 78 """ 79 if not self.initialized: ---> 80 self.__load_tokens() 81 self.initialized = True File ~/.local/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:127, in SliceManager.__load_tokens(self) 125 refresh_token = os.environ.get(Constants.CILOGON_REFRESH_TOKEN) 126 # Renew the tokens to ensure any project_id changes are taken into account --> 127 self.refresh_tokens(refresh_token=refresh_token) File ~/.local/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:164, in SliceManager.refresh_tokens(self, refresh_token) 162 self.tokens = tokens 163 return tokens.get(CredmgrProxy.ID_TOKEN, None), tokens.get(CredmgrProxy.REFRESH_TOKEN, None) --> 164 raise SliceManagerException(tokens.get(CredmgrProxy.ERROR)) SliceManagerException: b'{\n "errors": [\n {\n "details": "",\n "message": "Internal Server Error"\n }\n ],\n "size": 1,\n "status": 500,\n "type": "error"\n}'
I tried logging in and out, deleting cookies, restarting the kernel etc. but nothing works so far.
I read something about generating a new refresh token and pasting it into \home\fabric\.token.json in the JH but I can’t find this path in my JH repository. Is there another way to fix this problem? Does anyone maybe have a path to the json file starting from the fabric_config folder? Any help is appreciated.
January 15, 2024 at 8:23 am #6338@Robin, could you please try to restart your JH container via File -> Hub Control Panel -> Stop My container -> Start My container when you see this error?
Also, the path to replace the token is
/home/fabric/.tokens.json
. We will fix this in the documentation of it’s incorrect. Also, could you please let us know which JH container are you using?Thanks,
Komal
January 25, 2024 at 11:53 am #6418Hi Komal,
Thank you for your quick response. I fixed the problem about a day after I posted the question by stopping my server via the Control Hub Panel.
Thanks again!
Robin
-
AuthorPosts
- You must be logged in to reply to this topic.