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

preferences is wrong type #8018

Closed
ghost opened this issue Jul 5, 2023 · 8 comments
Closed

preferences is wrong type #8018

ghost opened this issue Jul 5, 2023 · 8 comments
Assignees

Comments

@ghost
Copy link

ghost commented Jul 5, 2023

Describe the bug

I ran aws configure sso, then aws eks update-kubeconfig --name $cluster --profile $profile, and got this error message: preferences is wrong type: <class 'dict'> (Should be <class 'collections.OrderedDict'>).

Expected Behavior

The eks command should work. It works with the same procedure for a friend on MacOS, on aws version 1.12.5.

Current Behavior

I got this error message after running the aws eks command. Note that if I run it with the name of a cluster that doesn't exist, it doesn't give me this error, it gives me a normal error about the cluster not existing.

Reproduction Steps

aws configure sso
# complete the SSO process and set $profile to the profile name
# where $cluster is the name of a cluster that exists
aws eks update-kubeconfig --name $cluster --profile $profile

Possible Solution

No response

Additional Information/Context

Installed aws-cli from the Alpine package manger.

CLI version used

1.12.4 and 1.12.6 both have this problem for me

Environment details (OS name and version, etc.)

Alpine Linux

@ghost ghost added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 5, 2023
@tim-finnigan tim-finnigan self-assigned this Jul 6, 2023
@tim-finnigan
Copy link
Contributor

Hi @yujiri8 thanks for reaching out. The aws configure sso command is only available in v2, and the v1 versions you referenced are very old. (The latest CLI versions are 1.29.0 and 2.12.7). We recommend using v2 if possible, and installing the CLI per the documentation here: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html.

If you're still receiving an error after updating, could you share your debug logs (with any sensitive info redacted) by adding --debug to the command?

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 6, 2023
@ghost
Copy link
Author

ghost commented Jul 7, 2023

Sorry, I accidentally wrote 1.x on all the version numbers when I meant to write 2.x.

I will try building the newest version and getting a debug log later.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jul 7, 2023
@ghost
Copy link
Author

ghost commented Jul 7, 2023

Fixed when building from source. This must've been caused by Alpine packaging the wrong version of dependencies.

@ghost ghost closed this as completed Jul 7, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

@slackfan
Copy link

@yujiri8, as I also observe the issue, did you maybe file an issue for the alpine package?

@ghost
Copy link
Author

ghost commented Jul 19, 2023

I did not because I wasn't sure which package was responsible, and I have very little motivation to effectively contribute to gross corporate software like this, which I would never use voluntarily.

@mih-kopylov
Copy link

mih-kopylov commented Jul 21, 2023

Faced the same issue with

aws-cli/2.13.2 Python/3.11.4 Linux/5.10.184-175.731.amzn2.x86_64 source/x86_64.alpine.3 prompt/off

It happened when I run aws eks update-kubeconfig command second time, the first run of this command succeeds, but the second causes the following error

preferences is wrong type: <class 'dict'> (Should be <class 'collections.OrderedDict'>)

The solution helped: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-source-install.html#source-getting-started-install-workflows-alpine

FROM python:3.8-alpine AS builder

ENV AWSCLI_VERSION=2.10.1

RUN apk add --no-cache \
    curl \
    make \
    cmake \
    gcc \
    g++ \
    libc-dev \
    libffi-dev \
    openssl-dev \
    && curl https://awscli.amazonaws.com/awscli-AWSCLI_VERSION.tar.gz | tar -xz \
    && cd awscli-AWSCLI_VERSION \
    && ./configure --prefix=/opt/aws-cli/ --with-download-deps \
    && make \
    && make install

FROM python:3.8-alpine

RUN apk --no-cache add groff

COPY --from=builder /opt/aws-cli/ /opt/aws-cli/

ENTRYPOINT ["/opt/aws-cli/bin/aws"]

It seems that the alpine package https://pkgs.alpinelinux.org/package/edge/community/x86_64/aws-cli has an incompatible dependency that causes such an issue.

@slackfan
Copy link

I filed https://gitlab.alpinelinux.org/alpine/aports/-/issues/15133 for the issue. Feel free to improve it or add details.

This issue was closed.
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

3 participants