Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Fix SCP error raised in sky check #3038

Merged
merged 1 commit into from
Jan 27, 2024
Merged

Conversation

cblmemo
Copy link
Collaborator

@cblmemo cblmemo commented Jan 27, 2024

To reproduce: in an environment that does not have scp credentials, run sky check:

$ sky check
Checking SCP...Traceback (most recent call last):
  File "/home/txia/miniconda3/envs/skyserve/bin/sky", line 8, in <module>
    sys.exit(cli())
  File "/home/txia/miniconda3/envs/skyserve/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/txia/miniconda3/envs/skyserve/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/txia/skypilot/sky/utils/common_utils.py", line 315, in _record
    return f(*args, **kwargs)
  File "/home/txia/skypilot/sky/cli.py", line 1219, in invoke
    return super().invoke(ctx)
  File "/home/txia/miniconda3/envs/skyserve/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/txia/miniconda3/envs/skyserve/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/txia/miniconda3/envs/skyserve/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/txia/skypilot/sky/utils/common_utils.py", line 336, in _record
    return f(*args, **kwargs)
  File "/home/txia/skypilot/sky/cli.py", line 3519, in check
    sky_check.check(verbose=verbose)
  File "/home/txia/skypilot/sky/check.py", line 20, in check
    ok, reason = cloud.check_credentials()
  File "/home/txia/skypilot/sky/clouds/scp.py", line 312, in check_credentials
    scp_utils.SCPClient().list_instances()
  File "/home/txia/skypilot/sky/clouds/utils/scp_utils.py", line 318, in list_instances
    return self._get(url)
  File "/home/txia/skypilot/sky/clouds/utils/scp_utils.py", line 140, in method_with_retries
    return method(self, *args, **kwargs)
  File "/home/txia/skypilot/sky/clouds/utils/scp_utils.py", line 191, in _get
    raise_scp_error(response)
  File "/home/txia/skypilot/sky/clouds/utils/scp_utils.py", line 114, in raise_scp_error
    raise SCPCreationFailError(f'{status_code}: {message}')
sky.clouds.utils.scp_utils.SCPCreationFailError: 404: Access key not found

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • sky check
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@concretevitamin
Copy link
Collaborator

Inside a docker

# sky -v
skypilot, version 1.0.0.dev20240126

sky check didn't show this issue?

  SCP: disabled
    Reason: Failed to access SCP with credentials. To configure credentials, see: https://cloud.samsungsds.com/openapiguide
    Generate API key and add the following line to ~/.scp/scp_credential:
      access_key = [YOUR API ACCESS KEY]
      secret_key = [YOUR API SECRET KEY]
      project_id = [YOUR PROJECT ID]

@cblmemo
Copy link
Collaborator Author

cblmemo commented Jan 27, 2024

Inside a docker

# sky -v
skypilot, version 1.0.0.dev20240126

sky check didn't show this issue?

  SCP: disabled
    Reason: Failed to access SCP with credentials. To configure credentials, see: https://cloud.samsungsds.com/openapiguide
    Generate API key and add the following line to ~/.scp/scp_credential:
      access_key = [YOUR API ACCESS KEY]
      secret_key = [YOUR API SECRET KEY]
      project_id = [YOUR PROJECT ID]

I assume it is the result of an invalid credential in ~/.scp/scp_credential, where in the docker the file does not exist. Could you add the following to the file and try again?

access_key = abc
secret_key = def
project_id = PROJECT-ghi

@cblmemo cblmemo merged commit 5530822 into master Jan 27, 2024
19 checks passed
@cblmemo cblmemo deleted the fix-scp-check-errior branch January 27, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants