snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Backup Notification Failed after 7.0.5 update

Open bstamand opened this issue 1 year ago • 14 comments

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

bstamand avatar Jun 25 '24 13:06 bstamand

Do you have MAIL_BACKUP_NOTIFICATION_DRIVER and MAIL_BACKUP_NOTIFICATION_ADDRESS set in your env?

snipe avatar Jun 25 '24 13:06 snipe

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'.

bstamand avatar Jun 25 '24 13:06 bstamand

And you set a MAIL_BACKUP_NOTIFICATION_ADDRESS?

snipe avatar Jun 25 '24 13:06 snipe

And you set a MAIL_BACKUP_NOTIFICATION_ADDRESS? Yes correct.

bstamand avatar Jun 25 '24 13:06 bstamand

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

Screenshot 2024-06-25 at 14 56 43

snipe avatar Jun 25 '24 13:06 snipe

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?

bstamand avatar Jun 25 '24 14:06 bstamand

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

composer install 
composer dump-autoload
php artisan config:clear

snipe avatar Jun 25 '24 15:06 snipe

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 '[email protected]' 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 avatar Jun 25 '24 15:06 bstamand

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 '[email protected]' 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', '[email protected]'), 'name' => env('MAIL_FROM_NAME', 'Example'), ],

Thank you for your time and help today.

bstamand avatar Jun 25 '24 16:06 bstamand

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?

snipe avatar Jun 26 '24 10:06 snipe

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.

bstamand avatar Jun 26 '24 12:06 bstamand

It would only use [email protected] if you don't have a value for that tho. Are you sure there's no typo or anything in your env?

snipe avatar Jun 26 '24 12:06 snipe

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

        'from' => [
            'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
            '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

triple-HA avatar Jul 24 '24 09:07 triple-HA

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

snipe avatar Jul 24 '24 11:07 snipe