Laravel Bref - Scheduler Lambda not using Environment Variables #1818
-
Hi, I have a laravel scheduler lambda and it does not seem to be picking up the environment variables that have been set. I can clearly see them in the AWS Console, and also if i make an artisan command to print all the environment variables, i can also see these outputted in the logs so i know they are set correctly When the artisan scheduler runs it does not use the environment variables set. I have a artisan cmd to dump the database to S3, but it is not using the environment variables i have set for DB_HOST etc (again i can see these set in the console, and also get the lambda to print them out with my custom artisan cmd) I have this exact same setup for another laravel project and it works absolutely fine - can anyone advise? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
can you drop your |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Do you see the environment variables in the "scheduler" Lambda configuration in the AWS console? |
Beta Was this translation helpful? Give feedback.
-
Could it be that your are deploying generated config cache, or something to do with caches? |
Beta Was this translation helpful? Give feedback.
Yes, it is possible for your pipeline to deploy locally generated cache files, as Matthieu suggested.
If your pipeline pulls your code from git, you should ensure the
bootstrap/cache
directory doesn't have any generated cache files in your repo. That directory should be empty or contain a.gitignore
or.gitkeep
file. If the directory isn't empty, delete the cache files and addbootstrap/cache
to your.gitignore
.If your pipeline pulls your code from a source other than git, you should download the packaged
.zip
that Serverless Framework uploads to your deployment bucket to ensure thebootstrap/cache
directory is empty. If the directory isn't empty, add!bootstrap/cache/**
topackage.patterns