Skip to content

TypeError: __call__() got an unexpected keyword argument 'ack' in samples/aws_chalice/simple_app.py #36

@susumuota

Description

@susumuota

Bug Report

I got an error "TypeError: __call__() got an unexpected keyword argument 'ack'" when I deployed samples/aws_chalice/simple_app.py to Chalice.

Reproducible in:

The slack_bolt version

slack-bolt==0.2.1a0
slack-sdk==3.0.0a3

Python runtime version

Python 3.7.7

OS info

ProductName:	Mac OS X
ProductVersion:	10.15.6
BuildVersion:	19G73
Darwin Kernel Version 19.6.0: Sun Jul  5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., setup.py))

cd samples/aws_chalice
cp -p .chalice/config.json.simple .chalice/config.json
# edit .chalice/config.json to change environment variables.
cp -p app.py app.py.org
cp -p simple_app.py app.py
sh deploy.sh

Expected result:

deploy.sh should finish successfully.

If I commented out these 3 lines it finished without error.

# bolt_app.command("/hello-bolt-python-chalice")(
#     ack=respond_to_slack_within_3_seconds, subsequent=[can_be_long],
# )

Actual result:

Note: I copied simple_app.py to app.py.

Traceback (most recent call last):
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/cli/__init__.py", line 636, in main
    return cli(obj={})
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/cli/__init__.py", line 206, in deploy
    deployed_values = d.deploy(config, chalice_stage_name=stage)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/deploy/deployer.py", line 354, in deploy
    return self._deploy(config, chalice_stage_name)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/deploy/deployer.py", line 360, in _deploy
    self._validate_config(config)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/deploy/deployer.py", line 383, in _validate_config
    validate_configuration(config)
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/deploy/validate.py", line 40, in validate_configuration
    routes = config.chalice_app.routes
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/config.py", line 141, in chalice_app
    app = v()
  File "/Users/ota/Documents/python/bolt-python/venv/lib/python3.7/site-packages/chalice/cli/factory.py", line 275, in load_chalice_app
    app = importlib.import_module('app')
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/ota/Documents/python/bolt-python/samples/aws_chalice/app.py", line 39, in <module>
    ack=respond_to_slack_within_3_seconds, subsequent=[can_be_long],
TypeError: __call__() got an unexpected keyword argument 'ack'

Requirements (place an x in each of the [ ])

  • This is a bug specific to this SDK project.
  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions