Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to debug and test the sample telemetry plugin #20574

Closed
kollachaitanyakrishna opened this issue Oct 4, 2021 · 28 comments
Closed

Unable to debug and test the sample telemetry plugin #20574

kollachaitanyakrishna opened this issue Oct 4, 2021 · 28 comments
Assignees
Labels
area/telemetry Issues related to Che telemetry feature kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. sprint/current

Comments

@kollachaitanyakrishna
Copy link

kollachaitanyakrishna commented Oct 4, 2021

Summary

I followed the sample mentioned and created the sample, https://www.eclipse.org/che/docs/che-7/extensions/creating-a-telemetry-plugin/.

My sample Code: https://github.com/kollachaitanyakrishna/che-telemetry-pluginsample
Step1: Clone the code
step 2: update the events url "AnalyticsManager.Java" at line 53 to replace to an api
Step 3: Build with "mvn quarkus:dev --DskipTests"

After the build, unable to proceed to test the app with the run command on the build image on kubernetes

I am getting an error as below
Screenshot 2021-10-04 at 5 48 18 PM

May i know the procedure to be followed to test the telemetry.

Relevant information

No response

@kollachaitanyakrishna kollachaitanyakrishna added the kind/question Questions that haven't been identified as being feature requests or bugs. label Oct 4, 2021
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Oct 4, 2021
@svor svor added area/telemetry Issues related to Che telemetry feature and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Oct 4, 2021
@svor
Copy link
Contributor

svor commented Oct 4, 2021

@ibuziuk could you take a look please

@kollachaitanyakrishna
Copy link
Author

@svor , @ibuziuk : can you help me, I followed all instructions mentioned as per the sample, but I am unable to execute the app, Sharing the sample log of my error.

Pulling image "quay.io/eclipse/che-plugin-metadata-broker:v3.4.0"

Successfully pulled image "quay.io/eclipse/che-plugin-metadata-broker:v3.4.0" in 4.776218054s

Created container che-plugin-metadata-broker-v3-4-0

Started container che-plugin-metadata-broker-v3-4-0

Starting plugin metadata broker

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Broker configuration

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Push endpoint: ws://che-host.eclipse-che.svc:8080/api/websocket

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Auth enabled: true

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Runtime ID:

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Workspace: workspaceb60omxb2c9mavvzq

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Environment: default

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 OwnerId: b07e3a58-ed50-4a6e-be17-fcf49ff8b242

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Self signed certificate /tmp/che/secret/ca.crt

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Starting plugin metadata broker

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:42 Fetching plugin meta.yaml from http://plugin-registry.eclipse-che.svc:8080/v3/plugins/redhat/java/latest/meta.yaml

All plugin metadata has been successfully processed

List of plugins and editors to install

  • redhat/java/latest - Java Linting, Intellisense, formatting, refactoring, Maven/Gradle support and more...

  • demo-publisher/little-telemetry-backend/0.0.1 - A Demo telemetry backend

  • eclipse/che-theia/latest - Eclipse Theia

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:44 Fetching plugin meta.yaml from http://plugin-registry.eclipse-che.svc:8080/v3/plugins/eclipse/che-theia/latest/meta.yaml

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:44 List of plugins and editors to install

[che-plugin-metadata-broker-v3-4-0] -> - redhat/java/latest - Java Linting, Intellisense, formatting, refactoring, Maven/Gradle support and more...

[che-plugin-metadata-broker-v3-4-0] -> - demo-publisher/little-telemetry-backend/0.0.1 - A Demo telemetry backend

[che-plugin-metadata-broker-v3-4-0] -> - eclipse/che-theia/latest - Eclipse Theia

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:44 All plugin metadata has been successfully processed

