googlecloudplatform / gce-rescue Goto Github PK
View Code? Open in Web Editor NEWGCE Rescue is a command-line tool to boot Google Cloud Platform VMs in Rescue Mode. Topics
License: Apache License 2.0
GCE Rescue is a command-line tool to boot Google Cloud Platform VMs in Rescue Mode. Topics
License: Apache License 2.0
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 is failing while attempting to create boot disk snapshot, due location constraint [1]
Next: Make sure the tool is resilient enough to overcome situation like that.
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)
move instance's current rescue properties and methods to the rescuer
pls see commit: 802d9f7
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
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
On ubuntu 18 LTS, the repository python version is 3.6.9 for now, which can not run this if not installing newer version of python.
VM boot, in rescue mode, takes too long and GCE Rescue throws an exception while waiting for startup-script completion.
gce-rescue/gce_rescue/tasks/metadata.py
Line 71 in bf17bf8
Need to find an alternative for this scenario.
gce-rescue/gce_rescue/tasks/metadata.py
Line 72 in bf17bf8
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.