brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.06k stars 364 forks source link

Upgrading to Bref 2.1.15 caused OpenSSL error #1745

Closed zmalter99 closed 5 months ago

zmalter99 commented 5 months ago

We upgraded our application to 2.1.15 from 2.1.14 and begin receiving the following Invoke errors. Downgrading back to 2.1.14 fixed the issue.

Screenshot from 2024-02-16 16-32-24

mnapoli commented 5 months ago

@zmalter99 thank you, probably related to the openssl upgrade then 🤔

Can you confirm that you are deploying with Lambda layers (not Docker), via serverless.yml, using the Bref plugin. I.e. that you are not doing anything specific or custom?

mnapoli commented 5 months ago

Also the logs seem to be about init error, can you share more info? is this on startup, or is this when PHP does something specific, e.g. calls a 3rd party API?

zmalter99 commented 5 months ago

Confirmed. We deploy with Lambda layers via serverless.yml using the Bref plugin.

composer.json

{
    "require": {
        "bref/bref": "2.1.15",
        "bref/extra-php-extensions": "1.4.1",
        "mongodb/mongodb": "1.11.0"
    }
}

serverless.yml

service: maltertech

provider:
  name: aws
  region: us-east-1

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

functions:
  api:
    handler: index.php
    description: 'Centralized API endpoint'
    runtime: php-81-fpm
    timeout: 28
    memorySize: 2048
    maximumRetryAttempts: 0
    ephemeralStorageSize: 1024
    layers:
      - ${bref-extra:mongodb-php-81}
      - ${bref-extra:gd-php-81}
      - ${bref-extra:imagick-php-81}
    events:
      - httpApi: '*'

Github Deploy Script: https://github.com/brefphp/examples/tree/master/CI/GitHubAction

This error occured when hitting our index.php router which does not make any network requests.

mnapoli commented 5 months ago

Thanks, I hope it's not related to the extra extensions 🤔 I'm looking if that could be the case.

mnapoli commented 5 months ago

Yep, seems to be caused by imagick. I'm looking if I see anything obvious.

mnapoli commented 5 months ago

FYI I'm building again all extensions against the latest Bref images: https://github.com/brefphp/extra-php-extensions/actions/runs/7937051123

mnapoli commented 5 months ago

OK it seems the problem is fixed after rebuilding imagick. Out of safety, I've rebuilt all extra layers.

Could you confirm things are OK with the master branch of the extra extensions? To test you'd have to upgrade to the latest Bref version + require this in composer.json:

    "bref/extra-php-extensions": "dev-master"

Then I'll tag a release for the extra extensions.

zmalter99 commented 5 months ago

I just deployed an updated version, I'll confirm it works shortly. Thank you for your quick responses!

zmalter99 commented 5 months ago

I've confirmed the issue is fixed with bref (2.1.15) and extra-php-extensions (dev-master)

mnapoli commented 5 months ago

Thanks, I tagged a release: https://github.com/brefphp/extra-php-extensions/releases/tag/1.4.2