[che-plugin-metadata-broker-v3-4-0] -> 2021/10/11 17:05:44 [{"id":"redhat/java/latest","version":"latest","name":"java","publisher":"redhat","endpoints":null,"containers":[{"name":"vscode-java","image":"quay.io/eclipse/che-plugin-sidecar@sha256:974dd0a5ab7e075d7d344af2e8e2a2f80a069e8a5a4c9ffc2a57e421b62aa17a","env":[{"name":"CHE_THEIA_SIDECAR_PREFERENCES","value":"{"java.server.launchMode":"Standard"}"},{"name":"THEIA_PLUGINS","value":"local-dir:///plugins/sidecars/redhat_java_latest"},{"name":"PLUGIN_REMOTE_ENDPOINT_EXECUTABLE","value":"/remote-endpoint/plugin-remote-endpoint"}],"commands":null,"volumes":[{"mountPath":"/home/theia/.m2","name":"m2","ephemeral":false},{"mountPath":"/plugins","name":"plugins","ephemeral":false},{"mountPath":"/remote-endpoint","name":"remote-endpoint","ephemeral":true}],"ports":null,"cpuLimit":"500m","cpuRequest":"30m","memoryLimit":"1500Mi","memoryRequest":"20Mi","mountSources":true,"command":null,"args":null}],"initContainers":null,"workspaceEnv":null,"type":"VS Code extension"},{"id":"demo-publisher/little-telemetry-backend/0.0.1","version":"0.0.1","name":"little-telemetry-backend","publisher":"demo-publisher","endpoints":null,"containers":[{"name":"kollatelemetryplugin","image":"iad.ocir.io/orasenatdpltoci01/kollatelemetrybackend:latest","env":[{"name":"CHE_API","value":"$(CHE_API_INTERNAL)"}],"commands":null,"volumes":null,"ports":null,"mountSources":false,"command":null,"args":null}],"initContainers":null,"workspaceEnv":[{"name":"CHE_WORKSPACE_TELEMETRY_BACKEND_PORT","value":"4167"}],"type":"Che Plugin"},{"id":"eclipse/che-theia/latest","version":"latest","name":"che-theia","publisher":"eclipse","endpoints":[{"name":"theia","public":true,"targetPort":3100,"attributes":{"cookiesAuthEnabled":"true","discoverable":"false","protocol":"http","secure":"true","type":"ide"}},{"name":"webviews","public":true,"targetPort":3100,"attributes":{"cookiesAuthEnabled":"true","discoverable":"false","protocol":"http","secure":"true","type":"webview","unique":"true"}},{"name":"mini-browser","public":true,"targetPort":3100,"attributes":{"cookiesAuthEnabled":"true","discoverable":"false","protocol":"http","secure":"true","type":"mini-browser","unique":"true"}},{"name":"theia-dev","public":true,"targetPort":3130,"attributes":{"discoverable":"false","protocol":"http","type":"ide-dev"}},{"name":"theia-redirect-1","public":true,"targetPort":13131,"attributes":{"discoverable":"false","protocol":"http"}},{"name":"theia-redirect-2","public":true,"targetPort":13132,"attributes":{"discoverable":"false","protocol":"http"}},{"name":"theia-redirect-3","public":true,"targetPort":13133,"attributes":{"discoverable":"false","protocol":"http"}},{"name":"terminal","public":true,"targetPort":3333,"attributes":{"cookiesAuthEnabled":"true","discoverable":"false","protocol":"ws","secure":"true","type":"collocated-terminal"}}],"containers":[{"name":"theia-ide","image":"quay.io/eclipse/che-theia@sha256:61a84743fb515c217314ab8d3faca3cbf9054cf36d5d88b9eb0cfc50ad9cf830","env":[{"name":"THEIA_PLUGINS","value":"local-dir:///plugins"},{"name":"HOSTED_PLUGIN_HOSTNAME","value":"0.0.0.0"},{"name":"HOSTED_PLUGIN_PORT","value":"3130"},{"name":"THEIA_HOST","value":"127.0.0.1"}],"commands":null,"volumes":[{"mountPath":"/plugins","name":"plugins","ephemeral":false},{"mountPath":"/home/theia/.theia","name":"theia-local","ephemeral":false}],"ports":[{"exposedPort":3100},{"exposedPort":3130},{"exposedPort":13131},{"exposedPort":13132},{"exposedPort":13133}],"cpuLimit":"1500m","cpuRequest":"100m","memoryLimit":"512M","mountSources":true,"command":null,"args":null},{"name":"che-machine-exec","

Pulling image "quay.io/eclipse/che-theia-endpoint-runtime-binary@sha256:052dce024fbda437c79d1613d03df42fcf4c2bfcc294d5a130d9e6ffb01baabb"

Successfully pulled image "quay.io/eclipse/che-theia-endpoint-runtime-binary@sha256:052dce024fbda437c79d1613d03df42fcf4c2bfcc294d5a130d9e6ffb01baabb" in 1.652127543s

Created container remote-runtime-injectormev

Started container remote-runtime-injectormev

Pulling image "quay.io/eclipse/che-plugin-artifacts-broker:v3.4.0"

Successfully pulled image "quay.io/eclipse/che-plugin-artifacts-broker:v3.4.0" in 4.949826095s

Created container che-plugin-artifacts-broker-v3-4-0

Started container che-plugin-artifacts-broker-v3-4-0

Starting plugin artifacts broker

Processing plugin redhat/java/latest

Installing plugin extension 1/3

Plugin already downloaded

Installing plugin extension 2/3

Plugin already downloaded

Installing plugin extension 3/3

Plugin already downloaded

All plugin artifacts have been successfully downloaded

Saving log of installed plugins

Pulling image "quay.io/eclipse/che-jwtproxy:0.10.0"

Successfully pulled image "quay.io/eclipse/che-jwtproxy:0.10.0" in 6.430519141s

Created container che-jwtproxyxqorpvjv

Started container che-jwtproxyxqorpvjv

Pulling image "quay.io/eclipse/che-java11-maven:7.36.0"

Successfully pulled image "quay.io/eclipse/che-java11-maven:7.36.0" in 6.297870919s

Created container maven

Started container maven

Pulling image "quay.io/eclipse/che-plugin-sidecar@sha256:974dd0a5ab7e075d7d344af2e8e2a2f80a069e8a5a4c9ffc2a57e421b62aa17a"

Successfully pulled image "quay.io/eclipse/che-plugin-sidecar@sha256:974dd0a5ab7e075d7d344af2e8e2a2f80a069e8a5a4c9ffc2a57e421b62aa17a" in 1.209596271s

Created container vscode-javayw9

Started container vscode-javayw9

Pulling image "iad.ocir.io/orasenatdpltoci01/kollatelemetrybackend:latest"

Successfully pulled image "iad.ocir.io/orasenatdpltoci01/kollatelemetrybackend:latest" in 5.385517749s

Created container kollatelemetryplugincv0

Started container kollatelemetryplugincv0

Pulling image "quay.io/eclipse/che-theia@sha256:61a84743fb515c217314ab8d3faca3cbf9054cf36d5d88b9eb0cfc50ad9cf830"

[kollatelemetryplugincv0] -> standard_init_linux.go:228: exec user process caused: exec format error

[vscode-javayw9] -> imported

[vscode-javayw9] -> Starting the deployer with the list of resolvers [

[vscode-javayw9] -> LocalDirectoryPluginDeployerResolver {},

[vscode-javayw9] -> LocalFilePluginDeployerResolver {},

[vscode-javayw9] -> GithubPluginDeployerResolver { unpackedFolder: '/tmp/github-remote' },

[vscode-javayw9] -> HttpPluginDeployerResolver { unpackedFolder: '/tmp/http-remote' }

[vscode-javayw9] -> ]

[vscode-javayw9] -> Theia Endpoint 1/pid listening on port 2503

[vscode-javayw9] -> Configuration directory URI: 'file:///home/theia/.theia'

[vscode-javayw9] -> Found the list of default plugins ID on env: undefined

[vscode-javayw9] -> Found the list of plugins ID on env: local-dir:///plugins/sidecars/redhat_java_latest

[vscode-javayw9] -> Found the list of default plugins ID from CLI: undefined

[vscode-javayw9] -> The local plugin referenced by local-dir:/home/theia/.theia/plugins does not exist.

[vscode-javayw9] -> The local plugin referenced by local-dir:/home/theia/.theia/extensions does not exist.

[vscode-javayw9] -> [redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix]: trying to decompress into "/tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix"...

[vscode-javayw9] -> [redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix]: trying to decompress into "/tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix"...

[vscode-javayw9] -> [redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix]: trying to decompress into "/tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix"...

[vscode-javayw9] -> [redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix]: decompressed

[vscode-javayw9] -> [redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix]: decompressed

[vscode-javayw9] -> [redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix]: decompressed

[vscode-javayw9] -> PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix

[vscode-javayw9] -> Resolving "redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix" as a VS Code extension...

[vscode-javayw9] -> Resolved "redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix" to a VS Code extension "vscode-java-debug@0.26.0" with engines: { vscode: '^1.38.0' }

[vscode-javayw9] -> PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix

[vscode-javayw9] -> Resolving "redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix" as a VS Code extension...

[vscode-javayw9] -> Resolved "redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix" to a VS Code extension "java@0.75.0" with engines: { vscode: '^1.47.0' }

[vscode-javayw9] -> PluginTheiaDirectoryHandler: accepting plugin with path /tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix

[vscode-javayw9] -> Resolving "redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix" as a VS Code extension...

[vscode-javayw9] -> Resolved "redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix" to a VS Code extension "vscode-java-test@0.28.1" with engines: { vscode: '^1.52.0' }

[vscode-javayw9] -> Ignoring deploy of plug-in dependencies forredhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix

[vscode-javayw9] -> Ignoring deploy of plug-in dependencies forredhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix

[vscode-javayw9] -> Ignoring deploy of plug-in dependencies forredhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix

[vscode-javayw9] -> the accepted plugins are []

[vscode-javayw9] -> the acceptedFrontendPlugins plugins are []

[vscode-javayw9] -> the acceptedBackendPlugins plugins are [

[vscode-javayw9] -> PluginDeployerEntryImpl {

[vscode-javayw9] -> originId: 'local-dir:///plugins/sidecars/redhat_java_latest',

[vscode-javayw9] -> pluginId: 'redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix',

[vscode-javayw9] -> _type: 0,

[vscode-javayw9] -> map: Map { 'package.json' => [Object] },

[vscode-javayw9] -> changes: [ 'PluginVsCodeFileHandler', 'PluginVsCodeDirectoryHandler' ],

[vscode-javayw9] -> acceptedTypes: [ 1 ],

[vscode-javayw9] -> currentPath: '/tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix/extension',

[vscode-javayw9] -> initPath: '/plugins/sidecars/redhat_java_latest/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix',

[vscode-javayw9] -> resolved: true,

[vscode-javayw9] -> resolvedByName: 'LocalDirectoryPluginDeployerResolver',

[vscode-javayw9] -> _rootPath: '/tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix'

[vscode-javayw9] -> },

[vscode-javayw9] -> PluginDeployerEntryImpl {

[vscode-javayw9] -> originId: 'local-dir:///plugins/sidecars/redhat_java_latest',

[vscode-javayw9] -> pluginId: 'redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix',

[vscode-javayw9] -> _type: 0,

[vscode-javayw9] -> map: Map { 'package.json' => [Object] },

[vscode-javayw9] -> changes: [ 'PluginVsCodeFileHandler', 'PluginVsCodeDirectoryHandler' ],

[vscode-javayw9] -> acceptedTypes: [ 1 ],

[vscode-javayw9] -> currentPath: '/tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix/extension',

[vscode-javayw9] -> initPath: '/plugins/sidecars/redhat_java_latest/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix',

[vscode-javayw9] -> resolved: true,

[vscode-javayw9] -> resolvedByName: 'LocalDirectoryPluginDeployerResolver',

[vscode-javayw9] -> _rootPath: '/tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix'

[vscode-javayw9] -> },

[vscode-javayw9] -> PluginDeployerEntryImpl {

[vscode-javayw9] -> originId: 'local-dir:///plugins/sidecars/redhat_java_latest',

[vscode-javayw9] -> pluginId: 'redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix',

[vscode-javayw9] -> _type: 0,

[vscode-javayw9] -> map: Map { 'package.json' => [Object] },

[vscode-javayw9] -> changes: [ 'PluginVsCodeFileHandler', 'PluginVsCodeDirectoryHandler' ],

[vscode-javayw9] -> acceptedTypes: [ 1 ],

[vscode-javayw9] -> currentPath: '/tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix/extension',

[vscode-javayw9] -> initPath: '/plugins/sidecars/redhat_java_latest/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix',

[vscode-javayw9] -> resolved: true,

[vscode-javayw9] -> resolvedByName: 'LocalDirectoryPluginDeployerResolver',

[vscode-javayw9] -> _rootPath: '/tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix'

[vscode-javayw9] -> }

[vscode-javayw9] -> ]

[vscode-javayw9] -> local path to deploy on remote instance [

[vscode-javayw9] -> '/tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix/extension',

[vscode-javayw9] -> '/tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix/extension',

[vscode-javayw9] -> '/tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix/extension'

[vscode-javayw9] -> ]

[vscode-javayw9] -> Deploying backend plugin "vscode-java-debug@0.26.0" from "/tmp/vscode-unpacked/redhat.java.latest.ajjpkwngdz.vscode-java-debug-0.26.0.vsix/extension/dist/extension"

[vscode-javayw9] -> Deploying backend plugin "java@0.75.0" from "/tmp/vscode-unpacked/redhat.java.latest.vtpfovhrim.java-0.75.0-60.vsix/extension/dist/extension"

[vscode-javayw9] -> Deploying backend plugin "vscode-java-test@0.28.1" from "/tmp/vscode-unpacked/redhat.java.latest.zarpdfgntc.vscjava.vscode-java-test-0.28.1.vsix/extension/main.js"

[vscode-javayw9] -> Deploy plugins list took: 4679.1 ms

Failed to run the workspace: "The following containers have terminated: kollatelemetryplugincv0: reason = 'Error', exit code = 1, message = 'null'"

@kollachaitanyakrishna
Copy link
Author

@ibuziuk : may I know the timeline to fix the issue.

@dkwon17
Copy link
Contributor

dkwon17 commented Nov 18, 2021

Hello @kollachaitanyakrishna could you elaborate on what steps you took when packaging the backend application into a container image?

ie. the steps you took for the "Packaging the Quarkus application" section: https://www.eclipse.org/che/docs/che-7/extensions/creating-a-telemetry-plugin/#_packaging_the_quarkus_application

@kollachaitanyakrishna
Copy link
Author

@dkwon17 : I have create with the command "Step 3: Build with "mvn quarkus:dev --DskipTests", The same is mentioned in the beginning repro steps.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 19, 2021

looks like we need to provide more detailed packaging instructions in the docs. In the meantime, please take a look at https://github.com/che-incubator/che-workspace-telemetry-woopra-plugin (it contains concrete working implementation of the AnalyticsManager)

@kollachaitanyakrishna
Copy link
Author

@ibuziuk : we would like to build our custom solution, so we did not implement the WOOPRA. Please help us in providing the right instructions.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 19, 2021

@kollachaitanyakrishna could you point to the repository that is used for development? in any case you can see the way https://github.com/che-incubator/che-workspace-telemetry-woopra-plugin is packaged and use a similar approach for your solution

@kollachaitanyakrishna
Copy link
Author

@dkwon17
Copy link
Contributor

dkwon17 commented Nov 19, 2021

@kollachaitanyakrishna I was able to package your sample code and complete the steps in the docs with this docker file: https://gist.github.com/dkwon17/d575574526af669def21ae5111a5058b (make sure to place correct values on lines 7 and 28).

This dockerfile builds a native executable image for your plugin and I think this should solve your original issue. Please also see https://quarkus.io/version/1.11/guides/building-native-image#using-a-multi-stage-docker-build.

On a side note, I replaced https://github.com/kollachaitanyakrishna/che-telemetry-pluginsample/blob/40b508a441dba6605b491c89448c0a49f8c3ab33/pom.xml#L52-L56

with:

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.12</version>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>commons-logging-jboss-logging</artifactId>
    </dependency>

and also added quarkus.ssl.native=true to application.properties to get the Apache HTTP components library working on the native image (see step 3).

This is because org.apache.httpscomponents:httpclient uses Apache Commons logging and causes a ClassNotFoundException when running the Quarkus application in native mode. Please see: https://quarkus.io/guides/writing-native-applications-tips#logging-with-native-image.

Could you please try these steps and see if everything is working on your end?

@dkwon17
Copy link
Contributor

dkwon17 commented Nov 19, 2021

The steps above are for building the telemetry backend in native mode, but alternatively, you can try to build the image in JVM mode.

This line https://github.com/kollachaitanyakrishna/che-telemetry-pluginsample/blob/40b508a441dba6605b491c89448c0a49f8c3ab33/src/main/docker/Dockerfile.jvm#L39

should be changed to to:

ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=<your value of CHE_WORKSPACE_TELEMETRY_BACKEND_PORT> -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

then, the image can be built with:

mvn package -DskipTests && \
docker build -f src/main/docker/Dockerfile.jvm -t image:tag .

@kollachaitanyakrishna
Copy link
Author

@dkwon17 , @ibuziuk

I followed your instructions, but I am getting below error while running on local image.
exec java -Dquarkus.http.host=0.0.0.0 -Dquarkus.http.port=4167 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/app.jar

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/deployments/lib/org.jboss.slf4j.slf4j-jboss-logging-1.2.0.Final.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/deployments/lib/ch.qos.logback.logback-classic-1.2.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.jboss.slf4j.JBossLoggerFactory]

2021-11-23 11:15:55,875 ERROR [io.qua.application] (main) Failed to start application: javax.enterprise.inject.spi.DeploymentException: No config value of type [java.lang.String] exists for: che.workspace.id

at io.quarkus.arc.runtime.ConfigRecorder.validateConfigProperties(ConfigRecorder.java:37)

at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties22.deploy_0(ConfigBuildStep$validateConfigProperties22.zig:135)

at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties22.deploy(ConfigBuildStep$validateConfigProperties22.zig:154)

at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:124)

at io.quarkus.runtime.Application.start(Application.java:87)

at io.quarkus.runtime.Application.run(Application.java:210)

at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)

Exception in thread "main" java.lang.RuntimeException: Failed to start quarkus

at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:194)

