Skip to content

Fixing slim attacher CLI with requested agent version for download - #3096

Merged
SylvainJuge merged 4 commits into
elastic:mainfrom
eyalkoren:attacher-slim-cli-bug
Apr 6, 2023
Merged

Fixing slim attacher CLI with requested agent version for download#3096
SylvainJuge merged 4 commits into
elastic:mainfrom
eyalkoren:attacher-slim-cli-bug

Conversation

@eyalkoren

@eyalkoren eyalkoren commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

There seems to be a regression that is specifically related to running the slim attacher CLI jar with a requested --download-agent-version and without --agent-jar.
In order to reproduce, change manually the statically specified download version to anything other than null (e.g. latest) and run one of the cli-supporting integration tests, like Tomcat. As long as this field is set to null, these integration tests run with a specified --agent-jar, which works around the issue.

The error is:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at co.elastic.apm.attach.ElasticApmAttacher.getBundledAgentJarFile(ElasticApmAttacher.java:199)
	at co.elastic.apm.attach.AgentAttacher$Arguments.<init>(AgentAttacher.java:384)
	at co.elastic.apm.attach.AgentAttacher$Arguments.parse(AgentAttacher.java:510)
	at co.elastic.apm.attach.AgentAttacher.main(AgentAttacher.java:108)
Caused by: java.lang.IllegalStateException: unable to get packaged agent within attacher jar, make sure to execute 'mvn clean package' first.
	at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.getAgentJarFile(ElasticApmAttacher.java:216)
	at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.<init>(ElasticApmAttacher.java:206)
	at co.elastic.apm.attach.ElasticApmAttacher$AgentJarFileHolder.<clinit>(ElasticApmAttacher.java:203)
	... 4 more

Consider changing the error message - make sure to execute 'mvn clean package' first, which is irrelevant to attacher users.

@eyalkoren eyalkoren added the bug Bugs label Apr 3, 2023
@eyalkoren
eyalkoren requested a review from a team April 3, 2023 16:23
@ghost

ghost commented Apr 3, 2023

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview previewSnapshots

Expand to view the summary

Build stats

  • Start Time: 2023-04-06T11:28:22.880+0000

  • Duration: 13 min 1 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@SylvainJuge SylvainJuge left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested manually.

@SylvainJuge
SylvainJuge enabled auto-merge (squash) April 6, 2023 11:33
@SylvainJuge
SylvainJuge merged commit bf59ba2 into elastic:main Apr 6, 2023
@eyalkoren
eyalkoren deleted the attacher-slim-cli-bug branch April 9, 2023 03:41
@SylvainJuge SylvainJuge mentioned this pull request Apr 12, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants