# 尝试上传图片时出现“访问被拒绝”错误消息

**URL:** https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864
**Category:** Support
**Created:** [2020年八月14日 12:58 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864 "2020-08-14T12:58:58Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![brikohler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brikohler/32/165102_2.png) [@brikohler](https://meta.discourse.org/u/brikohler)
#### Post date: [2020年八月14日 12:58 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/1 "2020-08-14T12:58:58Z")

</div>

我在 Discourse 上上传任何图片时都遇到了问题。如果我自己或他人尝试在话题中上传图片，或尝试添加头像图片，都会收到“访问被拒绝”的提示。甚至连网站的 favicon 也出现了问题。这可能是什么原因导致的？

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [2020年八月14日 13:27 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/2 "2020-08-14T13:27:33Z")

</div>

> [@brikohler](#):
>
> 这可能是什么原因导致的？

可能有上百种原因。

- 你检查过日志吗？（sitedomain/logs）
- 你是以 root 身份运行该应用程序吗？
- 是否有足够的可用存储空间？

---

<div class="post-metadata">

### Author: ![brikohler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brikohler/32/165102_2.png) [@brikohler](https://meta.discourse.org/u/brikohler)
#### Post date: [2020年八月14日 14:33 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/3 "2020-08-14T14:33:50Z")

</div>

> [@IAmGav](#):
>
> 你检查过日志了吗？（站点域名/logs）

看起来是 S3 或存储桶的错误。  
日志：

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/4/84ea5669eaa95e41cfdfed5de2c3819c7b522fae.png)

> [@IAmGav](#):
>
> 有足够的可用存储空间吗？

我可以在哪里查看这个？

---

<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: [2020年八月14日 15:43 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/4 "2020-08-14T15:43:45Z")

</div>

> [@brikohler](#):
>
> 看起来是 S3 或存储桶错误  
> 日志：

那么你应该检查一下你的 S3 配置。

你是如何安装 Discourse 的？

---

<div class="post-metadata">

### Author: ![brikohler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brikohler/32/165102_2.png) [@brikohler](https://meta.discourse.org/u/brikohler)
#### Post date: [2020年八月14日 16:10 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/5 "2020-08-14T16:10:55Z")

</div>

> [@pfaffman](#):
>
> 你是如何安装 Discourse 的？

我需要查一下。那是很久以前做的，而且不是我操作的：  
你能给我一些建议，告诉我该怎么弄清楚吗？

> [@pfaffman](#):
>
> 那你应该检查一下你的 S3 配置。

我会试着找些资料来阅读和学习一下。

---

<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: [2020年八月14日 16:23 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/6 "2020-08-14T16:23:22Z")

</div>

查看 [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916) 和 [https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229。](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229%E3%80%82)

如果您可以通过 SSH 连接到服务器，并且存在 `/var/discourse` 目录，那么您很可能使用的是“标准安装”（参见 [Discourse 官方标准安装](https://meta.discourse.org/t/discourse-official-standard-installation/142537)）。

---

<div class="post-metadata">

### Author: ![brikohler](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/brikohler/32/165102_2.png) [@brikohler](https://meta.discourse.org/u/brikohler)
#### Post date: [2020年九月2日 18:57 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/7 "2020-09-02T18:57:00Z")

</div>

是我的存储桶出了问题。我已经修正了。谢谢！

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年十月2日 18:57 UTC](https://meta.discourse.org/t/access-denied-error-message-when-trying-to-upload-images/160864/8 "2020-10-02T18:57:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