at io.quarkus.runtime.Application.start(Application.java:87)

at io.quarkus.runtime.Application.run(Application.java:210)

at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)

Caused by: javax.enterprise.inject.spi.DeploymentException: No config value of type [java.lang.String] exists for: che.workspace.id

at io.quarkus.arc.runtime.ConfigRecorder.validateConfigProperties(ConfigRecorder.java:37)

at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties22.deploy_0(ConfigBuildStep$validateConfigProperties22.zig:135)

at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties22.deploy(ConfigBuildStep$validateConfigProperties22.zig:154)

at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:124)

... 3 more

@kollachaitanyakrishna
Copy link
Author

Screenshot 2021-11-23 at 4 57 10 PM

@kollachaitanyakrishna
Copy link
Author

logs.txt
log while launching the a workspace.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 23, 2021

but I am getting below error while running on local image.

@kollachaitanyakrishna could you clarify how are you running the image?

it is expected that the image is part of the meta.yaml - https://www.eclipse.org/che/docs/che-7/extensions/creating-a-telemetry-plugin/#_creating_a_meta_yaml_for_your_plug_in

and the reference to the plugin is added to the CR via CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS

 server:
    cheLogLevel: INFO
    customCheProperties:
      CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS: 'eclipse/che-machine-exec-plugin/latest, refernce-to-the-telemetry-plugin.yaml

telemetry plugin is expected to be developed and deployed in the context of the che workspace

@dkwon17
Copy link
Contributor

dkwon17 commented Nov 23, 2021

Could you please also check the logs from the kollatelemetrypluginhwj container from the workspace pod?

@kollachaitanyakrishna
Copy link
Author

but I am getting below error while running on local image.

@kollachaitanyakrishna could you clarify how are you running the image?

it is expected that the image is part of the meta.yaml - https://www.eclipse.org/che/docs/che-7/extensions/creating-a-telemetry-plugin/#_creating_a_meta_yaml_for_your_plug_in

and the reference to the plugin is added to the CR via imageCHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS`

 server:
    cheLogLevel: INFO
    customCheProperties:
      CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS: 'eclipse/che-machine-exec-plugin/latest, refernce-to-the-telemetry-plugin.yaml

telemetry plugin is expected to be developed and deployed in the context of the che workspace

@ibuziuk : I create the YAML file to the public cloud storage and update the config withe below command as
kubectl patch configmap che --type merge -p '{"data":{"CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS":"<URL>/b/kollabucket/o/metafilemeta.yaml"}}' -n eclipse-che

@kollachaitanyakrishna
Copy link
Author

kollatelemetrypluginhwj

@dkwon17
We are unable to launch the workspace , may I know the steps to be followed to get the logs for the mentioned container that are getting created under a workspace.

@ibuziuk
Copy link
Member

ibuziuk commented Nov 25, 2021

I create the YAML file to the public cloud storage and update the config withe below command as
kubectl patch configmap che --type merge -p '{"data":{"CHE_WORKSPACE_DEVFILE_DEFAULT__EDITOR_PLUGINS":"/b/kollabucket/o/metafilemeta.yaml"}}' -n eclipse-che

This configuration should be part of CheServer CR, not configmap as stated in the docs - https://www.eclipse.org/che/docs/che-7/extensions/creating-a-telemetry-plugin/#_updating_che_to_reference_your_telemetry_plug_in

@kollachaitanyakrishna
Copy link
Author

kollachaitanyakrishna commented Nov 25, 2021

@ibuziuk
I followed as per these instructions, it worked for me to get added, please check,

#20589 (comment)

@dkwon17
Copy link
Contributor

dkwon17 commented Nov 25, 2021

@kollachaitanyakrishna to check the logs, running the workspace in verbose mode may work: https://www.eclipse.org/che/docs/che-7/end-user-guide/investigating-failures-at-a-workspace-start-using-the-verbose-mode/#starting-a-che-workspace-in-verbose-mode_che

You can also try to set CHE_INFRA_KUBERNETES_POD_TERMINATION__GRACE__PERIOD__SEC in the CR to prevent the workspace pod from terminating, in order to read the container logs.
https://www.eclipse.org/che/docs/che-7/installation-guide/advanced-configuration-options-for-the-che-server-component/#kubernetes-infra-parameters

@l0rd l0rd modified the milestones: 7.40, 7.41 Dec 14, 2021
@l0rd
Copy link
Contributor

l0rd commented Dec 14, 2021

@dkwon17 I have moved this issue to milestone 7.41. Feel freed to close it if we have already fixed that or set a different milestone if you are not going to fix it during current sprint.

@dkwon17
Copy link
Contributor

dkwon17 commented Dec 14, 2021

Hi @kollachaitanyakrishna , were you able to find out why the image was crashing?

@kollachaitanyakrishna
Copy link
Author

@dkwon17: I attached all possible logs, but I do not know the reason for the failure, let me know if you need any other steps to be followed apart from pull the logs.

@kollachaitanyakrishna
Copy link
Author

@l0rd : I am waiting for the update the image code and steps. Please make sure it is going to be fixed in this sprint.

@dkwon17
Copy link
Contributor

dkwon17 commented Dec 15, 2021

2021-11-23 11:15:55,875 ERROR [io.qua.application] (main) Failed to start application: javax.enterprise.inject.spi.DeploymentException: No config value of type [java.lang.String] exists for: che.workspace.id

It is expected that this error would happen if the image is not running in the context of a che server workspace because the telemetry plugin needs CHE_API_INTERNAL, CHE_WORKSPACE_ID, and CHE_MACHINE_TOKEN environment variables. These environment variables should already exist for the telemetry plugin when running in a che server workspace pod.

We are unable to launch the workspace , may I know the steps to be followed to get the logs for the mentioned container that are getting created under a workspace.

@kollachaitanyakrishna, could you please try these steps to get the logs from your telemetry plugin container from a failing workspace pod? I think there might be a different error than the one above:

  1. Run the following so that the workspace pod does not terminate immediately on failure (you could undo this step after everything is done):
kubectl patch configmap che --type merge -p '{"data":{"CHE_INFRA_KUBERNETES_POD_TERMINATION__GRACE__PERIOD__SEC":"300"}}' -n eclipse-che
  1. Create a workspace

  2. When the workspace fails, run the following to get the workspace pod name that was created in step 2:

kubectl get pods -n eclipse-che
  1. Run the following to get logs for your telemetry plugin container (the command should provide a list of containers to choose from):
kubectl get logs <workspace pod name>

@benoitf
Copy link
Contributor

benoitf commented Dec 21, 2021

@ibuziuk 7.41.0 release will be cut tomorrow. This issue is not yet closed, so please close it if it's done or move it to 7.42

@ibuziuk ibuziuk removed this from the 7.41 milestone Dec 22, 2021
@che-bot
Copy link
Contributor

che-bot commented Jun 20, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 20, 2022
@che-bot che-bot closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/telemetry Issues related to Che telemetry feature kind/question Questions that haven't been identified as being feature requests or bugs. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. sprint/current
Projects
None yet
Development

No branches or pull requests

7 participants