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

Netty is hanging inside AWS Lambda #449

Closed
spyros87 opened this issue Jun 25, 2021 · 4 comments
Closed

Netty is hanging inside AWS Lambda #449

spyros87 opened this issue Jun 25, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@spyros87
Copy link

Which version of the client library are you using?
The latest 13.0.0 and the v8 for the resources
Which version of Java are you using?
Java 11
Which operating system (Linux, Windows, ...) and version?
AWS Linux Distro and MacOSx as local
Actions taken
Using the provided examples, I have tried to run them locally first and then run them inside an AWS Lambda.
Expected result
Is that both local and AWS will provide the same results.
Actual result
Locally the code is executed correctly. On AWS, the code freezes on googleAdsServiceClient.search(request) due to some netty malfunction.

The pom dependencies are:

<dependencies>
        <dependency>
            <groupId>com.google.api-ads</groupId>
            <artifactId>google-ads</artifactId>
            <version>13.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-lambda-java-core</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-lambda-java-events</artifactId>
            <version>3.9.0</version>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>secretsmanager</artifactId>
            <version>2.16.89</version>
        </dependency>
        <dependency>
            <artifactId>apache-client</artifactId>
            <groupId>software.amazon.awssdk</groupId>
            <version>2.16.89</version>
        </dependency>
</dependencies>

AWS Stacktrace:
remote stacktrace.txt

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See troubleshooting for how to diagnose problems better.

Anything else we should know about your project / environment
AWS Lambda, with 512 RAM

@spyros87 spyros87 added the bug Something isn't working label Jun 25, 2021
@nwbirnie
Copy link
Contributor

I tried to replicate this on AWS but was unable to. My guess would be that you have a dependency conflict, but with the limited set of dependnecies posted above I can't see where that would come from.

Could you put together a minimum failing example that I could debug?

@nwbirnie
Copy link
Contributor

Actually, thinking about it, this is possibly being caused by the OAuth credentials being invalid. Could you check that valid credentials that are being loaded on AWS?

@spyros87
Copy link
Author

spyros87 commented Jul 2, 2021

@nwbirnie This the minimum required set of dependencies so that we can have an AWS Java runtime with Lambda using the Google Ads API.
The actual problem was that the the SSL connection could not handshake in order to be able to start sending messages.
Actually there is a dependency excluded from the shaded JAR during the SAM packaging process. When the following dependency was added,

<dependency>
    <groupId>io.perfmark</groupId>
    <artifactId>perfmark-api</artifactId>
    <version>0.24.0</version>
</dependency>

then the SSL connection was successful and the Lambda was getting Google Ads data.

@nwbirnie
Copy link
Contributor

nwbirnie commented Jul 2, 2021

Nice, thanks for posting the solution and glad to hear you got it fixed.

@nwbirnie nwbirnie closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants