For context, this is a continuation of this question I asked a bit ago.
I am attempting to use Python serverless functions to talk with a MYSQL database I have set up in a project. I have one specific function that I am testing the connection with. When I attempt to connect to it, however, I get this error:
[2023-04-19 14:03:28] Begin get_profile_data activation 6675991df1454948b5991df14519482b
[2023-04-19 14:03:29] stderr: /tmp/virtualenv/lib/python3.9/site-packages/mysql/connector/abstracts.py:130: SyntaxWarning: "is" with a literal. Did you mean "=="?
[2023-04-19 14:03:29] stderr: if group is 'connector_python':
[2023-04-19 14:03:29] stderr: /tmp/virtualenv/lib/python3.9/site-packages/mysql/connector/optionfiles.py:98: SyntaxWarning: "is" with a literal. Did you mean "=="?
[2023-04-19 14:03:29] stderr: if group is 'connector_python':
[2023-04-19 14:03:38] stderr: The function exceeded its time limits of 10000 milliseconds during initialization. Logs might be missing.
[2023-04-19 14:03:28] Finished get_profile_data activation 6675991df1454948b5991df14519482b in 0s. Status: success
Some things to note:
If any additional information is needed let me know!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
The timeout could be caused by the Trusted sources for your MySQL cluster. If this is a dev MySQL cluster, have you tried opening the MySQL cluster temporarily to the world and see if the problem still persists?
If this is the case, what you could do is to deploy your function as part of an App on the App Platform, that way you could allow the app in the Trusted sources for your MySQL cluster.
On another note, is the function indeed supposed to run for more than 10 seconds? If this is the case, you could increase the timeout:
https://docs.digitalocean.com/products/functions/how-to/configure-functions/#resource-limits
Also, if your function is open-source, feel free to share a link to your GitHub repo here and I will be happy to test it out on my end.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.