extra-php-extensions icon indicating copy to clipboard operation
extra-php-extensions copied to clipboard

[Datadog] PHP Startup: Unable to load dynamic library 'ddappsec.so'

Open annuh opened this issue 2 years ago • 0 comments

I'm running into an issue when enabling the datadog extension. When I add this extension to my Lambda's layers, the Lambda function produces the following warning:

Warning: PHP Startup: Unable to load dynamic library 'ddappsec.so' (tried: /opt/bref/extensions/ddappsec.so (/opt/bref/extensions/ddappsec.so: cannot open shared object file: No such file or directory), /opt/bref/extensions/ddappsec.so.so (/opt/bref/extensions/ddappsec.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

My full serverless.yml looks like this

service: php-test

provider:
    name: aws
    #architecture: arm64
    region: eu-central-1
    environment:
        # Datadog specific settings
        DD_SITE: datadoghq.com
        DD_API_KEY: __SECRET__
        DD_TRACE_ENABLED: true
        DD_SERVICE: php-test

plugins:
    - ./vendor/bref/bref
    - ./vendor/bref/extra-php-extensions

functions:
    test:
        handler: App\Infrastructure\Bref\EventHandler
        description: 'Test function'
        runtime: php-82
        timeout: 60
        layers:
            - ${bref-extra:gd-php-82}
            - ${bref-extra:datadog-php-82}
            - arn:aws:lambda:eu-central-1:464622532012:layer:Datadog-Extension:43 # changing the layers order, didn't help

package:
    patterns:
        # Excluded files and folders for deployment
        - '!assets/**'
        - '!node_modules/**'
        - '!public/build/**'
        - '!tests/**'
        - '!var/**'
        # If you want to include files and folders that are part of excluded folders, add them at the end
        - 'var/cache/prod/**'
        - 'public/build/entrypoints.json'
        - 'public/build/manifest.json'

I see the function's logs in Datadog (~probably because of the Datadog-Extension layer?~, no both layers are needed), but there is no trace information.

Do you have any idea what's the issue here?

annuh avatar May 31 '23 08:05 annuh