# 配置S3上传到GCS时出现错误422无效参数

**URL:** https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937
**Category:** Support
**Tags:** uploads, s3
**Created:** [2023年五月5日 07:27 UTC](https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937 "2023-05-05T07:27:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yangsun\_Lau](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yangsun_lau/32/305599_2.png) [@Yangsun\_Lau](https://meta.discourse.org/u/Yangsun_Lau)
#### Post date: [2023年五月5日 07:27 UTC](https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937/1 "2023-05-05T07:27:36Z")

</div>

在使用 GCS 进行 S3 上传时，我遇到了 422 无效参数错误，似乎找不到任何线索或详细的错误日志。我唯一收到的日志是

{failed: “FAILED”, message: “Invalid argument.”}  
failed: “FAILED”  
message: “Invalid argument.”

我的配置设置如下

 ![Screenshot 2023-05-05 at 3.27.14 PM](https://global.discourse-cdn.com/meta/original/4X/d/a/2/da26bbfd96412663c28bff770649eac1686d946e.png)

如果可能的话，我在哪里可以查看详细的错误日志

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2023年五月8日 03:46 UTC](https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937/2 "2023-05-08T03:46:22Z")

</div>

也许可以试试 `YOURSITE/logs`

这有点棘手，我们主要只支持 AWS S3，GCS 属于社区尽力支持的范畴。

---

<div class="post-metadata">

### Author: ![Yangsun\_Lau](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yangsun_lau/32/305599_2.png) [@Yangsun\_Lau](https://meta.discourse.org/u/Yangsun_Lau)
#### Post date: [2023年五月8日 05:36 UTC](https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937/3 "2023-05-08T05:36:12Z")

</div>

是否可以从 logster 中移除所有硬编码的日志排除模式？我无法查看任何带有错误 422 的日志。

我相信 GCS API 应该有错误返回，但 discourse 应用正在抑制它。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2023年五月8日 16:58 UTC](https://meta.discourse.org/t/getting-error-422-invalid-argument-when-configure-s3-upload-with-gcs/263937/4 "2023-05-08T16:58:59Z")

</div>

您需要遵循 [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916#google-cloud-platform-storage-5) 中的建议。不建议在用户体验中配置 S3。
