coze-dev / coze-dev/coze-studio
coze-studio-0.3.0生成火山TOS对象的URL,访问后显示SignatureDoesNotMatch
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
### 部署环境
coze-studio使用docker compose部署在局域网,模型为火山引擎提供的Doubao-Seed-1.6,对象存储采用火山的TOS服务。
### 问题
在coze工作流的**开始**节点上传图片后(调用TOS的上传功能正常),**Doubao-Seed-1.6大模型**节点运行失败,返回错误代码如下:
```
"Workflow execution failure: Error code: 400 - {
"code": "InvalidParameter",
"message": "Error while downloading: https://bucket-name.tos-cn-shanghai.volces.com/tos-cn-i-v4nquku3lp/358b6fed-cdb4-4b28-a125-909962b2c685.png?X-Tos-Algorithm=TOS4-HMAC-SHA256\\u0026X-Tos-Credential=******%2F20250925%2Fcn-shanghai%2Ftos%2Frequest\\u0026X-Tos-Date=20250925T074232Z\\u0026X-Tos-Expires=86400\\u0026X-Tos-Signature=dc69d019bc2f5232650e33af7477bdd95b1e1dcc136a82c369ada3fc57473a3c\\u0026X-Tos-SignedHeaders=host\\u0026x-wf-file_name=test.png, status code: 403 Request id: 021758786156577dd3a5faac23f0c9eed6bd811669e43cb847064",
"param": "image_url",
"type": "BadRequest",
"request_id": "2025092515423300009AADF528127CF518"
}"
```
使用浏览器访问**开始**节点传入**大模型**节点的URL后,显示:
```
{
"Code": "SignatureDoesNotMatch",
"RequestId": "b17801d4f4dcc15c68d4f4dc-bbe8b18-1v1gmi-GO-cs-tos-front-aza-19",
"HostId": "LClavePEyQIVsVaxdyjQTJDywRRIPjGm",
"Message": "The request signature we calculated does not match the signature you provided. Check your key and signing method.",
"EC": "0002-00000024",
"AccessKeyId": "******",
"StringToSign": "TOS4-HMAC-SHA256\n20250925T074232Z\n20250925/cn-shanghai/tos/request\n73821a29020a180c8a898db93d9c040990d6e41d60c28fa152856f47ddde0e55",
"SignatureProvided": "dc69d019bc2f5232650e33af7477bdd95b1e1dcc136a82c369ada3fc57473a3c",
"StringToSignBytes": "54 4f 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 32 35 30 39 32 35 54 30 37 34 32 33 32 5a 0a 32 30 32 35 30 39 32 35 2f 63 6e 2d 73 68 61 6e 67 68 61 69 2f 74 6f 73 2f 72 65 71 75 65 73 74 0a 37 33 38 32 31 61 32 39 30 32 30 61 31 38 30 63 38 61 38 39 38 64 62 39 33 64 39 63 30 34 30 39 39 30 64 36 65 34 31 64 36 30 63 32 38 66 61 31 35 32 38 35 36 66 34 37 64 64 64 65 30 65 35 35",
"canonical_request": "GET\n/tos-cn-i-v4nquku3lp/358b6fed-cdb4-4b28-a125-909962b2c685.png\nX-Tos-Algorithm=TOS4-HMAC-SHA256&X-Tos-Credential=******%2F20250925%2Fcn-shanghai%2Ftos%2Frequest&X-Tos-Date=20250925T074232Z&X-Tos-Expires=86400&X-Tos-SignedHeaders=host&x-wf-file_name=test.png\nhost:bucket-name.tos-cn-shanghai.volces.com\n\nhost\nUNSIGNED-PAYLOAD",
"canonical_request_bytes": "47 45 54 0a 2f 74 6f 73 2d 63 6e 2d 69 2d 76 34 6e 71 75 6b 75 33 6c 70 2f 33 35 38 62 36 66 65 64 2d 63 64 62 34 2d 34 62 32 38 2d 61 31 32 35 2d 39 30 39 39 36 32 62 32 63 36 38 35 2e 70 6e 67 0a 58 2d 54 6f 73 2d 41 6c 67 6f 72 69 74 68 6d 3d 54 4f 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 26 58 2d 54 6f 73 2d 43 72 65 64 65 6e 74 69 61 6c 3d 41 4b 4c 54 59 57 4a 68 4e 6a 4e 6c 5a 57 55 7a 4d 44 41 34 4e 44 5a 6d 59 6d 49 77 5a 57 51 31 4d 7a 59 34 4d 44 56 6a 4d 57 49 79 59 6a 45 25 32 46 32 30 32 35 30 39 32 35 25 32 46 63 6e 2d 73 68 61 6e 67 68 61 69 25 32 46 74 6f 73 25 32 46 72 65 71 75 65 73 74 26 58 2d 54 6f 73 2d 44 61 74 65 3d 32 30 32 35 30 39 32 35 54 30 37 34 32 33 32 5a 26 58 2d 54 6f 73 2d 45 78 70 69 72 65 73 3d 38 36 34 30 30 26 58 2d 54 6f 73 2d 53 69 67 6e 65 64 48 65 61 64 65 72 73 3d 68 6f 73 74 26 78 2d 77 66 2d 66 69 6c 65 5f 6e 61 6d 65 3d 74 65 73 74 2e 70 6e 67 0a 68 6f 73 74 3a 62 75 73 6b 65 74 2d 66 6f 72 2d 63 6f 7a 65 2e 74 6f 73 2d 63 6e 2d 73 68 61 6e 67 68 61 69 2e 76 6f 6c 63 65 73 2e 63 6f 6d 0a 0a 68 6f 73 74 0a 55 4e 53 49 47 4e 45 44 2d 50 41 59 4c 4f 41 44"
}
```
**实际情况是图片已成功上传入对应的TOS桶,只是在获取对象时coze-studio生成的URL出现问题。**
### coze本地的配置文件
* ### .env
```
export FILE_UPLOAD_COMPONENT_TYPE="storage"
# Storage component
export STORAGE_TYPE="tos" # minio / tos / s3
export STORAGE_UPLOAD_HTTP_SCHEME="http" # http / https. If coze studio website is https, you must set it to https
export STORAGE_BUCKET="bucket-name"
# TOS
export TOS_ACCESS_KEY="******"
export TOS_SECRET_KEY="******"
export TOS_ENDPOINT=https://tos-cn-shanghai.volces.com
export TOS_BUCKET_ENDPOINT=https://bucket-name.tos-cn-shanghai.volces.com
export TOS_REGION=cn-shanghai
```
ak和sk使用的是火山主账号的key,主账号拥有桶的完全读写权限,但即便使用公开读写的桶也会出现上述问题。
Contributor guide
Research direction
Start by tracing the TOS object URL generation used after image upload, using the STORAGE_TYPE, TOS_ENDPOINT, TOS_BUCKET_ENDPOINT, and TOS_REGION settings in the issue. Compare the generated URL and signature behavior with the reported TOS error; done means uploaded images can be retrieved and passed to the Doubao-Seed-1.6 node without SignatureDoesNotMatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100