aarondfrancis / sidecar

Deploy and execute AWS Lambda functions from your Laravel application.
https://hammerstone.dev/sidecar/docs/main
MIT License
823 stars 56 forks source link

Segmentation fault when deploying #109

Open pepeloper opened 1 year ago

pepeloper commented 1 year ago

Hey all, I have created a project from scratch and configured it with the basic example in the documentation and I got the following error when trying to deploy it:

[Sidecar] Deploying App\Sidecar\OgImage to Lambda as `sc-laravel-local-sidecar-ogimage`.
          ↳ Environment: local
          ↳ Architecture: x86_64
          ↳ Package Type: Zip
          ↳ Runtime: nodejs14.x
          ↳ Creating new lambda function.
          ↳ Packaging files for deployment.
[1]    7064 segmentation fault  php artisan sidecar:deploy --activate

Appreciate some help here because I'm totally lost

pepeloper commented 1 year ago

I set up a repo with the code I'm using and having the error

https://github.com/pepeloper/segmentation-fault

The last comment show everything i have done so far https://github.com/pepeloper/segmentation-fault/commit/98ec275094d8ef20756ba31eace8163c46d4ba69

I'm thinking it's something AWS related and exploring it that way, but did all the steps by running php artisan sidecar:install and php artisan sidecar:configure

pepeloper commented 1 year ago

Ok, it's related to the PHP Version. I have created a new fresh project with Laravel 9 and PHP 8.0.28, which works like a charm.

@aarondfrancis thoughts on this? Here is the repo in case it helps: https://github.com/pepeloper/serverless_php_8

NicolasSacC commented 1 year ago

I got the same error. Is there a fix that doesn't involve changing the PHP version?

aarondfrancis commented 1 year ago

Looking into this, thanks for the repo. Will report back ASAP

aarondfrancis commented 1 year ago

What was the version that was segfaulting? PHP & Laravel version if you can. I just ran it locally on Laravel 9.52.7 and PHP 8.1.14 and it worked. I also tried Laravel 10.9.

pepeloper commented 1 year ago

thanks for the help @aarondfrancis. I have been using Laravel 10.8 and php 8.2.4

aarondfrancis commented 1 year ago

I just tested on PHP 8.2.1 and Laravel 10.8 and it worked fine. I tried using phpbrew to test with 8.2.4 because I can't use Valet to install that version, but I wasn't able to get it to work. It seems like it might be specifically related to 8.2.4 rather than the 8.2 series. If I can get Valet to upgrade beyond 8.2.1 I can test, but until then I'm not sure what to do! Sorry about this

adrorocker commented 1 year ago

@aarondfrancis

I just tested on PHP 8.2.1 and Laravel 10.8 and it worked fine.

I encounter the same issue with PHP 8.2.1 and Laravel 9.50.2. I was able to work around it by downgrading php to 8.1.14. This are my 2 cents. Sorry if I'm not providing much more help or info but I'm not able to spend a lot of time researching this issue since this only happened on my local env and not in production which is running on php 8.1.14.

gordonsumac commented 1 year ago

~Hate to post on an older thread, but I'm seeing the segfault when trying to deploy with PHP 8.1.18 and Laravel 9.52.7. I'm trying to run a python service. Anyone have success at making this work with 8.1/8.2 and Laravel 9?~

Upgraded to PHP 8.2 and the segfault is no more.