1. Refresh Token Error

Refresh Token Error

Home Forums FABRIC General Questions and Discussion Refresh Token Error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6337
    Robin Schelstraete
    Participant

      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.

      #6338
      Komal Thareja
      Participant

        @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

        #6418
        Robin Schelstraete
        Participant

          Hi 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

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.
        FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

        KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)
        FABRIC invites nominations for four awards recognizing innovative uses of FABRIC resources—Best Published Paper, Best FABRIC Matrix, Best FABRIC Experiment, and Best Classroom Use of FABRIC — submissions due by **Monday, February 24 at 11:59 PM ET**, and winners announced at KNIT10. [>>>Submit Form](https://docs.google.com/forms/d/e/1FAIpQLSeTp3i2iDhB7bHgN8ryMxZci8ya87yjeQd7_JMZImUodNinVA/viewform)

        KNIT10 Call for Demos Now Open! Submit your demo by **February 24**. [>>>Submit Demo](https://docs.google.com/forms/d/e/1FAIpQLScRIWqHliNP3DFWBCnalYN_fBXJXVM0PpP9YWWJdSebC95TvA/viewform)