-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove library that aws lambda cannot find #1060
remove library that aws lambda cannot find #1060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this change. At the time this original change was created, this file was needed and might as well have automatically been included. Things change over time and it is not necessary.
Awesome, Does |
I tried it with a local build and it resolved the specific issue with the libmysqlclient.so.18 error, I believe there is still an improper configuration mysqldb error. Or something similar to that if you are still relying on mysql. At least people that do not need mysql will find some relief. |
Nice, i am a little hesitant to switch to PyMySQL, but I believe that is also an option. Do you know the cause of the other MySQL error? I am willing to work on it since we rely heavily on Zappa for our deployments. |
It is the same issue that created the problem years ago. I believe that a certain library file is missing and was included in previous builds, but has changed. So need to figure out what the current MySQL library file is and include that in the path but make sure it doesn’t break if it is not needed.
TimJ
… On Oct 18, 2021, at 9:40 AM, John (Ottenlips) Franke ***@***.***> wrote:
Nice, i am a little hesitant to switch to PyMySQL, but I believe that is also an option. Do you know the cause of the other MySQL error? I am willing to work on it since we rely heavily on Zappa for our deployments.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
I believe this library was included in https://pypi.org/project/lambda_packages/ *mysqlclient Going to try adding this dependency to our project and see if the error is resolved. We are on an old version of MySQL that should be compatible with the libmysqlclient.so found in lambda packages. I still think it should be manually included by the user though and not hardcoded in Zappa. Zappa's docs could steer people to use PyMySQL or build and bundle their own libmysqlclient.so like in the tutorial linked below. I am curious to see how much slower PyMySQL is in our staging environment. https://newbedev.com/problems-using-mysql-with-aws-lambda-in-python |
I could also see Zappa forking https://github.com/Miserlou/lambda-packages, seems like there is a lot of good stuff in it like the ability to use Pillow on lambda easily |
Looks like there is more to it, it needs to be in the path like in previous versions of Zappa.
Going to try adding a lambda layer for MySQLClient https://github.com/nonbeing/mysqlclient-python3-aws-lambda#tldr Looks like there was a zappa blog post about adding dependencies after removing lambda_packages, but it was deleted. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
For anyone that needs MySQL we are going to go with PyMySQL since it is a simpler implementation and doesn't require this library, which won't work anyway because lambda-packages has been removed. |
Thanks for bringing this issue up and giving context, super helpful 👍🏽 Will this change break existing projects using mysql based on zappa? |
Current projects using mysql broke when lambda-packages was removed. This change should have no effect. To use mysql with zappa as of now you have to either make your own lambda layer or rely on pymysql. |
Looks like |
Thanks! |
looks like the automation wants this to be reviewed again? |
thanks @javulticat! glad to see the tests are passing |
* remove library that aws lambda cannot find * run black Co-authored-by: javulticat <[email protected]>
Description
I do not see why this hardcoded library is necessary in the source code. If someone wants to include it they can add it to
include: []
.We ran into this issue when updating from an old version of Zappa that did not have this hardcoded reference. We are also using MySQL. Happy to discuss alternatives, this just seemed the most straightforward solution. Thanks!
GitHub Issues
#940