Skip to content

Commit 41c6d04

Browse files
authored
Merge pull request #61 from makeplane/minio-policy-limitation
Troubleshoot: Bucket policy exceeds size limit
2 parents 512e921 + a12fc62 commit 41c6d04

File tree

5 files changed

+109
-4
lines changed

5 files changed

+109
-4
lines changed

mint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
"pages": [
117117
"self-hosting/troubleshoot/installation-errors",
118118
"self-hosting/troubleshoot/license-errors",
119-
"self-hosting/troubleshoot/cli-errors"
119+
"self-hosting/troubleshoot/cli-errors",
120+
"self-hosting/troubleshoot/storage-errors"
120121
]
121122
},
122123
{

self-hosting/govern/private-bucket.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,8 @@ To migrate from public to private bucket storage, follow the instructions below:
117117
docker cp <api_container>:/code/permissions.json .
118118
```
119119

120-
</Tip>
120+
</Tip>
121+
122+
## Troubleshoot
123+
124+
- [Bucket policy exceeds size limit](/self-hosting/troubleshoot/storage-errors#minio-buckey-policy-limitation)

self-hosting/manage/prime-cli.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,8 @@ Select a Action you want to perform:
153153
- **Exit**
154154
Closes the setup script and returns you to the command line.
155155

156-
</Accordion>
156+
</Accordion>
157+
158+
## Troubleshoot
159+
160+
- [Failed to update Prime CLI](/self-hosting/troubleshoot/cli-errors#failed-to-update-prime-cli)

self-hosting/methods/docker-compose.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,8 @@ If you want to upgrade to a paid plan, see [Plan upgrades](https://docs.plane.so
132132

133133
If all goes well, you will see something like this:
134134
![Restart Services](/images/docker-compose/restart-docker.png)
135-
</Accordion>
135+
</Accordion>
136+
137+
## Troubleshoot
138+
- [Error during Docker Compose execution](/self-hosting/troubleshoot/installation-errors#error-during-docker-compose-execution)
139+
- [Migrator container exited](/self-hosting/troubleshoot/installation-errors#migrator-container-exited)
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Storage errors
3+
---
4+
5+
This guide is designed to help you resolve common issues encountered while configuring storage in Plane. Each section includes potential causes and step-by-step solutions for identified problems.
6+
7+
## Bucket policy exceeds size limit
8+
9+
<div style={{color:"red"}}>
10+
Error: An error occurred (PolicyTooLarge) when calling the PutBucketPolicy operation: Policy exceeds the maximum allowed document size.
11+
</div>
12+
13+
This error occurs when the bucket policy exceeds the 20KB size limit allowed by MinIO. It typically happens when trying to add complex policies or when unnecessary data bloats the policy size.
14+
15+
To resolve this issue, you can define a streamlined bucket policy file and apply it correctly within the MinIO container. Follow these steps:
16+
17+
1. **Create a bucket policy JSON file**
18+
- On your local machine, create a file named `bucket-policy.json` with the following content:
19+
```json
20+
{
21+
"Version": "2012-10-17",
22+
"Statement": [
23+
{
24+
"Effect": "Allow",
25+
"Principal": {
26+
"AWS": ["*"]
27+
},
28+
"Action": ["s3:GetObject"],
29+
"Resource": ["arn:aws:s3:::uploads/*"],
30+
"Condition": {
31+
"StringEquals": {
32+
"s3:ExistingObjectTag/publicAccess": ["true"]
33+
}
34+
}
35+
}
36+
]
37+
}
38+
```
39+
40+
- Save this file in an accessible location.
41+
42+
2. **Set up and apply the policy**
43+
<Warning>
44+
**IMPORTANT**
45+
Make sure to execute all the `mc` commands **within the MinIO container** (either by attaching to it or using `docker exec`).
46+
</Warning>
47+
48+
- Configure MinIO alias:
49+
```bash
50+
mc alias set myminio http://plane-plane-minio:9000 <minio-username> <minio-password>
51+
```
52+
53+
Replace `plane-plane-minio:9000` with your MinIO server address.
54+
55+
- Tag existing objects:
56+
```bash
57+
mc find myminio/uploads --exec "mc tag set {} publicAccess=true"
58+
```
59+
60+
- Copy the policy file to the MinIO container:
61+
```bash
62+
docker cp bucket-policy.json <minio-container-id>:/tmp
63+
```
64+
65+
Replace `<minio-container-id>` with the actual ID of your MinIO container. You can find the container ID by running `docker ps`.
66+
67+
- Apply the policy to the bucket:
68+
```bash
69+
mc anonymous set-json /tmp/bucket-policy.json myminio/uploads
70+
```
71+
72+
3. **Verification**
73+
74+
- Verify that objects are correctly tagged:
75+
```bash
76+
mc tag list myminio/uploads/<object-name>
77+
```
78+
79+
- Test public access using:
80+
```bash
81+
curl http://<minio-server>:9000/uploads/<object-name>
82+
```
83+
84+
### Notes
85+
- Verify that the `access-key` and `secret-key` used for setting up the alias have adequate permissions to manage the bucket.
86+
- If your MinIO server is hosted on a different machine or address, replace `plane-plane-minio:9000` with the appropriate server URL.
87+
- After applying the policy, test the setup to confirm it is working as expected.
88+
89+
90+
91+
92+

0 commit comments

Comments
 (0)