files_upload_v2 returns internal_error when using markdown in blocks
まだ誰も着手していません。
評価
調査の方向性
AsyncWebClient.files_upload_v2 から開始し、files.completeUploadExternal に送信されるリクエストを追跡して、markdown ブロックを成功するブロックと比較します。Issue にあるリクエストを再現し、SDK の payload と Slack API のどちらに原因があるかを判断します。原因が切り分けられ、issue に検証済みの修正または文書化された upstream の制限があることを完了条件とします。
索引モデルが issue の本文から書いたものです。
説明
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!
- 主要言語
- Python
- スター
- 4k
- フォーク
- 857
- 平均マージ
- 22時間 21分
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
slackapi/python-slack-sdk のほかの issue
-
needs info server-side-issue
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
slackapi/python-slack-sdk#1961 · コメント 3 件 ·
-
Use logger.isEnabledFor(logging.DEBUG) instead of logger.level <= logging.DEBUG for debug guards オープンauto-triage-skip bug
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
slackapi/python-slack-sdk#1957 ·
-
auto-triage-skip discussion
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
slackapi/python-slack-sdk#1940 · コメント 2 件 ·
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channel オープンauto-triage-skip enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
slackapi/python-slack-sdk#1923 · コメント 2 件 ·
-
auto-triage-skip bug socket-mode
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
slackapi/python-slack-sdk#1922 · コメント 2 件 ·
slackapi/python-slack-sdk の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/Repo2RLEnv#163 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NousResearch/hermes-agent#121143 ·