Skip to content

AttributeError: 'NoneType' object has no attribute 'send' when using modal to collect data #461

@RachelDong

Description

@RachelDong

Hello,

I'm using slack modal to collect some data from user, the modal openned for user is like

The number of comment-department pairs showed in the modal depends on some internal logic.
The modal can be submitted successfully when there are 3 such comment-department pairs, but when there are more than 3 pairs submitted, the following error occurs:

on_error invoked (session id: f429bc62-393e-414a-bc43-8570b95a075b, error: error, message: unpack requires a buffer of 2 
bytes)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 284, in run_until_completion
    ] = _receive_messages(
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/internals.py", line 214, in _receive_messages
    return _fetch_messages(
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/internals.py", line 279, in _fetch_messages 
    current_data_length = struct.unpack("!H", bytes(remaining_bytes[2:10]))[0]
struct.error: unpack requires a buffer of 2 bytes
Received an unsupported data frame ......
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 355, in run_until_completion
    self.pong(data)
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 213, in pong
    self.sock.send(data)
AttributeError: 'NoneType' object has no attribute 'send'
on_error invoked (session id: bb83db5b-9fa3-4880-9fb5-e238a4b7cb75, error: error, message: unpack requires a buffer of 2 
bytes)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 284, in run_until_completion
    ] = _receive_messages(
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/internals.py", line 214, in _receive_messages
    return _fetch_messages(
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/internals.py", line 279, in _fetch_messages 
    current_data_length = struct.unpack("!H", bytes(remaining_bytes[2:10]))[0]
struct.error: unpack requires a buffer of 2 bytes
Received an unsupported data frame ......
on_error invoked (session id: bb83db5b-9fa3-4880-9fb5-e238a4b7cb75, error: AttributeError, message: 'NoneType' object has no attribute 'send')
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 355, in run_until_completion
    self.pong(data)
  File "/usr/local/lib/python3.9/site-packages/slack_sdk/socket_mode/builtin/connection.py", line 213, in pong
    self.sock.send(data)
AttributeError: 'NoneType' object has no attribute 'send'

I have no idea why I got this error, and this error only occurs when there are more than 3 comment-department pairs are submitted. Can anyone help me? Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions