Closed marceloverdijk closed 2 years ago
The failure is when trying to call gcloud here.
It would be nice if this code printed the contents CommandExecutionException.getErrorLog()
before throwing a new ManagedSdkVerificationException
.
@marceloverdijk Could you try to manually run gcloud components list --format=json "--filter=state.name:Update Available"
?
❯ gcloud components list --format=json "--filter=state.name:Update Available"
Your current Google Cloud CLI version is: 397.0.0
The latest available version is: 397.0.0
[]
Could you also try to run the diagnostic app here: https://github.com/elefeint/appengine-diagnosis , and capture the output?
The plugin installs a private Cloud CLI at /Users/<my-user-name>/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk
on Mac by default (unless you configure cloudSdkHome
). Your own gcloud installation through homebrew is an independent one, so running gcloud
on the command-line is meaningless.
@chanseokoh what do you mean with running gcloud
on the command-line is meaningless.
I'm currently using gcloud app deploy
to deploy my app successfully.
It's likely that you have two separate copies of gcloud. One on PATH
and executed when running gcloud
on the command-line, and the other one installed and used by the Gradle plugin. The error is coming from the latter Cloud CLI. Please check the linked issue to understand the situation better.
Yes that might be the case indeed:
appengine-diagnosis
❯ which gcloud
/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin/gcloud
appengine-diagnosis
❯ mvn package exec:java
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.example:diagnosis >------------------------
[INFO] Building diagnosis 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ diagnosis ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/marceloverdijk/workspace/appengine-diagnosis/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:compile (default-compile) @ diagnosis ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ diagnosis ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/marceloverdijk/workspace/appengine-diagnosis/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ diagnosis ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ diagnosis ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ diagnosis ---
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:java (default-cli) @ diagnosis ---
SDK home: /Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk
gcloud path: /Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/bin/gcloud
*** CommandExitException; error log = [
Traceback (most recent call last):
File "/Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/usr/local/Cellar/python@3.9/3.9.13_2/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.13_2/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.13_2/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.13_2/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.13_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/marceloverdijk/Library/Application Support/google-cloud-tools-java/managed-cloud-sdk/LATEST/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'
] ***
com.google.cloud.tools.managedcloudsdk.command.CommandExitException: Process failed with exit code: 1
at com.google.cloud.tools.managedcloudsdk.command.CommandCaller.call(CommandCaller.java:70)
at Main.main(Main.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:282)
at java.lang.Thread.run(Thread.java:819)
[WARNING]
java.lang.NullPointerException
at Main.main (Main.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:282)
at java.lang.Thread.run (Thread.java:819)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.933 s
[INFO] Finished at: 2022-08-11T16:56:02+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project diagnosis: An exception occured while executing the Java class. null: NullPointerException -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Although I'm not sure what I would have to change nog?
That's a python versioning problem. Don't you love technology...
See if any suggestions here help: https://stackoverflow.com/questions/64010263/attributeerror-module-importlib-has-no-attribute-util
thx for mentioning. I might have a look later, but gcloud app deploy
works for me now so for now I will go that path.
I will close the issue, but at least we have this for reference.
Just freshly installed the gcloud CLI using homebrew, but the
id "com.google.cloud.tools.appengine-appyaml" version "2.4.4"
Gradle plugin doesn't seem to like it.It fails with the
downloadCloudSdk
task... but for the rest no info logged that could indicate what is wrond.