files_upload_v2 returns internal_error when using markdown in blocks
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu từ AsyncWebClient.files_upload_v2 và theo dõi request được gửi đến files.completeUploadExternal, so sánh block markdown với các block thành công. Tái hiện request từ issue và xác định SDK payload hay Slack API là nguyên nhân. Được xem là hoàn tất khi nguyên nhân đã được cô lập và issue có verified fix hoặc một upstream limitation được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
files_upload_v2 returns internal_error when using markdown in blocks parameter
Reproducible in:
slack-bolt==1.25.0
slack-sdk==3.36.0
Python 3.13.5
ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
Darwin Kernel Version 24.5.0
The Slack SDK version
slack-bolt==1.25.0
slack-sdk==3.36.0
Python runtime version
Python 3.13.5
OS info
ProductName: macOS
ProductVersion: 15.5
BuildVersion: 24F74
Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6041
Steps to reproduce:
1. Code Example
from slack_sdk.web.async_client import AsyncWebClient
import json
# Initialize client
client = AsyncWebClient(token="xoxb-your-token")
# Prepare parameters
channel_id = "D099T7G7VHD" # DM channel
blocks = [{"type": "markdown", "text": "_**Haim Raitsev** posted a new message_\\n> test"}]
files = [{"id": "F09J0L8TDRQ", "title": "screenshot.png"}]
# Attempt to upload with blocks
response = await client.files_upload_v2(
channel=channel_id,
file_uploads=[
{
"content": b"<file_bytes_here>",
"filename": "screenshot.png",
"title": "screenshot.png"
}
],
blocks=json.dumps(blocks)
)
2. Response
{
"ok": False,
"error": "internal_error"
}
Expected result:
The file should be uploaded successfully with the rich text blocks displayed in the message, as the underlying files.completeUploadExternal:
Actual result:
The API returns {"ok": false, "error": "internal_error"} without any additional error details.
Additional Context:
This issue is reproduced only when we have a new markdown block (https://docs.slack.dev/reference/block-kit/blocks/markdown-block/) when we use other blocks the message posted correctly.
files.completeUploadExternal API Call
HTTP Request
POST https://slack.com/api/files.completeUploadExternal HTTP/1.1
Host: slack.com
Authorization: Bearer xoxb-your-token-here
Content-Type: application/x-www-form-urlencoded
Request Details
Method: POST
URL: https://slack.com/api/files.completeUploadExternal
Headers:
Authorization: Bearer xoxb-your-token-here
Content-Type: application/x-www-form-urlencoded
Body (URL-encoded):
files=[{"id":"F09J0L8TDRQ","title":"screenshot.png"}]
channel_id=D099T7G7VHD
blocks=[{"type":"markdown","text":"_**Haim Raitsev** posted a new message_\\n> test"}]
Body Parameters Breakdown
| Parameter | Value | Description |
|---|---|---|
files |
[{"id":"F09J0L8TDRQ","title":"screenshot.png"}] |
JSON array of file objects (URL-encoded) |
channel_id |
D099T7G7VHD |
DM channel ID where file will be shared |
blocks |
[{"type":"markdown","text":"_**Haim Raitsev** posted a new message_\\n> test"}] |
JSON array of blocks (URL-encoded) |
Example using cURL
curl -X POST https://slack.com/api/files.completeUploadExternal \
-H "Authorization: Bearer xoxb-your-token-here" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode 'files=[{"id":"F09J0L8TDRQ","title":"screenshot.png"}]' \
--data-urlencode 'channel_id=D099T7G7VHD' \
--data-urlencode 'blocks=[{"type":"markdown","text":"_**Haim Raitsev** posted a new message_\\n> test"}]'
Error Response (Current Issue)
{
"ok": false,
"error": "internal_error"
}
Thank you for maintaining this excellent SDK!
- Ngôn ngữ chính
- Python
- Star
- 4k
- Fork
- 857
- Merge trung bình
- 22 giờ 21 phút
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của slackapi/python-slack-sdk
-
needs info server-side-issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
slackapi/python-slack-sdk#1961 · 3 bình luận ·
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards Đang mởauto-triage-skip bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
slackapi/python-slack-sdk#1940 · 2 bình luận ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel Đang mởauto-triage-skip enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
slackapi/python-slack-sdk#1923 · 2 bình luận ·
-
SocketModeClient.connect() retries forever against a permanently closed aiohttp ClientSession Đang mởauto-triage-skip bug socket-mode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
slackapi/python-slack-sdk#1922 · 2 bình luận ·
Tất cả issue của slackapi/python-slack-sdk
Issue tương tự
-
bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
open-webui/open-webui#30750 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100