Skip to content

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

Open
@alexismoreau

Description

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,

Metadata

Assignees

No one assigned

    Labels

    supportIndicates suggested leveraging GTS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions