diff --git a/flytekit/clients/auth/authenticator.py b/flytekit/clients/auth/authenticator.py index 95a89422be..f3944ecbfa 100644 --- a/flytekit/clients/auth/authenticator.py +++ b/flytekit/clients/auth/authenticator.py @@ -179,12 +179,15 @@ def refresh_credentials(self): This function is used when the configuration value for AUTH_MODE is set to 'external_process'. It reads an id token generated by an external process started by running the 'command'. """ - logging.debug("Starting external process to generate id token. Command {}".format(self._cmd)) + cmd_joined = " ".join(self._cmd) + logging.debug("Starting external process to generate id token. Command `{}`".format(" ".join(cmd_joined))) try: output = subprocess.run(self._cmd, capture_output=True, text=True, check=True) - except subprocess.CalledProcessError as e: - logging.error("Failed to generate token from command {}".format(self._cmd)) - raise AuthenticationError("Problems refreshing token with command: " + str(e)) + except subprocess.CalledProcessError: + logging.error("Failed to generate token from command `{}`".format(cmd_joined)) + raise AuthenticationError( + f"Failed to refresh token with command `{cmd_joined}`. Please execute this command in your terminal to debug." + ) self._creds = Credentials(output.stdout.strip())