Coder Social home page Coder Social logo

googlecloudplatform / gce-rescue Goto Github PK

View Code? Open in Web Editor NEW
33.0 19.0 2.0 210 KB

GCE Rescue is a command-line tool to boot Google Cloud Platform VMs in Rescue Mode. Topics

License: Apache License 2.0

Makefile 0.66% Python 97.52% Shell 1.81%
boot-disk bootdisk cloud gce gce-instance gcp google rescue rescue-system troubleshooting

gce-rescue's People

Contributors

dependabot[bot] avatar halleysouza avatar runxinw avatar soulless-viewer avatar tomerlf1 avatar tomerlf44 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gce-rescue's Issues

`"Would you like to restore the original configuration"` Prompt Fails with Lowercase `y`

when answering lowercase y (not uppercase Y) to the "Would you like to restore the original configuration" prompt it is not accepted and instead Cancelled.

example:

% gce-rescue --zone us-central1-a --name example                                                                  
The instance "example" is currently configured to boot as rescue mode since 2023-02-05 00:00:00.
Would you like to restore the original configuration ? [y/N]: y
Cancelled.

Tool crushes if the vm name is wrong

Gracefully handle erronous VMs and allow the user correct the name or even better suggest the correct name

gce-rescue --zone europe-central2-a --name test
Traceback (most recent call last):
  File "/home/username/.local/bin/gce-rescue", line 8, in <module>
    sys.exit(main())
  File "/home/username/.local/lib/python3.9/site-packages/gce_rescue/bin/rescue.py", line 44, in main
    vm = Instance(test_mode=False, **parse_kwargs)
  File "<string>", line 12, in __init__
  File "/home/username/.local/lib/python3.9/site-packages/gce_rescue/gce.py", line 116, in __post_init__
    self.compute = check.compute
  File "/home/username/.local/lib/python3.9/site-packages/gce_rescue/tasks/pre_validations.py", line 52, in compute
    return self._authentication()
  File "/home/username/.local/lib/python3.9/site-packages/gce_rescue/tasks/pre_validations.py", line 39, in _authentication
    return authenticate_check(
  File "/home/username/.local/lib/python3.9/site-packages/gce_rescue/tasks/validations/authentication.py", line 66, in authenticate_check
    request.execute()
  File "/usr/local/lib/python3.9/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/googleapiclient/http.py", line 938, in execute
    raise HttpError(resp, content, uri=self.uri)

importlib.metadata.PackageNotFoundError: No package metadata was found for gce-rescue

Hi

Can you please advise on below error message ?

importlib.metadata.PackageNotFoundError: No package metadata was found for gce-rescue
cq032_t1@cloudshell:~ (dbg-clearstream-simu-fe9d0e70)$ gce-rescue -z europe-west3-a -
Traceback (most recent call last):
File "/home/cq032_t1/.local/bin/gce-rescue", line 33, in
sys.exit(load_entry_point('gce-rescue==0.4b0', 'console_scripts', 'gce-rescue')()
File "/home/cq032_t1/.local/bin/gce-rescue", line 22, in importlib_load_entry_point
for entry_point in distribution(dist_name).entry_points
File "/usr/lib/python3.10/importlib/metadata/init.py", line 969, in distributio
return Distribution.from_name(distribution_name)
File "/usr/lib/python3.10/importlib/metadata/init.py", line 548, in from_name
raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for gce-rescue

Thanks for your help

google.auth.exceptions.RefreshError: ('invalid_scope: Invalid OAuth scope or ID token audience provided.', {'error': 'invalid_scope', 'error_description': 'Invalid OAuth scope or ID token audience provided.'})

Hi

Can not use adc authentication via service account for gce-rescue

Can you please advise ?

[gce-rescue]#
[root@gce-rescue]# export GOOGLE_APPLICATION_CREDENTIALS="/root/gce-rescue/auth-simu.json"
[root@gce-rescue]# /usr/bin/gce-rescue -p dbg-cs-sz-32064e0b -z europe-west3-a -n gcsb84rhel098
Traceback (most recent call last):
File "/usr/bin/gce-rescue", line 33, in
sys.exit(load_entry_point('gce-rescue==0.4b0', 'console_scripts', 'gce-rescue')())
File "/usr/lib/python3.9/site-packages/gce_rescue-0.4b0-py3.9.egg/gce_rescue/bin/rescue.py", line 44, in main
vm = Instance(test_mode=False, **parse_kwargs)
File "", line 12, in init
File "/usr/lib/python3.9/site-packages/gce_rescue-0.4b0-py3.9.egg/gce_rescue/gce.py", line 112, in post_init
check = Validations(
File "", line 7, in init
File "/usr/lib/python3.9/site-packages/gce_rescue-0.4b0-py3.9.egg/gce_rescue/tasks/pre_validations.py", line 48, in post_init
authorize_check(project = self.project)
File "/usr/lib/python3.9/site-packages/gce_rescue-0.4b0-py3.9.egg/gce_rescue/tasks/validations/authorization.py", line 43, in authorize_check
result = service.projects().testIamPermissions(
File "/usr/lib/python3.9/site-packages/google_api_python_client-2.125.0-py3.9.egg/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/google_api_python_client-2.125.0-py3.9.egg/googleapiclient/http.py", line 923, in execute
resp, content = _retry_request(
File "/usr/lib/python3.9/site-packages/google_api_python_client-2.125.0-py3.9.egg/googleapiclient/http.py", line 191, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/google_auth_httplib2-0.2.0-py3.9.egg/google_auth_httplib2.py", line 209, in request
self.credentials.before_request(self._request, method, uri, request_headers)
File "/usr/local/lib/python3.9/site-packages/google/auth/credentials.py", line 228, in before_request
self._blocking_refresh(request)
File "/usr/local/lib/python3.9/site-packages/google/auth/credentials.py", line 191, in _blocking_refresh
self.refresh(request)
File "/usr/local/lib/python3.9/site-packages/google/oauth2/service_account.py", line 441, in refresh
access_token, expiry, _ = _client.jwt_grant(
File "/usr/local/lib/python3.9/site-packages/google/oauth2/_client.py", line 308, in jwt_grant
response_data = _token_endpoint_request(
File "/usr/local/lib/python3.9/site-packages/google/oauth2/_client.py", line 279, in _token_endpoint_request
_handle_error_response(response_data, retryable_error)
File "/usr/local/lib/python3.9/site-packages/google/oauth2/_client.py", line 72, in _handle_error_response
raise exceptions.RefreshError(
google.auth.exceptions.RefreshError: ('invalid_scope: Invalid OAuth scope or ID token audience provided.', {'error': 'invalid_scope', 'error_description': 'Invalid OAuth scope or ID token audience provided.'})
[root@ gce-rescue]#

Thanks for your support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.