1. error in slice submit : `refresh_token` must not be `None`

error in slice submit : `refresh_token` must not be `None`

Home Forums FABRIC General Questions and Discussion error in slice submit : `refresh_token` must not be `None`

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2800
    Gregory Daues
    Participant

      For either Fabric Release 1.2.x or 1.3  client-side  I am now seeing an error in slice submit  :

      ValueError: Invalid value for refresh_token, must not be None

      for scripts that were working, say early August.     Is there an update for settings for  tokens client side ?
      I have the standard FABRIC_TOKEN_LOCATION set.

       

      #2804
      Komal Thareja
      Participant

        Hi Gregory,

        Thank you for reporting this issue. Could you please share the snapshot of the stacktrace if available where this error is observed or share your notebook?

        Also, could you please share the output of the command below?

        cat /opt/conda/lib/python3.9/site-packages/fabrictestbed/__init__.py

        Also, are you using the Jupyter Hub or local desktop environment?

        If you are using the desktop environment, please consider updating the python environment using the following command:

        pip install fabrictestbed-extensions==1.3.0

        Thanks and Regards,

        Komal

        #2814
        Gregory Daues
        Participant

          I am working in a bash shell (‘local desktop’)   and 1.3.0 is installed .
          The lib/python3.9/site-packages/fabrictestbed/__init__.py  shows

          __VERSION__ = “1.3.0”

          and the  lib/python3.9/site-packages/fabrictestbed_extensions/__init__.py  shows

          #

          __VERSION__ = “1.3.0”

          I’ll try to gather more details.

           

          #2815
          Gregory Daues
          Participant

            The stacktrace looked like the following :

            Exception: Invalid value for refresh_token, must not be None

            Traceback (most recent call last):

            File “/global/u2/g/gdaues/Get2/create_utah_salt_L2.py”, line 44, in <module>

            slice = fablib.new_slice(name=slice_name)

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 335, in new_slice

            return fablib.get_default_fablib_manager().new_slice(name)

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 57, in get_default_fablib_manager

            fablib.default_fablib_manager = FablibManager()

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 662, in __init__

            self.build_slice_manager()

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 757, in build_slice_manager

            raise e

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed_extensions/fablib/fablib.py”, line 745, in build_slice_manager

            self.slice_manager = SliceManager(oc_host=self.orchestrator_host,

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 70, in __init__

            self.initialize()

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 79, in initialize

            self.__load_tokens()

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 124, in __load_tokens

            self.refresh_tokens(refresh_token=refresh_token)

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabrictestbed/slice_manager/slice_manager.py”, line 157, in refresh_tokens

            status, tokens = self.cm_proxy.refresh(project_id=self.project_id, scope=self.scope,

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/credmgr_proxy.py”, line 89, in refresh

            body = swagger_client.Request(refresh_token)

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/swagger_client/models/request.py”, line 42, in __init__

            self.refresh_token = refresh_token

            File “/global/homes/g/gdaues/.local/lib/python3.9/site-packages/fabric_cm/credmgr/swagger_client/models/request.py”, line 65, in refresh_token

            raise ValueError(“Invalid value for refresh_token, must not be None“)  # noqa: E501

            ValueError: Invalid value for refresh_token, must not be None

            #2817
            Komal Thareja
            Participant

              Could you please invoke the show_config() and share the output before invoking new slice?
              Also, could you please verify that the token file has refresh_token and json looks like below:

              P.S: You may already have it in correct format.

              
              {"id_token": "YOUR ID Token",
              "refresh_token": "YOUR Refresh Token",
              "created_at": "timestamp"}
              
              fablib.default_fablib_manager = FablibManager()
              
              fablib.show_config()

              show_config would list the token file being used, please verify that it is correct.

              Thanks,

              Komal

              #2818
              Gregory Daues
              Participant

                Yes it looks like a matter of  an invalid or corrupted token. Somehow I ended up working with a token with
                these contents:

                > cat cmbs4_1_tokens.json

                {“id_token”: null, “refresh_token”: null, “created_at”: “2022-09-01 15:31:47”}

                I have since worked through the credential manager , and downloaded a token with valid entries,
                and slice submission has succeeded.   So I guess I may have worked through the credential manager  with an expired session(?)  or something to obtain / download such a malformed token.
                So I think my issue is resolved, where I will examine the downloaded tokens as a check.

                Thanks,

                Greg

                 

                 

                 

                #3628
                Nagmat Nazarov
                Participant

                  I am getting :

                  “Exception: b'{\n “errors”: [\n {\n “details”: “(invalid_grant) invalid refresh token”,\n “message”: “Internal Server Error”\n }\n ],\n “size”: 1,\n “status”: 500,\n “type”: “error”\n}'” as shown in the picture.

                  What am I doing wrong?

                  #3688
                  Paul Ruth
                  Keymaster

                    The most likely reasons for this are either the token expired or you config is not pointing to the valid token.

                    If you are in the FABRIC JupyterHub, you can get a new token by logging out the back in.  If you still see this error then you should confirm you configuration is correct. You can print you configuration with fablib.show_config() . The default location of the token in the FABRIC JupyterHub is: /home/fabric/.tokens.json

                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.