Viewing a single comment thread. View all comments

tknfor OP wrote (edited )

Reply to comment by emma in Quick question on postmill by tknfor

The postmill_error.log is empty which is a little confusing as a 500 error also appears when posting links. The links get posted but it shows a 500 error instead of returning to the post.

1

emma wrote

There's a var/log directory in the Postmill files. Check the logs there.

2

tknfor OP wrote

[2020-02-21T21:20:36.460301+00:00] request.INFO: Matched route "submit". {"route":"submit","route_parameters":{"_route":"submit","forum_name":"memes","_controller":"App\Controller\SubmissionController::submit"},"request_uri":"https://test.instance/submit/memes","method":"POST"} [] [2020-02-21T21:20:36.462994+00:00] security.DEBUG: Read existing security token from the session. {"key":"_security_main","token_class":"Symfony\Component\Security\Guard\Token\PostAuthenticationGuardToken"} [] [2020-02-21T21:20:36.492075+00:00] security.DEBUG: User was reloaded from a user provider. {"provider":"Symfony\Bridge\Doctrine\Security\User\EntityUserProvider","username":"banana"} [] [2020-02-21T21:20:36.492272+00:00] security.DEBUG: Checking for guard authentication credentials. {"firewall_key":"main","authenticators":1} [] [2020-02-21T21:20:36.492287+00:00] security.DEBUG: Checking support on guard authenticator. {"firewall_key":"main","authenticator":"App\Security\LoginAuthenticator"} [] [2020-02-21T21:20:36.492298+00:00] security.DEBUG: Guard authenticator does not support the request. {"firewall_key":"main","authenticator":"App\Security\LoginAuthenticator"} [] [2020-02-21T21:20:36.530959+00:00] php.WARNING: Warning: fopen(/var/www/Postmill/public/submission_images/8bcf4c407c92ca7406779c2e29a2b5c24b4daab0428d23aef9c9c4a5ab21c2de.jpeg): failed to open stream: Permission denied {"exception":"[object] (ErrorException(code: 0): Warning: fopen(/var/www/Postmill/public/submission_images/8bcf4c407c92ca7406779c2e29a2b5c24b4daab0428d23aef9c9c4a5ab21c2de.jpeg): failed to open stream: Permission denied at /var/www/Postmill/vendor/league/flysystem/src/Adapter/Local.php:157)"} [] [2020-02-21T21:20:36.531857+00:00] request.CRITICAL: Uncaught PHP Exception RuntimeException: "Couldn't store file" at /var/www/Postmill/src/Flysystem/ImageManager.php line 56 {"exception":"[object] (RuntimeException(code: 0): Couldn't store file at /var/www/Postmill/src/Flysystem/ImageManager.php:56)"} [] [2020-02-21T21:20:36.536405+00:00] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []

1

emma wrote

The image directories aren't writable as the user PHP runs as. Changing the owner to www-data is the easiest way to fix it.

2

tknfor OP wrote

That fixed it! I'm assuming it also explains why posting links lead to a 500 error. Which folder handles sharing of links?

Thanks!

1

emma wrote

Posting links would fail due to the image directories not being writable, as it tries to download a related image. Links themselves are stored in the database.

2

tknfor OP wrote (edited )

Hey thanks again for your help. One last question. While setting up the admin for the data base using this command: bin/console app:user:add admin1 --admin I get the following error:

There are no commands defined in the "app:user" namespace.

Did you mean one of these?

app

app:theme

1

emma wrote

That command is for older versions. See https://gitlab.com/postmill/Postmill/-/wikis/admin-accounts.

2

tknfor OP wrote

Like I've said bless you for all these answers. Could I also ask how to delete forum categories after they've been created?

1

emma wrote

This is actually not possible, sorry. Forum categories will likely be removed in a later version of Postmill anyway.

2

tknfor OP wrote

Thanks! I had to make the media/cache folder myself and gave it ownership to www-data and no more errors!

1