You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I've run into the following error when developing an application w/slack_bolt:
{
"message": "Cannot set tag: Tag http.status_code is already set",
"name": "DuplicateTraceSpanName",
"stacktrace": "Traceback (most recent call last):\n File \"/var/runtime/urllib3/connectionpool.py\", line 440, in _make_request\n httplib_response = conn.getresponse(buffering=True)\n File \"/opt/python/sls_sdk/lib/instrumentation/http.py\", line 306, in _func\n response = self._original_getresponse(_self, *args, **kwargs)\nTypeError: getresponse() got an unexpected keyword argument 'buffering'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/python/sls_sdk/lib/tags.py\", line 60, in set\n self._set(key, value)\n File \"/opt/python/sls_sdk/lib/tags.py\", line 56, in _set\n raise DuplicateTraceSpanName(f\"Cannot set tag: Tag {name} is already set\")\nsls_sdk.exceptions.DuplicateTraceSpanName: Cannot set tag: Tag http.status_code is already set\n",
"type": "ERROR_TYPE_CAUGHT_SDK_INTERNAL"
}
Here is the stacktrace value in a more readable form:
Traceback (most recent call last):
File "/var/runtime/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/opt/python/sls_sdk/lib/instrumentation/http.py", line 306, in _func
response = self._original_getresponse(_self, *args, **kwargs)
TypeError: getresponse() got an unexpected keyword argument 'buffering'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/python/sls_sdk/lib/tags.py", line 60, in set
self._set(key, value)
File "/opt/python/sls_sdk/lib/tags.py", line 56, in _set
raise DuplicateTraceSpanName(f"Cannot set tag: Tag {name} is already set")
sls_sdk.exceptions.DuplicateTraceSpanName: Cannot set tag: Tag http.status_code is already set
Here is code for the lambda application defining a simple slack bot that accepts one slash command:
importosimportlogging# Slack boltimportsyssys.path.insert(0, 'deps')
fromslack_boltimportAppfromslack_bolt.adapter.aws_lambdaimportSlackRequestHandler# Set up the bolt applicationapp=App(
process_before_response=True,
token=os.environ['SLACK_BOT_TOKEN'],
signing_secret=os.environ['SLACK_SIGNING_SECRET']
)
# Log incoming requests@app.middlewaredeflog_req(logger, body, next):
logger.debug(body)
returnnext()
# Acknowledge incoming slack commanddefacknowledge_command(body, ack):
# Acknowledge commandif (body_text:=body.get('text')) isNoneorbody_text.strip() =='':
ack(f':x: `{body.get("command")}` needs more context')
# Got command, no responseack()
# Actual processing of the commanddefprocess_command(respond, body):
respond(f'Completed! (task: {body.get("command")})')
# Register command with applicationapp.command('/test')(
ack=acknowledge_command,
lazy= [process_command]
)
# Set up logging format and levelSlackRequestHandler.clear_all_log_handlers()
logging.basicConfig(
format='%(asctime)s %(message)s',
level=logging.WARN
)
# Set up lambda functiondefhandler(event, context):
returnSlackRequestHandler(app=app).handle(event, context)
Please let me know if any additional information is required.
The text was updated successfully, but these errors were encountered:
Hello, I've run into the following error when developing an application w/
slack_bolt
:Here is the
stacktrace
value in a more readable form:Here is code for the lambda application defining a simple slack bot that accepts one slash command:
Please let me know if any additional information is required.
The text was updated successfully, but these errors were encountered: