Home › Forums › FABRIC General Questions and Discussion › Internal Server Error when running JupyterHub cell
- This topic has 2 replies, 3 voices, and was last updated 1 month, 3 weeks ago by
Dagim Mindaye.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
September 3, 2025 at 4:48 pm #8880
Hello, I’m getting this error when running the configuration cell in JupyterHub (see the code and the error below):
from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
project_id = “5c7270ea-dea3-4388-bad0-c8c4fb9a2c96”
fablib = fablib_manager(project_id=project_id)
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 - During handling of the above exception, another exception occurred: TokenManagerException Traceback (most recent call last) Cell In[3], line 7 4 # Update this line to specify your project id 5 project_id = "5c7270ea-dea3-4388-bad0-c8c4fb9a2c96" ----> 7 fablib = fablib_manager(project_id=project_id) 9 # Import Fablib 10 from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:717, 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, validate_config, **kwargs) 715 if not offline: 716 self.ssh_thread_pool_executor = ThreadPoolExecutor(execute_thread_pool_size) --> 717 self.__build_manager() 718 if validate_config: 719 self.verify_and_configure(validate_only=True) File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:1308, in FablibManager.__build_manager(self) 1306 except Exception as e: 1307 logging.error(e, exc_info=True) -> 1308 raise e 1310 return self.manager File /opt/conda/lib/python3.11/site-packages/fabrictestbed_extensions/fablib/fablib.py:1287, in FablibManager.__build_manager(self) 1284 Utils.is_reachable(hostname=self.get_orchestrator_host()) 1285 Utils.is_reachable(hostname=self.get_core_api_host()) -> 1287 self.manager = FabricManager( 1288 oc_host=self.get_orchestrator_host(), 1289 cm_host=self.get_credmgr_host(), 1290 core_api_host=self.get_core_api_host(), 1291 am_host=self.get_am_host(), 1292 project_id=self.get_project_id(), 1293 token_location=self.get_token_location(), 1294 initialize=True, 1295 scope="all", 1296 auto_refresh=self.auto_token_refresh, 1297 ) 1298 self.manager.initialize() 1299 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
-
This topic was modified 1 month, 3 weeks ago by
Dagim Mindaye.
September 3, 2025 at 11:08 pm #8883Hi Dagim,
Thank you for sharing this observation. Could you update the instantiation of the
fablibobject in the first cell to the following and then try running the notebook again?fablib = fablib_manager(project_id=project_id, validate_config=False)Thanks,
KomalSeptember 5, 2025 at 5:34 pm #8895Thank you so much. The issue has been resolved. The old code cell now works but I’ll be sure to use this if I get the same error again.
-
This topic was modified 1 month, 3 weeks ago by
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.