Skip to content

Commit 4952bf4

Browse files
authored
Add troubleshooting for file uploads (#165)
* Add troubleshooting for file uploads * add link for file permissions fix * fix some wording * fix wording part 2
1 parent b5a26e4 commit 4952bf4

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

docs/troubleshooting.mdx

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,22 @@ If you see a `500 | SERVER ERROR` or `An unexpected error was encountered while
1616
tail -n 1000 /var/www/pelican/storage/logs/laravel-$(date +%F).log | grep "\[$(date +%Y)"
1717
```
1818

19-
If the command above doesn't return anything you most likely have wrong permissions for your `storage` folder. So you first need to fix that.
19+
<details>
20+
<summary>Common errors</summary>
21+
22+
* `ErrorException: file_put_contents(_____): failed to open stream: Permission denied`: Wrong file permissions/ ownership for the panel files, see [below](#wrong-file-permissions).
23+
* `502 Bad Gateway Error`: Make sure that php-fpm is running and that you are using the correct php version in your webserver config.
24+
* `CSRF token mismatch`: Enable SSL for your Panel with HTTPS protocol scheme in the `APP_URL`, or set `SESSION_SECURE_COOKIE` to `false` in your `.env` file.
25+
* `Connection refused [tcp://_______:6379]`: Redis isn't running or isn't reachable for some other reason. (start by checking the status of the redis service: `systemctl status redis-server`)
26+
* `SSL: no alternative certificate subject name matches target host name '_______'`: The used SSL certificate for your panel isn't valid for your panel domain, see [this guide](./guides/ssl) for creating a new SSL certificate.
27+
* `General error: 8 attempt to write a readonly database`: Your `database.sqlite` has wrong file permissions and is read-only. Make sure the file is writable and owned by the correct user.
28+
* `Class '_____' not found`: This usually means you are missing php extensions. Make sure [all needed extensions](./panel/getting-started#dependencies) are installed and that you are using the correct php version.
29+
* `Connection timed out after 5001 milliseconds for _______:8080`: Your panel can't reach wings, see the wings connection issues steps below.
30+
</details>
31+
32+
### Wrong file permissions
33+
34+
If the command above doesn't return anything, you most likely have incorrect file permissions . So you first need to fix that.
2035
You can set the correct permissions by running `sudo chmod -R 755 /var/www/pelican/storage/* /var/www/pelican/bootstrap/cache/`. Also make sure that your panel files are owned by the correct user.
2136

2237
<Tabs groupId="webserver">
@@ -37,19 +52,6 @@ You can set the correct permissions by running `sudo chmod -R 755 /var/www/pelic
3752
</TabItem>
3853
</Tabs>
3954

40-
<details>
41-
<summary>Common errors</summary>
42-
43-
* `ErrorException: file_put_contents(_____): failed to open stream: Permission denied`: Wrong file permissions/ ownership for the panel files, see above.
44-
* `502 Bad Gateway Error`: Make sure that php-fpm is running and that you are using the correct php version in your webserver config.
45-
* `CSRF token mismatch`: Enable SSL for your Panel with HTTPS protocol scheme in the APP_URL, or set `SESSION_SECURE_COOKIE` to `false` in your `.env` file.
46-
* `Connection refused [tcp://_______:6379]`: Redis isn't running or isn't reachable for some other reason. (start by checking the status of the redis service: `systemctl status redis-server`)
47-
* `SSL: no alternative certificate subject name matches target host name '_______'`: The used SSL certificate for your panel isn't valid for your panel domain, see [this guide](./guides/ssl) for creating a new SSL certificate.
48-
* `General error: 8 attempt to write a readonly database`: Your `database.sqlite` has wrong file permissions and is readonly. Make sure the file is writeable and owned by the correct user.
49-
* `Class '_____' not found`: This usually means you are missing php extensions. Make sure [all needed extensions](./panel/getting-started#dependencies) are installed and that you are using the correct php version.
50-
* `Connection timed out after 5001 miliseconds for _______:8080`: Your panel can't reach wings, see the wings connection issues steps below.
51-
</details>
52-
5355
## Wings connection issues
5456

5557
### Check the wings service
@@ -131,3 +133,12 @@ tail -n 100 /var/www/pelican/storage/logs/laravel-$(date +%F).log | grep "\[$(da
131133
```
132134

133135
To recreate the queue worker service you can run `php /var/www/pelican/artisan p:environment:queue-service --overwrite`.
136+
137+
## File Upload issues
138+
139+
If a file upload form returns an error like `mountedActionsData.0.files.24d4b82d-a3ae-47fd-981f-8b2f0f6a21d4` it is most likely a proxy issue.
140+
141+
Make sure your `Trusted Proxies` are set to the correct ips, both in the panel settings and your proxy settings!
142+
Also make sure your webserver and/ or proxy have a high enough upload limit. (e.g. `client_max_body_size`, `upload_max_filesize` and `post_max_size`)
143+
144+
In some cases the issue can also be caused by incorrect file permissions. See [above](#wrong-file-permissions) on how to fix your file permissions.

0 commit comments

Comments
 (0)