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

Unable to upload artifact using SAM CLI Version 1.109.0 #6667

Closed
awsmantra opened this issue Feb 9, 2024 · 16 comments
Closed

Unable to upload artifact using SAM CLI Version 1.109.0 #6667

awsmantra opened this issue Feb 9, 2024 · 16 comments
Labels
area/installation blocked/close-if-inactive Blocked for >14 days with no response, will be closed if still inactive after 7 days blocked-dependency

Comments

@awsmantra
Copy link

I have upgraded my local sam-cli version to 1.109.0

Now when I am trying to upload artifact, I am getting below error

Error: Unable to upload artifact HelloWorldFunction referenced by CodeUri parameter of HelloWorldFunction resource.
An HTTP Client raised an unhandled exception: sequence item 0: expected str instance, bytes found

I was able to upload all my prior SAM projects before upgrading to this new version

@awsmantra awsmantra added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Feb 9, 2024
@pbv0
Copy link

pbv0 commented Feb 9, 2024

Seeing the same error message when deploying this code sample with SAM CLI 1.109.0 and 1.108.0.

It works when I downgrade to 1.106.0.

@awsmantra
Copy link
Author

I completely removed sam-cli and use there installable package. How did you downgrade version ?

@pbv0
Copy link

pbv0 commented Feb 9, 2024

You can download old versions for your OS here on GitHub under Releases.

e.g. here 1.106.0
https://github.com/aws/aws-sam-cli/releases/tag/v1.106.0

@awsmantra
Copy link
Author

I installed aws-sam-cli using homebrew and it stop working. I completely removed package from my local and use installable pacakge.

@hawflau
Copy link
Contributor

hawflau commented Feb 9, 2024

Hey @awsmantra thanks for reporting the issue and @pbv0 for providing an example to reproduce the issue. However, I tried two installation methods (using pip install in a venv and using MacOS Installer in an Intel Mac) and couldn't reproduce the issue. Could you please which OS and installation method you used?

@pbv0 In the code sample you provided, did it not work in the backend or the frontend or both?

@hawflau hawflau added area/package sam package command stage/bug-repro The issue/bug needs to be reproduced and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Feb 9, 2024
@falnyr
Copy link

falnyr commented Feb 11, 2024

I am getting the same error with 1.109.0.

Here's the output of deployment with --debug on:

2024-02-12 05:41:36,703 | Unable to find Click Context for getting session_id.
2024-02-12 05:41:36,708 | Sending Telemetry: {'metrics': [{'events': {'requestId': 'c0b31d56-0433-4541-860a-0326beff394e', 'installationId': '49ea70ab-17f8-43ca-9d1f-d8e3e43ebebc', 'sessionId': 'bc4e0b0c-3b8b-450d-814c-ad225b8ed7e3', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.12.1', 
'samcliVersion': '1.109.0', 'commandName': 'sam deploy', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '9318a650db3645218272fb6cea48c08e', 'time_stamp': '2024-02-11 16:41:32.574', 'exception_name': None}, {'event_name': 
'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': 'add60d4132f746c1a92a29a3221b511a', 'time_stamp': '2024-02-11 16:41:32.681', 'exception_name': None}]}}}]}
2024-02-12 05:41:37,323 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: An HTTP Client raised an unhandled exception: sequence item 0: expected str instance, bytes found
2024-02-12 05:41:37,330 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

@pbv0
Copy link

pbv0 commented Feb 12, 2024

@pbv0 In the code sample you provided, did it not work in the backend or the frontend or both?

I can reproduce with the following steps (keep the default options during sam deploy):

git clone [email protected]:aws-samples/serverless-pdf-chat.git
cd serverless-pdf-chat/backend
sam build --use-container
sam deploy --guided

@domengabrovsek
Copy link

I have the same issue as described in the original description. I am using aws-sam-cli installed via brew.

After uninstalling it with brew and then installing it through package installer it started to work again. Both versions were 1.109.0

@awsmantra
Copy link
Author

For Mac , I only see Package Installer works as mention by @domengabrovsek

@hawflau
Copy link
Contributor

hawflau commented Feb 12, 2024

Got it. I'll try to reproduce the issue with SAM CLI installed through homebrew.

@hawflau
Copy link
Contributor

hawflau commented Feb 12, 2024

Hey all,

Right now if you install AWS SAM CLI through homebrew, homebrew installs urllib3 2.2.0 (released on 2024-01-30) as a dependency. However, botocore, another SAM CLI's dependency, requires urllib3 < 2.1, as specified here. urllib3 2.2.0 might contain breaking changes that break botocore, thus resulting in the errors you all saw. Botocore still has an open issue to address it and we are blocked by that.

We recommend you to install SAM CLI through package installer. Please let us know if you have any further questions.

@hawflau hawflau added area/installation blocked/close-if-inactive Blocked for >14 days with no response, will be closed if still inactive after 7 days blocked-dependency and removed area/package sam package command stage/bug-repro The issue/bug needs to be reproduced labels Feb 12, 2024
@hawflau
Copy link
Contributor

hawflau commented Feb 14, 2024

created an issue in homebrew-core to follow up - Homebrew/homebrew-core#162626

@hmo-5o1d
Copy link

@hawflau
Copy link
Contributor

hawflau commented Feb 14, 2024

Hey all, closing the issue as homebrew has fixed the issue through Homebrew/homebrew-core#162634. I tried it myself (with brew install aws-sam-cli) and confirmed that it worked.

Feel free to raise a new issue if there is still any issue/question.

@hawflau hawflau closed this as completed Feb 14, 2024
Copy link
Contributor

⚠️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.

@JaphetMataImp
Copy link

I completely removed sam-cli and use there installable package. How did you downgrade version ?

this worked for me, I removed the Brew package and install the downloaded package ( ver. 1.115.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/installation blocked/close-if-inactive Blocked for >14 days with no response, will be closed if still inactive after 7 days blocked-dependency
Projects
None yet
Development

No branches or pull requests

7 participants