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

new version of awssdk 2.21.0+ breaks aws-sdk instrumentations #3372

Closed
videnkz opened this issue Oct 19, 2023 · 1 comment · Fixed by #3373
Closed

new version of awssdk 2.21.0+ breaks aws-sdk instrumentations #3372

videnkz opened this issue Oct 19, 2023 · 1 comment · Fixed by #3373
Labels
agent-java community Issues and PRs created by the community triage

Comments

@videnkz
Copy link
Contributor

videnkz commented Oct 19, 2023

Bug reported by user from forum

Describe the bug

New version of awssdk has updated its internals.
Before version 2.21.0, all subclasses of software.amazon.awssdk.core.internal.handler.BaseClientHandler has own private SdkClientConfiguration clientConfiguration field.

public abstract class BaseSyncClientHandler extends BaseClientHandler implements SyncClientHandler {
    private final SdkClientConfiguration clientConfiguration;
    private final AmazonSyncHttpClient client;

    protected BaseSyncClientHandler(SdkClientConfiguration clientConfiguration, AmazonSyncHttpClient client) {
        super(clientConfiguration);

Since 2.21.0 version, SdkClientConfiguration clientConfiguration field placed only in BaseClientHandler

public abstract class BaseClientHandler {
    private SdkClientConfiguration clientConfiguration;

Steps to reproduce

Steps to reproduce the behavior:

After upgrading the AWS SDK v2 in our spring boot service from 2.20.162 to 2.21.0 we see the following message during startup that did not happen before:

2023-10-18 06:26:05,586 [main] WARN  co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler
java.lang.IllegalStateException: Cannot locate field named clientConfiguration for class software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler
	at net.bytebuddy.asm.Advice$OffsetMapping$ForField$Unresolved.resolve(Advice.java:2556) ~[elastic-apm-agent-40510175845988f13f6162ed8526f0b0-a9910a9589b2cceb9a41936e297bb41c.jar:1.43.0]
	at net.bytebuddy.asm.Advice$OffsetMapping$ForField.resolve(Advice.java:2481) ~[elastic-apm-agent-40510175845988f13f6162ed8526f0b0-a9910a9589b2cceb9a41936e297bb41c.jar:1.43.0]
...
As a consequence, traces that contain communication over SQS stop after an SQS message was sent and the spans after receiving the message are missing.

Expected behavior

Instrumentation works properly and without errors

Debug logs

2023-10-18 06:26:05,586 [main] WARN  co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - Error on transformation software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler
java.lang.IllegalStateException: Cannot locate field named clientConfiguration for class software.amazon.awssdk.core.internal.handler.BaseAsyncClientHandler
	at net.bytebuddy.asm.Advice$OffsetMapping$ForField$Unresolved.resolve(Advice.java:2556) ~[elastic-apm-agent-40510175845988f13f6162ed8526f0b0-a9910a9589b2cceb9a41936e297bb41c.jar:1.43.0]
	at net.bytebuddy.asm.Advice$OffsetMapping$ForField.resolve(Advice.java:2481) ~[elastic-apm-agent-40510175845988f13f6162ed8526f0b0-a9910a9589b2cceb9a41936e297bb41c.jar:1.43.0]
Click to expand
replace this line with your debug logs
@github-actions github-actions bot added agent-java community Issues and PRs created by the community triage labels Oct 19, 2023
@videnkz
Copy link
Contributor Author

videnkz commented Oct 19, 2023

At current time I am working on this bug, and will push PR today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-java community Issues and PRs created by the community triage
Projects
None yet
1 participant