Home › Forums › FABRIC General Questions and Discussion › refrsh token issue inside jupyter notebook
- This topic has 1 reply, 2 voices, and was last updated 2 days, 2 hours ago by
Komal Thareja.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
April 23, 2025 at 8:22 pm #8442
Does anyone know how to sole refrsh token issue inside jupyter notebook?
/opt/conda/lib/python3.11/site-packages/fabric_cm/credmgr/swagger_client/rest.py:45: DeprecationWarning: HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly. return self.urllib3_response.getheaders()
--------------------------------------------------------------------------- TokenManagerException Traceback (most recent call last) File /opt/conda/lib/python3.11/site-packages/fabrictestbed/token_manager/token_manager.py:251, in TokenManager.refresh_tokens(self, refresh_token) 250 error_message = Utils.extract_error_message(exception=tokens) --> 251 raise TokenManagerException(error_message) 252 except Exception as e: TokenManagerException: Internal Server Error - (invalid_grant) expired refresh token During handling of the above exception, another exception occurred: TokenManagerException Traceback (most recent call last) Cell In[5], line 8 6 import random 7 from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager ----> 8 fablib = fablib_manager() File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:712, in FablibManager.__init__(self, fabric_rc, credmgr_host, orchestrator_host, core_api_host, am_host, token_location, project_id, bastion_username, bastion_key_location, log_level, log_file, data_dir, output, execute_thread_pool_size, offline, auto_token_refresh, **kwargs) 710 if not offline: 711 self.ssh_thread_pool_executor = ThreadPoolExecutor(execute_thread_pool_size) --> 712 self.__build_manager() 713 self.required_check() 714 self.lock = threading.Lock() File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:1186, in FablibManager.__build_manager(self) 1184 except Exception as e: 1185 logging.error(e, exc_info=True) -> 1186 raise e 1188 return self.manager File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:1165, in FablibManager.__build_manager(self) 1162 Utils.is_reachable(hostname=self.get_orchestrator_host()) 1163 Utils.is_reachable(hostname=self.get_core_api_host()) -> 1165 self.manager = FabricManager( 1166 oc_host=self.get_orchestrator_host(), 1167 cm_host=self.get_credmgr_host(), 1168 core_api_host=self.get_core_api_host(), 1169 am_host=self.get_am_host(), 1170 project_id=self.get_project_id(), 1171 token_location=self.get_token_location(), 1172 initialize=True, 1173 scope="all", 1174 auto_refresh=self.auto_token_refresh, 1175 ) 1176 self.manager.initialize() 1177 logging.debug("Fabric manager initialized!") File /opt/conda/lib/python3.11/site-packages/fabrictestbed/fabric_manager.py:66, in FabricManager.__init__(self, cm_host, oc_host, core_api_host, am_host, token_location, project_id, scope, initialize, project_name, auto_refresh) 63 def __init__(self, *, cm_host: str = None, oc_host: str = None, core_api_host: str = None, am_host: str = None, 64 token_location: str = None, project_id: str = None, scope: str = "all", initialize: bool = True, 65 project_name: str = None, auto_refresh: bool = True): ---> 66 super().__init__(cm_host=cm_host, oc_host=oc_host, token_location=token_location, 67 project_id=project_id, scope=scope, initialize=initialize, project_name=project_name, 68 auto_refresh=auto_refresh) 69 if core_api_host is None: 70 core_api_host = os.environ.get(Constants.FABRIC_CORE_API_HOST) File /opt/conda/lib/python3.11/site-packages/fabrictestbed/slice_manager/slice_manager.py:50, in SliceManager.__init__(self, cm_host, oc_host, token_location, project_id, scope, initialize, project_name, auto_refresh) 48 def __init__(self, *, cm_host: str = None, oc_host: str = None, token_location: str = None, project_id: str = None, 49 scope: str = "all", initialize: bool = True, project_name: str = None, auto_refresh: bool = True): ---> 50 super().__init__(cm_host=cm_host, token_location=token_location, project_id=project_id, scope=scope, 51 project_name=project_name, auto_refresh=auto_refresh, initialize=initialize) 52 if oc_host is None: 53 oc_host = os.environ.get(Constants.FABRIC_ORCHESTRATOR_HOST) File /opt/conda/lib/python3.11/site-packages/fabrictestbed/token_manager/token_manager.py:107, in TokenManager.__init__(self, cm_host, token_location, project_id, scope, project_name, auto_refresh, initialize) 104 self.user_email = None 106 if initialize: --> 107 self.initialize() File /opt/conda/lib/python3.11/site-packages/fabrictestbed/token_manager/token_manager.py:116, in TokenManager.initialize(self) 110 """ 111 Initialize the Slice Manager object 112 - Load the tokens 113 - Refresh if needed 114 """ 115 if not self.initialized: --> 116 self._load_tokens() 117 self.initialized = True File /opt/conda/lib/python3.11/site-packages/fabrictestbed/token_manager/token_manager.py:189, in TokenManager._load_tokens(self, refresh) 187 # Renew the tokens to ensure any project_id changes are taken into account 188 if refresh and self.auto_refresh and refresh_token: --> 189 self.refresh_tokens(refresh_token=refresh_token) File /opt/conda/lib/python3.11/site-packages/fabrictestbed/token_manager/token_manager.py:254, in TokenManager.refresh_tokens(self, refresh_token) 252 except Exception as e: 253 error_message = Utils.extract_error_message(exception=e) --> 254 raise TokenManagerException(error_message) TokenManagerException: Internal Server Error - (invalid_grant) expired refresh token
April 24, 2025 at 8:45 am #8443This error typically occurs due to an expired token. Please try the following steps:
Go to File → Hub Control Panel → Stop My Server, then select Start Server to generate a new token.Thanks,
Komal
P.S: https://learn.fabric-testbed.net/knowledge-base/using-the-jupyter-hub/#frequently-asked-questions
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.