Closed brightzheng100 closed 3 years ago
Could you please share the output of the "Run on Kubernetes - Detailed" output window when it stalls out?
The tricky thing is: there was no such an output window, and what I could see is like below attached.
Meanwhile, if I clicked minikube
button at the status bar, I had no way to proceed as when prompting "Choose minikube cluster (profile) to control (1/2)", I could do nothing -- I tried with and without minikubw
spun up outside to see whether it would detect and let me choose.
Hmm ok. Let's try something else then to verify minikube, since that looks like it is at the center of the problem here.
Could you make sure you have the vscode setting cloudcode.autoDependencies
set to 'on'? It should look like this.
If it is set to 'on', could you please run this command to test the minikube binary Cloud Code uses: ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk/bin/minikube profile list
Yes, the Cloudcode: Auto Dependencies
is on.
But obviously the minikube
is not there:
$ ls ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk/bin
anthoscli bq docker-credential-gcloud gcloud gsutil
bootstrapping dev_appserver.py endpointscfg.py git-credential-gcloud.sh java_dev_appserver.sh
$ which minikube
/usr/local/bin/minikube
# As I've deleted minikube instance, no profile exists for now
# But it would be the same even if I spun up minikube
$ minikube profile list
I1209 10:26:09.533144 93487 translate.go:65] Getting system locale failed: Could not detect Language
❌ Exiting due to MK_USAGE: No minikube profile was found. You can create one using `minikube start`.
$ minikube config view
I1209 10:26:57.927959 93510 translate.go:65] Getting system locale failed: Could not detect Language
- kubernetes-version: v1.19.4
- memory: 4096
Hmmm ok. Looks like all your gcloud components failed to install here. Can you provide the output of ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk/bin/gcloud components list
I re-installed Google Cloud SDK carefully by following the official doc, without running gcloud init
(as to avoid a login).
Then I re-installed Cloud Code
addon in VS Code and reloaded it.
Now as per your request:
$ ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk/bin/gcloud components list
Traceback (most recent call last):
File "/Users/brightzheng/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/brightzheng/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/brightzheng/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/brightzheng/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/usr/local/Cellar/python@3.9/3.9.0_3/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/brightzheng/Library/Application Support/cloud-code/installer/google-cloud-sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
I may have to do some python troubleshooting
BTW, just realized that I installed the latest Google Cloud SDK
in another folder.
$ pwd
/Users/brightzheng/development/gcp/google-cloud-sdk
$ which gcloud
/Users/brightzheng/development/gcp/google-cloud-sdk/bin/gcloud
$ ./bin/gcloud components list
Your current Cloud SDK version is: 320.0.0
The latest available version is: 320.0.0
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Components │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬──────────┤
│ Status │ Name │ ID │ Size │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
│ Not Installed │ App Engine Go Extensions │ app-engine-go │ 4.8 MiB │
│ Not Installed │ Appctl │ appctl │ 18.5 MiB │
│ Not Installed │ Cloud Bigtable Command Line Tool │ cbt │ 7.6 MiB │
│ Not Installed │ Cloud Bigtable Emulator │ bigtable │ 6.6 MiB │
│ Not Installed │ Cloud Datalab Command Line Tool │ datalab │ < 1 MiB │
│ Not Installed │ Cloud Datastore Emulator │ cloud-datastore-emulator │ 18.4 MiB │
│ Not Installed │ Cloud Firestore Emulator │ cloud-firestore-emulator │ 42.1 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator │ pubsub-emulator │ 56.3 MiB │
│ Not Installed │ Cloud SQL Proxy │ cloud_sql_proxy │ 7.4 MiB │
│ Not Installed │ Emulator Reverse Proxy │ emulator-reverse-proxy │ 14.5 MiB │
│ Not Installed │ Google Cloud Build Local Builder │ cloud-build-local │ 6.2 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr │ 1.8 MiB │
│ Not Installed │ Kind │ kind │ 4.4 MiB │
│ Not Installed │ Kustomize │ kustomize │ 22.8 MiB │
│ Not Installed │ Minikube │ minikube │ 22.8 MiB │
│ Not Installed │ Nomos CLI │ nomos │ 17.6 MiB │
│ Not Installed │ Skaffold │ skaffold │ 16.1 MiB │
│ Not Installed │ anthos-auth │ anthos-auth │ 16.4 MiB │
│ Not Installed │ config-connector │ config-connector │ 42.0 MiB │
│ Not Installed │ gcloud Alpha Commands │ alpha │ < 1 MiB │
│ Not Installed │ gcloud Beta Commands │ beta │ < 1 MiB │
│ Not Installed │ gcloud app Java Extensions │ app-engine-java │ 59.6 MiB │
│ Not Installed │ gcloud app PHP Extensions │ app-engine-php │ 21.9 MiB │
│ Not Installed │ gcloud app Python Extensions │ app-engine-python │ 6.1 MiB │
│ Not Installed │ gcloud app Python Extensions (Extra Libraries) │ app-engine-python-extras │ 27.1 MiB │
│ Not Installed │ kpt │ kpt │ 12.0 MiB │
│ Not Installed │ kubectl │ kubectl │ < 1 MiB │
│ Not Installed │ kubectl-oidc │ kubectl-oidc │ 16.4 MiB │
│ Not Installed │ pkg │ pkg │ │
│ Installed │ BigQuery Command Line Tool │ bq │ < 1 MiB │
│ Installed │ Cloud SDK Core Libraries │ core │ 15.8 MiB │
│ Installed │ Cloud Storage Command Line Tool │ gsutil │ 3.5 MiB │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴──────────┘
So I guess I have to install to the hardcoded folder ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk
instead, and I may have to install another copy of minikube
as it states that Minikube is not installed (but actually it is installed outside and accessible through $PATH).
Is my understanding right?
The cloud SDK that that cloud-code SDK automatically installed seems corrupted. Can you try the workaround mentioned in #332 ? We are looking to address the issue in our next release. Dupe of the task #310
After deleting the files under ~/Library/Application\ Support/cloud-code/installer/google-cloud-sdk
and copying over all files from a new unzip of the latest Google Cloud SDK, it now goes further:
minikube
with VM Driver
as docker
starts working fine;Run on Kubernetes
starts working fine;But I haven't had a chance to make Debug on Kubernetes
work.
skaffold debug
should look like;@brightzheng100 - Are you using "Go" guestbook sample application for debugging on k8? Can you share your logs from the "Run on Kubernetes - Detailed" output window? thanks.
Environment: Extension version: 1.7.0 VSCode version: 1.51.1 OS: darwin
Description:
Trying to follow the doc to walk through the "hello world" process but I could see only a message like this, no other process was made:
Repro step:
cloud-code
extension;Minikube
was working fine and the icon was displayed in Cloud Code status bar;To view more detailed logs, go to Output channel : "Run on Kubernetes - Detailed"