Question

App Serverless functions returning code 126 when deploying.

I was mimicking this example repo to try to create a serverless function that imports the mysql python package so I can access my database cluster component of one of my projects.

I have the same structure in my git repo. My build.sh file is exactly the same. I have changed the requirements.txt file to only have the string mysql, corresponding with the package I need to talk with my MYSQL v8 DB. I even added a .env file that has the same string in the example: API_KEY="" just as a sanity check, although I’m not sure if this is required. When I go to deploy, all my other functions deploy fine (they do not import any libraries beyond boto3 & botocore for spaces access).

When I deploy my serverless functions I get this error:

[2023-04-12 16:09:48] │ Failures:
[2023-04-12 16:09:48] │  ›   Error: While deploying action 'user/get_profile_data': './build.sh' exited
[2023-04-12 16:09:48] │  ›    with code 126

I have consulted with two PHD experts I have contact with and they both concluded that it is likely a DO specific issue and did not have any readily available solutions to this problem.

Any help in remedying this would be greatly appreciated!

(PS I tried to log in as my own account to post this, however it would not allow me to so I had to post this as a community user. Where can I go to report this issue?)


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
April 13, 2023
Accepted Answer

Hi there,

If you check the permissions of the build.sh file does it have executable permissions?

ls -lah packages/sample/emails/

If not, you could executable permissions, you use the following git command to make the change:

git add --chmod=+x -- build.sh
git commit -m "Make the build.sh file executable"

After that push your change as normal to your GitHub repository.

Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel