Skip to content
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

aws-lambda-cpp-0.2.6 unable to be installed, preinstall.sh failure #10

Closed
MirandaDora opened this issue Jan 11, 2021 · 4 comments
Closed

Comments

@MirandaDora
Copy link

MirandaDora commented Jan 11, 2021

I am trying to do RUN npm install [email protected]
It fails for the following reason:

./scripts/preinstall.sh
tar: aws-lambda-cpp-0.2.6/packaging: Cannot change ownership to uid XXXX, gid XXXX.

The error appears to be when unzip aws-lambda-cpp-0.2.6 in the preinstall script.
This is not reproducible locally, but on the automatic pipleline, you can see this.

The root cause is, most of the pipelines having the limitation:

UID/GIDs that are placed on files must be in the range 0-65535

However, the uid and gid I received is uid 1515433866, gid 1896053708.
May need to investigate what change has caused the ownership switch when installing aws-lambda-cpp

The quick workaround is to add --no-same-owner in the tar command.

Reference: golangci/golangci-lint#752

@MirandaDora MirandaDora changed the title aws-lambda-cpp-0.2.6 unable to be installed, preinstall.sh failure with permission issues aws-lambda-cpp-0.2.6 unable to be installed, preinstall.sh failure Jan 11, 2021
@calavera
Copy link

problems like this would go away with #8

@donn
Copy link

donn commented Nov 7, 2021

Issue persists as of the time of writing.

@donn
Copy link

donn commented Nov 7, 2021

So, here's another workaround if you don't want to fork this repo:

RUN groupadd -g 1001 lambda
RUN useradd -r -u 1001 -g lambda lambda
RUN mkdir -p /home/lambda
RUN chown -R lambda:lambda /home/lambda

RUN chown -R lambda:lambda ${FUNCTION_DIR}

USER lambda

# do your npm/yarn install

USER root

A four-digit UID/GID works fine here.

@andclt
Copy link
Contributor

andclt commented Oct 14, 2023

This was fixed with: #46

@andclt andclt closed this as completed Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants