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

sam start fails: VersionNotParseable ... sam.cmd: "TypeError: request() got an unexpected keyword argument 'chunked'" #3524

Closed
saweisulzer opened this issue Jun 5, 2023 · 9 comments
Labels
blocked waiting on third party / upstream / external bug We can reproduce the issue and confirmed it is a bug. pending-release sam

Comments

@saweisulzer
Copy link

saweisulzer commented Jun 5, 2023

Problem

AWSTemplateFormatVersion: 2010-09-09
Description:
  GeneratorCdk

# Transform section specifies one or more macros that AWS CloudFormation uses to process your template
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
Transform:
  'AWS::Serverless-2016-10-31'

# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
  Function:
    Timeout: 10
    Tracing: Active
  Api:
    TracingEnabled: True

# Resources declares the AWS resources that you want to include in the stack
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
Resources:
  # This is an SQS queue with all default configuration properties. To learn more about the available options, see
  # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-queues.html
  SimpleQueue:
    Type: AWS::SQS::Queue
  
  # This is the Lambda function definition associated with the source code: sqs-payload-logger.js. For all available properties, see
  # https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
  SQSPayloadLogger:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./src/Generator/
      Handler: generator::Generator.EtsGeneratorFunction::FunctionHandler
      Runtime: dotnet6
      Architectures:
        - x86_64
      MemorySize: 1024
      Timeout: 300
      Events:
        SQSQueueEvent:
          Type: SQS
          Properties:
            Queue: !GetAtt SimpleQueue.Arn
      Policies:
        # Give Lambda basic execution Permission to the helloFromLambda
        - AWSLambdaBasicExecutionRole

Outputs:  
  AppBucketArn:
    Description: "SQS Queue ARN"

Steps to reproduce the issue

  1. have template.yaml as ^^^
  2. click on AWS: Add Debug Configuration
  3. start the generated config

Expected behavior

SAM build app and starts it

but fails with:
2023-06-05 18:42:59 [ERROR]: log level: info
2023-06-05 18:42:59 [INFO]: endpoints: retrieving AWS endpoints data
2023-06-05 18:42:59 [INFO]: OS: Windows_NT x64 10.0.19045
2023-06-05 18:42:59 [INFO]: Visual Studio Code extension host: 1.78.2
2023-06-05 18:42:59 [INFO]: AWS Toolkit: 1.76.0
2023-06-05 18:42:59 [INFO]: node: 16.17.1
2023-06-05 18:42:59 [INFO]: electron: 22.5.2
2023-06-05 18:42:59 [INFO]: telemetry cache not found: 'c:\Users%USER%\AppData\Roaming\Code\User\globalStorage\amazonwebservices.aws-toolkit-vscode\telemetryCache'
2023-06-05 18:45:22 [WARN]: samCliLocator: found invalid SAM CLI (VersionNotParseable): C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd
2023-06-05 18:45:24 [WARN]: samCliLocator: found invalid SAM CLI (VersionNotParseable): C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd
2023-06-05 18:45:24 [INFO]: SAM CLI location (version: undefined): undefined
2023-06-05 18:45:24 [ERROR]: SamLaunchRequestError: SAM CLI was not found [MissingSamCli]

System details (run the AWS: About Toolkit command)

OS: Windows_NT x64 10.0.19045
Visual Studio Code extension host: 1.78.2
AWS Toolkit: 1.76.0
node: 16.17.1
electron: 22.5.2

sam is SAM CLI, version 1.85.0

@saweisulzer saweisulzer added the bug We can reproduce the issue and confirmed it is a bug. label Jun 5, 2023
@justinmk3
Copy link
Contributor

2023-06-05 18:45:22 [WARN]: samCliLocator: found invalid SAM CLI (VersionNotParseable): C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd

What does this print if you run it from your terminal:

"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" --info

@justinmk3 justinmk3 added the sam label Jun 5, 2023
@justinmk3 justinmk3 changed the title sam start almost every time fails sam start almost every time fails: VersionNotParseable ... sam.cmd Jun 5, 2023
@saweisulzer
Copy link
Author

saweisulzer commented Jun 5, 2023

"C:\Program Files\Amazon\AWSSAMCLI\bin\sam.cmd" --info
Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\__main__.py", line 12, in <module>
    cli(prog_name="sam")
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1054, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 920, in make_context
    self.parse_args(ctx, args)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1613, in parse_args
    rest = super().parse_args(ctx, args)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 1378, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 2360, in handle_parse_result
    value = self.process_value(ctx, value)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\click\core.py", line 2322, in process_value
    value = self.callback(ctx, self, value)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\cli\main.py", line 58, in print_info
    "additional_dependencies": gather_additional_dependencies_info(),
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\system_info.py", line 37, in gather_additional_dependencies_info
    "docker_engine": _gather_docker_info(),
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\lib\utils\system_info.py", line 60, in _gather_docker_info
    if is_docker_reachable(client):
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\samcli\local\docker\utils.py", line 90, in is_docker_reachable
    docker_client.ping()
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\docker\client.py", line 187, in ping
    return self.api.ping(*args, **kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\docker\api\daemon.py", line 166, in ping
    return self._result(self._get(self._url('/_ping'))) == 'OK'
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\docker\utils\decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\docker\api\client.py", line 230, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\requests\sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\urllib3\connectionpool.py", line 496, in _make_request
    conn.request(
TypeError: request() got an unexpected keyword argument 'chunked'

is this because of docker desktop 4.20.0 ???
docker --version
Docker version 24.0.2, build cb74dfc

@justinmk3
Copy link
Contributor

TypeError: request() got an unexpected keyword argument 'chunked'

Seems like the sam install is broken somehow. Perhaps try reinstalling: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html

If sam --info doesn't work then AWS Toolkit won't work.

@justinmk3 justinmk3 added needs-response Waiting on reply from issue/PR author. and removed bug We can reproduce the issue and confirmed it is a bug. labels Jun 5, 2023
@saweisulzer
Copy link
Author

Already tried this (repairing and deinstall->install) (helped last time I had probs with aws sam): but no change.

@PalmTreeOnFire
Copy link

PalmTreeOnFire commented Jun 6, 2023

I tried with the most recent nightly build of SAM CLI; same behavior.

My Docker Desktop is 4.14

@PalmTreeOnFire
Copy link

This appears to be related:

aws/aws-sam-cli#5243

@PalmTreeOnFire
Copy link

I can report that rolling back to SAM 1.84.0 solves the problem for me, both sam --info and the AWS extension for VS Code.

@saweisulzer
Copy link
Author

downgrade of sam to 1.84.0 as workaround helped

@justinmk3
Copy link
Contributor

Thanks for the followup! Based on aws/aws-sam-cli#5243 , this should be fixed in the next release of sam cli.

@justinmk3 justinmk3 added blocked waiting on third party / upstream / external and removed needs-response Waiting on reply from issue/PR author. labels Jun 6, 2023
@justinmk3 justinmk3 reopened this Jun 8, 2023
@justinmk3 justinmk3 pinned this issue Jun 8, 2023
@justinmk3 justinmk3 added the bug We can reproduce the issue and confirmed it is a bug. label Jun 8, 2023
@justinmk3 justinmk3 changed the title sam start almost every time fails: VersionNotParseable ... sam.cmd sam start fails: VersionNotParseable ... sam.cmd Jun 8, 2023
@justinmk3 justinmk3 changed the title sam start fails: VersionNotParseable ... sam.cmd sam start fails: VersionNotParseable ... sam.cmd: "TypeError: request() got an unexpected keyword argument 'chunked'" Jun 8, 2023
@justinmk3 justinmk3 unpinned this issue Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked waiting on third party / upstream / external bug We can reproduce the issue and confirmed it is a bug. pending-release sam
Projects
None yet
Development

No branches or pull requests

3 participants