1. Unable to use fablib.manager

Unable to use fablib.manager

Home Forums FABRIC General Questions and Discussion Unable to use fablib.manager

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6326
    Shams Gozalova
    Participant

      Hi everyone,

      I am new to FABRIC and trying to run a simple tutorial on Hello, Fabric, however I get stuck on the first ever step of the notebook. I have configured the environment with necessary details, but I keep running on token and project uuid problems. I am using the 1.6.0 version

      The project ID that I am using is 488bd68e-9703-447b-bd77-069da4f438a6.

      Here are the traces:

      ---------------------------------------------------------------------------
      SliceManagerException                     Traceback (most recent call last)
      Cell In[1], line 3
            1 from fabrictestbed_extensions.fablib.fablib import FablibManager as fablib_manager
      ----> 3 fablib = fablib_manager()
            5 fablib.show_config();
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:809, 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)
          806 self.facility_ports = None
          808 if not offline:
      --> 809     self.build_slice_manager()
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:984, in FablibManager.build_slice_manager(self)
          981 except Exception as e:
          982     # logging.error(f"{e}")
          983     logging.error(e, exc_info=True)
      --> 984     raise e
          986 return self.slice_manager
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed_extensions/fablib/fablib.py:970, in FablibManager.build_slice_manager(self)
          960 try:
          961     logging.info(
          962         f"oc_host={self.orchestrator_host},"
          963         f"cm_host={self.credmgr_host},"
         (...)
          967         f"scope='all'"
          968     )
      --> 970     self.slice_manager = SliceManager(
          971         oc_host=self.orchestrator_host,
          972         cm_host=self.credmgr_host,
          973         project_id=self.project_id,
          974         token_location=self.fabric_token,
          975         initialize=True,
          976         scope="all",
          977     )
          979     # Initialize the slice manager
          980     self.slice_manager.initialize()
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:80, in SliceManager.__init__(self, cm_host, oc_host, token_location, project_id, scope, initialize, project_name)
           76     raise SliceManagerException(f"Invalid initialization parameters: cm_proxy={self.cm_proxy}, "
           77                                 f"oc_proxy={self.oc_proxy}, token_location={self.token_location}, "
           78                                 f"project_id={self.project_id}, project_name={self.project_name}")
           79 if initialize:
      ---> 80     self.initialize()
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:89, in SliceManager.initialize(self)
           83 """
           84 Initialize the Slice Manager object
           85 - Load the tokens
           86 - Refresh if needed
           87 """
           88 if not self.initialized:
      ---> 89     self.__load_tokens()
           90     self.initialized = True
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:139, in SliceManager.__load_tokens(self)
          135     raise SliceManagerException(f"Unable to refresh tokens: no refresh token found!")
          136     #self.logger.warning("Unable to refresh tokens: no refresh token found!")
          137     #return
          138 # Renew the tokens to ensure any project_id changes are taken into account
      --> 139 self.refresh_tokens(refresh_token=refresh_token)
      
      File /opt/conda/lib/python3.10/site-packages/fabrictestbed/slice_manager/slice_manager.py:196, in SliceManager.refresh_tokens(self, refresh_token)
          194     self.tokens = tokens
          195     return tokens.get(CredmgrProxy.ID_TOKEN, None), tokens.get(CredmgrProxy.REFRESH_TOKEN, None)
      --> 196 raise SliceManagerException(tokens.get(CredmgrProxy.ERROR))
      
      SliceManagerException: b'{n    "errors": [n        {n            "details": "error: Core API error occurred status_code: 404 message: b'{\\n  \"errors\": [\\n    {\\n      \"details\": \"No match for Project with uuid = \\'<488bd68e-9703-447b-bd77-069da4f438a6>\\'\",\\n      \"message\": \"Not Found\"\\n    }\\n  ],\\n  \"size\": 1,\\n  \"status\": 404,\\n  \"type\": \"error\"\\n}', refresh_token: XXX",n            "message": "Internal Server Error"n        }n    ],n    "size": 1,n    "status": 500,n    "type": "error"n}'

      Before this, I was running on the error on the screen attached.

      f626d2f6-9b13-4a48-bda5-f78bb60a0328

      It is mentioned that the token should be refreshed automatically, but even when I try to generate a new one via hub portal and restart the service the issue pertains. Has anyone faced the same issue before? Any suggestions on how to resolve this?

      Thanks in advance

      #6331
      Komal Thareja
      Participant

        Hi Shams,

        Could you please remove <> enclosing the project id in /home/fabric/work/fabric_config/fabric_rc and restart your JH container via File -> Hub Control Panel -> Stop Container followed by Start Container?

        Please try your notebook again and let us know if you still observe this error.

        Thanks,

        Komal

        #6333
        Shams Gozalova
        Participant

          Hi Komal,

          Thank you so much, it worked just fine!

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘Unable to use fablib.manager’ is closed to new replies.
        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)