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

Bug: When running sam deploy in github ci/cd, got error Unable to export., TypeError: sequence item 0: expected str instance, bytes found #6629

Closed
jf001z4084 opened this issue Jan 31, 2024 · 8 comments
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.

Comments

@jf001z4084
Copy link

Description:

Our github CI/CD pipeline running sam deploy command in ubuntu environment to deploy our lambda function, we found the it failed and report error: Unable to export.

Observed result:

2024-01-31 17:23:33,745 | Sam customer defined id is more priority than other IDs. Customer defined id for resource AuthFunction is AuthFunction
2024-01-31 17:23:36,377 | Unable to export
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/opt/cfn-lint/libexec/lib/python3.12/site-packages/botocore/httpsession.py", line 464, in send
    urllib_response = conn.urlopen(
                      ^^^^^^^^^^^^^
  File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 793, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/home/linuxbrew/.linuxbrew/opt/cfn-lint/libexec/lib/python3.12/site-packages/botocore/awsrequest.py", line 91, in request
    if headers.get('Expect', b'') == b'100-continue':
       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen _collections_abc>", line 807, in get
  File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/_collections.py", line 261, in __getitem__
    return ", ".join(val[1:])
           ^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, bytes found

Expected result:

We expect the lambda function could be deployed successfully.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: ubuntu
  2. sam --version: 1.108
  3. AWS region: us-west-2
# Paste the output of `sam --info` here

Unable to export


`Add --debug flag to command you are running`

File "/home/linuxbrew/.linuxbrew/opt/cfn-lint/libexec/lib/python3.12/site-packages/botocore/httpsession.py", line 464, in send
urllib_response = conn.urlopen(
^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 793, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/connectionpool.py", line 496, in _make_request
conn.request(
File "/home/linuxbrew/.linuxbrew/opt/cfn-lint/libexec/lib/python3.12/site-packages/botocore/awsrequest.py", line 91, in request
if headers.get('Expect', b'') == b'100-continue':
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 807, in get
File "/home/linuxbrew/.linuxbrew/opt/python-urllib3/lib/python3.12/site-packages/urllib3/_collections.py", line 261, in getitem
return ", ".join(val[1:])
^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, bytes found

@jf001z4084 jf001z4084 added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jan 31, 2024
@acdha
Copy link

acdha commented Jan 31, 2024

The same thing happens with the Mac Homebrew package, as well. It looks like they recently orphaned that install mechanism as the instructions now say you have to use the .pkg files provided on https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html.

@jf001z
Copy link

jf001z commented Jan 31, 2024

thanks a lot checking the document now.

@mndeveci
Copy link
Contributor

mndeveci commented Feb 1, 2024

We recommend using our native installers which won't have any dependency on the system python version and libraries. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html

Can you update your installation with the ones that is provided in the documentation to see if it is going to resolve your problem?

Thanks

@mndeveci mndeveci added blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 1, 2024
@markokimpel
Copy link

The first party installer does not have said problem.

My environment:

  • Ubuntu
  • The homebrew installer, version 1.108.0, showed the error @jf001z4084 reported
  • The AWS provided installer, also version 1.108.0, does not show the error

@gihanw
Copy link

gihanw commented Feb 2, 2024

The first party installer does not have said problem.

My environment:

* Ubuntu

* The homebrew installer, version 1.108.0, showed the error @jf001z4084 reported

* The AWS provided installer, also version 1.108.0, does not show the error

This saved my day

@christoph-zero
Copy link

Will this be fixed in the Homebrew managed package?

@jf001z4084
Copy link
Author

Thank you very much, the issue is solved, which is caused by Homebrew, after we use the native installer, the issue is gone.

Copy link
Contributor

github-actions bot commented Feb 5, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale.
Projects
None yet
Development

No branches or pull requests

7 participants