snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.88k stars 3.14k forks source link

Backup Notification Failed after 7.0.5 update #14964

Open bstamand opened 2 months ago

bstamand commented 2 months ago

Debug mode

Describe the bug

After updating to 7.0.5, backup notifications are failing. However test email notifications are working from the settings menu.

Reproduction steps

1.Run backup 2. 3. ...

Expected behavior

Backup runs and send email notifications.

Screenshots

Capture

Snipe-IT Version

7.0.5

Operating System

Rocky Linux 9

Web Server

Apache

PHP Version

8.3.8

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

snipe commented 2 months ago

Do you have MAIL_BACKUP_NOTIFICATION_DRIVER and MAIL_BACKUP_NOTIFICATION_ADDRESS set in your env?

bstamand commented 2 months ago

Do you have MAIL_BACKUP_NOTIFICATION_DRIVER and MAIL_BACKUP_NOTIFICATION_ADDRESS set in your env?

Hey there. Yes I do. MAIL_BACKUP_NOTIFICATION_DRIVER is set to 'mail'.

snipe commented 2 months ago

And you set a MAIL_BACKUP_NOTIFICATION_ADDRESS?

bstamand commented 2 months ago

And you set a MAIL_BACKUP_NOTIFICATION_ADDRESS? Yes correct.

snipe commented 2 months ago

Hm, I'm not able to reproduce this locally. :(

Screenshot 2024-06-25 at 14 56 43
bstamand commented 2 months ago

Hm, I'm not able to reproduce this locally. :(

Screenshot 2024-06-25 at 14 56 43

Hmm interesting. Do I need quotes around the address?

snipe commented 2 months ago

You shouldn’t need it, but I guess give it a try? Also run

composer install 
composer dump-autoload
php artisan config:clear
bstamand commented 2 months ago

You shouldn’t need it, but I guess give it a try? Also run

composer install 
composer dump-autoload
php artisan config:clear

Thank you. The quotations made no difference. Also, I ran the commands you suggested with no luck either. Looking at the logs, it appears that the address 'hello@example.com' is failing authentication with Amazon SES however I can't seem to find this entry anywhere to change it. I looked through the env file and it looks correct.

bstamand commented 2 months ago

You shouldn’t need it, but I guess give it a try? Also run

composer install 
composer dump-autoload
php artisan config:clear

Thank you. The quotations made no difference. Also, I ran the commands you suggested with no luck either. Looking at the logs, it appears that the address 'hello@example.com' is failing authentication with Amazon SES however I can't seem to find this entry anywhere to change it. I looked through the env file and it looks correct.

Just to let you know, I was able to resolve the issue by going into config/backup.php and manually editing this entry to reflect my send from address.

'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 'name' => env('MAIL_FROM_NAME', 'Example'), ],

Thank you for your time and help today.

snipe commented 2 months ago

You should definitely never have to edit config files directly, and it's generally recommended that you don't, since your next upgrade will give you git problems. Do you have a MAIL_FROM_ADDRESS set in your env?

bstamand commented 2 months ago

You should definitely never have to edit config files directly, and it's generally recommended that you don't, since your next upgrade will give you git problems. Do you have a MAIL_FROM_ADDRESS set in your env?

Hi there. Yes I do.

snipe commented 2 months ago

It would only use hello@example.com if you don't have a value for that tho. Are you sure there's no typo or anything in your env?

triple-HA commented 2 months ago

I found a problem in config/backup.php `'mail' => [ 'to' => env('MAIL_BACKUP_NOTIFICATION_ADDRESS', null),

        'from' => [
            'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
            'name' => env('MAIL_FROM_NAME', 'Example'),
        ],
    ],`

There is no "MAIL_FROM_ADDRESS" variable in the .env file configuration. There is "MAIL_FROM_ADDR". If we won't change backup.php for future upgrade reasen we must add this ("MAIL_FROM_ADDRESS") variable to .env file, run php artisan config:clear and everything works fine. Can we expect a change in the next update? Problem still available on v7.0.9

snipe commented 2 months ago

@triple-HA - that fix is now on master and will be in the next release