Unable to upload artifact using SAM CLI Version 1.109.0
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
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.
I completely removed sam-cli and use there installable package. How did you downgrade version ?
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
I installed aws-sam-cli using homebrew and it stop working. I completely removed package from my local and use installable pacakge.
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?
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 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
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
For Mac , I only see Package Installer works as mention by @domengabrovsek
Got it. I'll try to reproduce the issue with SAM CLI installed through homebrew.
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.
created an issue in homebrew-core to follow up - https://github.com/Homebrew/homebrew-core/issues/162626
Hey all, closing the issue as homebrew has fixed the issue through https://github.com/Homebrew/homebrew-core/pull/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.
⚠️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.
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)