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

net/http: invalid header field value for "X-License-Key" #305

Open
alexismoreau opened this issue Jan 28, 2025 · 3 comments
Open

net/http: invalid header field value for "X-License-Key" #305

alexismoreau opened this issue Jan 28, 2025 · 3 comments
Labels
support Indicates suggested leveraging GTS

Comments

@alexismoreau
Copy link

Hello,

Following newrelic/node-newrelic#2905 ; it has stopped working after switching from cross-fetch package to native NodeJS fetch.

I have now the following error :
[NR_EXT] Telemetry client error: Post "https://cloud-collector.newrelic.com/aws/lambda/v1": net/http: invalid header field value for "X-License-Key", payload size: 1922 bytes

I see the function invocations in new relic and regenerated new Ingest license keys but it's still not sending fetch related logs.

Minimal reproduction :

export const handler = async (event, lambdaContext, callback) => {
    console.log({ event, lambdaContext, callback });
    const fetchResult = await fetch('https://api.github.com');
    const body = await fetchResult.json();
    console.log('Fetched from GitHub:', body);
    return {};
};

AWS Lambda running on Node 22, using layer arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS22X:8, handler newrelic-lambda-wrapper.handler

Env variables :

NEW_RELIC_ACCOUNT_ID | xxxxxxx
NEW_RELIC_EXTENSION_LOG_LEVEL | DEBUG
NEW_RELIC_EXTENSION_SEND_EXTENSION_LOGS | false
NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS | false
NEW_RELIC_LAMBDA_EXTENSION_ENABLED | true
NEW_RELIC_LAMBDA_HANDLER | server.handler
NEW_RELIC_LICENSE_KEY | xxxxxxx
NEW_RELIC_TRUSTED_ACCOUNT_KEY | xxxxxxx
NEW_RELIC_USE_ESM | true

Cloudwatch logs :

Image Image

Can you check on your side ?

Thanks,

@alexismoreau alexismoreau added the bug Something isn't working label Jan 28, 2025
@workato-integration
Copy link

@mrickard
Copy link
Member

mrickard commented Jan 28, 2025

@alexismoreau Sorry to see you're still having trouble here. The Node agent doesn't send any telemetry to New Relic in serverless mode; that's done by the New Relic Lambda Extension (as shown in the [NR_EXT] log line). You may want to double-check what you're using as the value for NEW_RELIC_LICENSE_KEY. I'd suggest opening a case with Support, who can make sure that the configuration values are correct for your account.

@mrickard mrickard added support Indicates suggested leveraging GTS and removed bug Something isn't working labels Jan 28, 2025
@mrickard mrickard transferred this issue from newrelic/node-newrelic Jan 29, 2025
@workato-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Indicates suggested leveraging GTS
Projects
None yet
Development

No branches or pull requests

2 participants