spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Problems with 1-click install, sending AWS mail and CalculateStatisticsJob #268

Closed victortolbert closed 3 years ago

victortolbert commented 3 years ago

Describe your issue

Hi,

As soon as I click "Send test mail", after setting up the AWS mail configuration, I receive a 500 error.

The console reveals that the POST request to /settings/send-test-mail fails


Health check:

Environment: production Debug: OFF Horizon: Active Queue connection: OK Webhooks: 1 unprocessed webhooks Schedule: ran 0 minute(s) ago Default mailer: mailcoach Mailcoach mailer: null Campaign mailer: null Transactional mailer: null

Technical details

App directory: /var/www/html User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0 PHP version: 7.4.10 MySQL version: 5.7.32-0ubuntu0.18.04.1 Laravel version: 8.12.0 Horizon version: v5.3.0@2d6e60011c3d58c86a6c38f03374167bb1232a0a laravel-mailcoach version: 3.2.8 mailcoach-ui version: 1.0.3

victortolbert commented 3 years ago

Closing.

This seems like a duplicate of #267

victortolbert commented 3 years ago

I did a composer require aws/aws-sdk-php and now I can successfully send test emails but I'm still getting the above error.

Error: Class 'Aws\Ses\SesClient' not found in /var/www/html/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php:272
Environment | production
Debug | OFF
Horizon running |  
Queue connection | Queue connection settings for mailcoach-redis exist.
Webhooks | 1 unprocessed webhooks
Schedule | Ran 0 minute(s) ago
Default mailer: | mailcoach
Mailcoach mailer: | null
Campaign mailer: | null
Transactional mailer: | null

PHP | 7.4.10
MySQL | 5.7.32-0ubuntu0.18.04.1
Laravel | 8.13.0
Horizon | v5.4.0@d08d10ee12f53b7ba2cbb938eb23857e93fe51d3
laravel-mailcoach | 3.2.9
mailcoach-ui | 1.0.3

By the way, the CalculateStatisticsJob never succeeds.

ErrorException: file_put_contents(/var/www/html/storage/framework/cache/data/d8/48/d848bc9a37cb70ed132164049f646fc30a2c4617): failed to open stream: Permission denied in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:185
victortolbert commented 3 years ago

Rebooting the droplet resolved my sending issue.

Should nginx have automatically restarted upon reboot? I had to run sudo systemctl restart nginx

Also, the CalculateStatisticsJob is still failing with a permissions error.

ErrorException: file_put_contents(/var/www/html/storage/framework/cache/data/...): failed to open stream: > Permission denied in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:185

I ran php artisan clear:cache in an attempt to resolve.

Should I just recursively set the permissions to 777 on the storage folder?

victortolbert commented 3 years ago

I see that the CalculateStatisticsJob error is also reported here https://github.com/spatie/laravel-mailcoach/issues/366

freekmurze commented 3 years ago

Should I just recursively set the permissions to 777 on the storage folder?

That it'll fix it indeed.

@riasvdv will make sure this works out of the box soon.