GoogleCloudPlatform/getting-started-java

GCLOUD: agent library failed to init: instrument

jmayday opened this issue · 1 comments

I'm just starting with GCP and stuck on some issue trying to run appengine:run

This is part of maven output:

[INFO] --- appengine-maven-plugin:2.2.0:run (default-cli) @ bookshelf-standard-2 ---
lut 15, 2020 5:02:44 PM com.google.cloud.tools.appengine.operations.DevAppServerRunner run
INFO: submitting command: /usr/lib/jvm/java-8-openjdk/jre/bin/java -javaagent:/home/kuba/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/agent/appengine-agent.jar -Dappengine.sdk.root=/home/kuba/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java -cp /home/kuba/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/appengine-tools-api.jar com.google.appengine.tools.development.DevAppServerMain --application=bookshelf-268314 --allow_remote_shutdown --disable_update_check /home/kuba/Downloads/getting-started-java/bookshelf-standard/2-structured-data/target/bookshelf-standard-2-1.0-SNAPSHOT
[INFO] GCLOUD: Error opening zip file or JAR manifest missing : /home/kuba/.cache/google-cloud-tools-java/managed-cloud-sdk/LATEST/google-cloud-sdk/platform/google_appengine/google/appengine/tools/java/lib/agent/appengine-agent.jar
[INFO] GCLOUD: Error occurred during initialization of VM
[INFO] GCLOUD: agent library failed to init: instrument

Indeed, there is nothing like appengine-agent.jar under that directory.

I've tried downgrading components as suggested here: https://www.gitmemory.com/issue/GoogleCloudPlatform/firebase-appengine-backend/21/495412096

This is my current setup:

➜  2-structured-data git:(master) ✗ gcloud components list         

Your current Cloud SDK version is: 240.0.0
The latest available version is: 280.0.0

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                   Components                                                  │
├──────────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬──────────┤
│      Status      │                         Name                         │            ID            │   Size   │
├──────────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
│ Update Available │ BigQuery Command Line Tool                           │ bq                       │  < 1 MiB │
│ Update Available │ Cloud SDK Core Libraries                             │ core                     │ 13.3 MiB │
│ Update Available │ Cloud Storage Command Line Tool                      │ gsutil                   │  3.6 MiB │
│ Update Available │ gcloud app Java Extensions                           │ app-engine-java          │ 62.2 MiB │
│ Update Available │ gcloud app Python Extensions                         │ app-engine-python        │  6.1 MiB │
│ Not Installed    │ App Engine Go Extensions                             │ app-engine-go            │  4.9 MiB │
│ Not Installed    │ Appctl                                               │ appctl                   │ 21.0 MiB │
│ Not Installed    │ Cloud Bigtable Command Line Tool                     │ cbt                      │  7.5 MiB │
│ Not Installed    │ Cloud Bigtable Emulator                              │ bigtable                 │  6.6 MiB │
│ Not Installed    │ Cloud Datalab Command Line Tool                      │ datalab                  │  < 1 MiB │
│ Not Installed    │ Cloud Firestore Emulator                             │ cloud-firestore-emulator │ 40.2 MiB │
│ Not Installed    │ Cloud Pub/Sub Emulator                               │ pubsub-emulator          │ 34.9 MiB │
│ Not Installed    │ Cloud SQL Proxy                                      │ cloud_sql_proxy          │  3.8 MiB │
│ Not Installed    │ Emulator Reverse Proxy                               │ emulator-reverse-proxy   │ 14.5 MiB │
│ Not Installed    │ Google Cloud Build Local Builder                     │ cloud-build-local        │  6.0 MiB │
│ Not Installed    │ Google Container Registry's Docker credential helper │ docker-credential-gcr    │  1.8 MiB │
│ Not Installed    │ Kind                                                 │ kind                     │  4.5 MiB │
│ Not Installed    │ Minikube                                             │ minikube                 │ 19.2 MiB │
│ Not Installed    │ Skaffold                                             │ skaffold                 │ 12.1 MiB │
│ Not Installed    │ gcloud Alpha Commands                                │ alpha                    │  < 1 MiB │
│ Not Installed    │ gcloud Beta Commands                                 │ beta                     │  < 1 MiB │
│ Not Installed    │ gcloud app PHP Extensions                            │ app-engine-php           │          │
│ Not Installed    │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras │ 27.1 MiB │
│ Not Installed    │ kpt                                                  │ kpt                      │ 10.0 MiB │
│ Not Installed    │ kubectl                                              │ kubectl                  │  < 1 MiB │
│ Installed        │ Cloud Datastore Emulator                             │ cloud-datastore-emulator │ 18.4 MiB │
└──────────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴──────────┘
To install or remove components at your current SDK version [240.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [280.0.0], run:
  $ gcloud components update

➜  2-structured-data git:(master) ✗ java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

➜  2-structured-data git:(master) ✗ mvn --version
Apache Maven 3.6.3 (NON-CANONICAL_2019-11-27T20:26:29Z_root)
Maven home: /opt/maven
Java version: 1.8.0_242, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk/jre
Default locale: pl_PL, platform encoding: UTF-8
OS name: "linux", version: "5.4.19-1-lts", arch: "amd64", family: "unix"

Seems like documentation/source code is out-of-date and appengine-web.xml needed

<runtime>java8</runtime>

found on stackoverflow: https://stackoverflow.com/a/57729455