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

libpython3.11.so.1.0: pwritev2: symbol not found #8698

Closed
jgournet opened this issue May 26, 2024 · 3 comments
Closed

libpython3.11.so.1.0: pwritev2: symbol not found #8698

jgournet opened this issue May 26, 2024 · 3 comments
Labels
bug This issue is a bug. closed-for-staleness installation p2 This is a standard priority issue

Comments

@jgournet
Copy link

Describe the bug

When using aws-cli, we get this error:

Error loading Python lib '/usr/local/aws-cli/v2/2.15.58/dist/libpython3.11.so.1.0': dlopen: Error relocating /usr/local/aws-cli/v2/2.15.58/dist/libpython3.11.so.1.0: pwritev2: symbol not found

Expected Behavior

Things used to work fine

Current Behavior

> [stage-1 4/4] RUN apk --no-cache add groff &&     mkdir /.aws && chown nobody:nobody /.aws &&     aws --version:                                          
0.222 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz                                                                          
0.798 fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz                                                                     
1.259 fetch https://apk.corretto.aws/x86_64/APKINDEX.tar.gz                                                                                                  
1.513 (1/5) Installing libbz2 (1.0.8-r6)
1.525 (2/5) Installing perl (5.38.2-r0)
2.278 (3/5) Installing libgcc (13.2.1_git20231014-r0)
2.297 (4/5) Installing libstdc++ (13.2.1_git20231014-r0)
2.404 (5/5) Installing groff (1.23.0-r2)
2.601 Executing busybox-1.36.1-r15.trigger
2.605 OK: 378 MiB in 22 packages
2.645 [1] Error loading Python lib '/usr/local/aws-cli/v2/2.15.58/dist/libpython3.11.so.1.0': dlopen: Error relocating /usr/local/aws-cli/v2/2.15.58/dist/libpython3.11.so.1.0: pwritev2: symbol not found
------
Dockerfile:19
--------------------
  18 |     
  19 | >>> RUN apk --no-cache add groff && \
  20 | >>>     # Create /.aws folder and assign it to nobody, as this is somehow necessary to run some aws commands (at least "aws s3 cp" needs it, and changing AWS_CONFIG_FILE does not work)
  21 | >>>     mkdir /.aws && chown nobody:nobody /.aws && \
  22 | >>>     aws --version
--------------------
ERROR: failed to solve: process "/bin/sh -c apk --no-cache add groff &&     mkdir /.aws && chown nobody:nobody /.aws &&     aws --version" did not complete successfully: exit code: 255

Reproduction Steps

Use this Dockerfile:

FROM python:3.11-alpine as installer

RUN apk add --no-cache git unzip groff build-base libffi-dev cmake
RUN git clone --recursive  --depth 1 --branch v2 --single-branch  https://github.com/aws/aws-cli.git

WORKDIR aws-cli
RUN python -m venv venv
RUN . venv/bin/activate
RUN scripts/installers/make-exe
RUN unzip -q dist/awscli-exe.zip
RUN aws/install --bin-dir /aws-cli-bin
RUN /aws-cli-bin/aws --version

FROM amazoncorretto:17-alpine-jdk
# Add aws cli v2:
COPY --from=installer /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=installer /aws-cli-bin/ /usr/local/bin/

RUN apk --no-cache add groff && \
    # Create /.aws folder and assign it to nobody, as this is somehow necessary to run some aws commands (at least "aws s3 cp" needs it, and changing AWS_CONFIG_FILE does not work)
    mkdir /.aws && chown nobody:nobody /.aws && \
    aws --version

Possible Solution

No response

Additional Information/Context

No response

CLI version used

latest

Environment details (OS name and version, etc.)

docker linux alpine + docker amazoncorretto alpine

@jgournet jgournet added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 26, 2024
@tb102122
Copy link

I have the following error
Error relocating /usr/local/lib/libpython3.11.so.1.0: pwritev2: symbol not found Error relocating /usr/local/lib/libpython3.11.so.1.0: preadv2: symbol not found

@akmalharith
Copy link

akmalharith commented May 28, 2024

I was searching for a solution for the same symptom, where I am trying to build my image with Google Cloud SDK, it coincided with the bump in Python docker image last week to support new Alpine version

docker-library/python@cfaa0c0

My solution currently is to pin to Python image to Alpine 3.19

FROM python:3.11.9-alpine3.19

@tim-finnigan tim-finnigan self-assigned this Jun 4, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jun 4, 2024
@tim-finnigan
Copy link
Contributor

Appears to be an issue with Alpine as noted above. and pinning to Python 3.11.9 works. I think this should continue to be tracked in the issue linked above (docker-library/python#927) going forward.

@tim-finnigan tim-finnigan removed their assignment Jun 4, 2024
@tim-finnigan tim-finnigan added closing-soon This issue will automatically close in 4 days unless further comments are made. p2 This is a standard priority issue and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Jun 4, 2024
@github-actions github-actions bot added closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 8, 2024
@github-actions github-actions bot closed this as completed Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness installation p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants