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

Backups page fails to load - V3 - IIS8

Open ghost opened this issue 10 years ago • 18 comments

It looks to me like a clash in folder structures, given the mix of Linux / Windows paths in the error.

Expected Behavior (or desired behavior if a feature request)

I'd expect the backups page to display and allow me to produce a backup of the database.


Actual Behavior

ErrorException in SettingsController.php line 444:

opendir(C:\inetpub\wwwroot\snipe-it\storage/app/backups,C:\inetpub\wwwroot\snipe-it\storage/app/backups): The system cannot find the file specified. (code: 2)


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running - V3
  • What OS and web server you're running Snipe-IT on - Windows IIS8
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) - Manual
  • If you're getting an error in your browser, include that error - Included above
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error - Any page, when selecting 'Backups' from the Admin drop down menu.
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproduceable on the demo.
  • Include any additional information you can find in app/storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database - No definitely not.

ghost avatar Jun 07 '16 10:06 ghost

I fixed the forward slashes to back slashes in SettingsController.php line 444 and the backup page now loads. However no backup is taken when Generate backup is hit. It doesn't error either.

ghost avatar Jun 08 '16 15:06 ghost

Can you show me your app/config/laravel-backup.php file?

snipe avatar Jun 08 '16 15:06 snipe


return [

    'backup' => [

        /*
         * The name of this application. You can use this name to monitor
         * the backups.
         */
        'name' => 'backups',

        'source' => [

            'files' => [

                /*
                 * The list of directories that should be part of the backup. You can
                 * specify individual files as well.
                 */
                'include' => [
                    base_path('public/uploads'),
                    base_path('config'),
                    base_path('storage/private_uploads'),
                ],

                /*
                 * These directories will be excluded from the backup.
                 * You can specify individual files as well.
                 */
                'exclude' => [
//                    base_path('vendor'),
//                    base_path('node_modules'),
                ],

                /*
                 * Determines if symlinks should be followed.
                 */
                'followLinks' => false,
            ],

            /*
             * The names of the connections to the databases that should be part of the backup.
             * Currently only MySQL- and PostgreSQL-databases are supported.
             */
            'databases' => [
                'mysql',
            ],
        ],

        'destination' => [

            /*
             * The disk names on which the backups will be stored.
             */
            'disks' => [
                'local',
            ],
        ],
    ],

    'cleanup' => [
        /*
         * The strategy that will be used to cleanup old backups.
         * The youngest backup will never be deleted.
         */
        'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class,

        'defaultStrategy' => [

            /*
             * The amount of days that all daily backups must be kept.
             */
            'keepAllBackupsForDays' => 7,

            /*
             * The amount of days that all daily backups must be kept.
             */
            'keepDailyBackupsForDays' => 16,

            /*
             * The amount of weeks of which one weekly backup must be kept.
             */
            'keepWeeklyBackupsForWeeks' => 8,

            /*
             * The amount of months of which one monthly backup must be kept.
             */
            'keepMonthlyBackupsForMonths' => 4,

            /*
             * The amount of years of which one yearly backup must be kept
             */
            'keepYearlyBackupsForYears' => 2,

            /*
             * After cleaning up the backups remove the oldest backup until
             * this amount of megabytes has been reached.
             */
            'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000
        ]
    ],


    /*
     *  In this array you can specify which backups should be monitored.
     *  If a backup does not meet the specified requirements the
     *  UnHealthyBackupWasFound-event will be fired.
     */
    'monitorBackups' => [
        [
            'name' => 'backups',
            'disks' => ['local'],
            'newestBackupsShouldNotBeOlderThanDays' => 1,
            'storageUsedMayNotBeHigherThanMegabytes' => 5000,
        ],

        /*
        [
            'name' => 'name of the second app',
            'disks' => ['local', 's3'],
            'newestBackupsShouldNotBeOlderThanDays' => 1,
            'storageUsedMayNotBeHigherThanMegabytes' => 5000,
        ],
        */
    ],

    'notifications' => [

        /*
         * This class will be used to send all notifications.
         */
        'handler' => Spatie\Backup\Notifications\Notifier::class,

        /*
         * Here you can specify the ways you want to be notified when certain
         * events take place. Possible values are "log", "mail", "slack" and "pushover".
         *
         * Slack requires the installation of the maknz/slack package.
         */
        'events' => [
            'whenBackupWasSuccessful'     => ['log'],
            'whenCleanupWasSuccessful'    => ['log'],
            'whenHealthyBackupWasFound'   => ['log'],
            'whenBackupHasFailed'         => ['log', 'mail'],
            'whenCleanupHasFailed'        => ['log', 'mail'],
            'whenUnhealthyBackupWasFound' => ['log', 'mail'],
        ],

        /*
         * Here you can specify how emails should be sent.
         */
        'mail' => [
            'from' => env('MAIL_FROM_ADDR', '[email protected]'),
            'to'   => env('MAIL_FROM_ADDR', '[email protected]'),
        ],

        /*
         * Here you can specify how messages should be sent to Slack.
         */
        'slack' => [
            'channel'  => '#backups',
            'username' => 'Backup bot',
            'icon'     => ':robot:',
        ],

        /*
         * Here you can specify how messages should be sent to Pushover.
         */
        'pushover' => [
            'token'  => env('PUSHOVER_APP_TOKEN'),
            'user'   => env('PUSHOVER_USER_KEY'),
            'sounds' => [
                'success' => env('PUSHOVER_SOUND_SUCCESS','pushover'),
                'error'   => env('PUSHOVER_SOUND_ERROR','siren'),
            ],
        ],
    ]
];

ghost avatar Jun 08 '16 15:06 ghost

Ahhh - the base paths using Linux filesystem syntax ?

ghost avatar Jun 08 '16 15:06 ghost

from laravel.log, when hitting generate backup:

[2016-06-09 11:18:57] production.ERROR: backups backups : error: Failed to backup because: The dump process failed with exitcode 1 : General error :

ghost avatar Jun 09 '16 10:06 ghost

Might be related to this issue, tho the OP didn't provide enough helpful info :( https://github.com/spatie/laravel-backup/issues/83

snipe avatar Jun 10 '16 15:06 snipe

What do you have for your DB_DUMP_PATH in your .env file?

snipe avatar Jun 10 '16 15:06 snipe

/usr/bin

Is this the backup path then? I guess I should change it :)

Is it relative to the web root ?

ghost avatar Jun 13 '16 08:06 ghost

@mmcleod82 that should be the path to the mysqldump binary, as explained in the config documentation. https://snipe-it.readme.io/docs/configuration#required-database-settings

snipe avatar Jun 13 '16 08:06 snipe

Thanks for the pointer snipe.

ghost avatar Jun 13 '16 08:06 ghost

updated the DB_DUMP_PATH to 'C:\Program Files\MariaDB 10.1\bin' , still no backup taken and the same error in laravel.log

ghost avatar Jun 13 '16 09:06 ghost

My laravel-backup.php for info - I did make an edit to fix the paths for Windows.

[ /* * The name of this application. You can use this name to monitor * the backups. */ 'name' => 'backups', 'source' => [ 'files' => [ /* * The list of directories that should be part of the backup. You can * specify individual files as well. */ 'include' => [ base_path('public/uploads'), base_path('config'), base_path('storage/private_uploads'), ], /* * These directories will be excluded from the backup. * You can specify individual files as well. */ 'exclude' => [ ``` // base_path('vendor'), // base_path('node_modules'), ], ``` /* * Determines if symlinks should be followed. */ 'followLinks' => false, ], /* * The names of the connections to the databases that should be part of the backup. * Currently only MySQL- and PostgreSQL-databases are supported. */ 'databases' => [ 'mysql', ], ], 'destination' => [ /* * The disk names on which the backups will be stored. */ 'disks' => [ 'local', ], ], ], 'cleanup' => [ /* * The strategy that will be used to cleanup old backups. * The youngest backup will never be deleted. */ 'strategy' => \Spatie\Backup\Tasks\Cleanup\Strategies\DefaultStrategy::class, 'defaultStrategy' => [ /* * The amount of days that all daily backups must be kept. */ 'keepAllBackupsForDays' => 7, /* * The amount of days that all daily backups must be kept. */ 'keepDailyBackupsForDays' => 16, /* * The amount of weeks of which one weekly backup must be kept. */ 'keepWeeklyBackupsForWeeks' => 8, /* * The amount of months of which one monthly backup must be kept. */ 'keepMonthlyBackupsForMonths' => 4, /* * The amount of years of which one yearly backup must be kept */ 'keepYearlyBackupsForYears' => 2, /* * After cleaning up the backups remove the oldest backup until * this amount of megabytes has been reached. */ 'deleteOldestBackupsWhenUsingMoreMegabytesThan' => 5000 ] ], /* * In this array you can specify which backups should be monitored. * If a backup does not meet the specified requirements the * UnHealthyBackupWasFound-event will be fired. */ 'monitorBackups' => [ [ 'name' => 'backups', 'disks' => ['local'], 'newestBackupsShouldNotBeOlderThanDays' => 1, 'storageUsedMayNotBeHigherThanMegabytes' => 5000, ], /* [ 'name' => 'name of the second app', 'disks' => ['local', 's3'], 'newestBackupsShouldNotBeOlderThanDays' => 1, 'storageUsedMayNotBeHigherThanMegabytes' => 5000, ], */ ], 'notifications' => [ /* * This class will be used to send all notifications. */ 'handler' => Spatie\Backup\Notifications\Notifier::class, /* * Here you can specify the ways you want to be notified when certain * events take place. Possible values are "log", "mail", "slack" and "pushover". * * Slack requires the installation of the maknz/slack package. */ 'events' => [ 'whenBackupWasSuccessful' => ['log'], 'whenCleanupWasSuccessful' => ['log'], 'whenHealthyBackupWasFound' => ['log'], 'whenBackupHasFailed' => ['log', 'mail'], 'whenCleanupHasFailed' => ['log', 'mail'], 'whenUnhealthyBackupWasFound' => ['log', 'mail'], ], /* * Here you can specify how emails should be sent. */ 'mail' => [ 'from' => env('MAIL_FROM_ADDR', '[email protected]'), 'to' => env('MAIL_FROM_ADDR', '[email protected]'), ], /* * Here you can specify how messages should be sent to Slack. */ 'slack' => [ 'channel' => '#backups', 'username' => 'Backup bot', 'icon' => ':robot:', ], /* * Here you can specify how messages should be sent to Pushover. */ 'pushover' => [ 'token' => env('PUSHOVER_APP_TOKEN'), 'user' => env('PUSHOVER_USER_KEY'), 'sounds' => [ 'success' => env('PUSHOVER_SOUND_SUCCESS','pushover'), 'error' => env('PUSHOVER_SOUND_ERROR','siren'), ], ], ] ``` ];

ghost avatar Jun 13 '16 09:06 ghost

Not sure then - we use a package for the backups, and there is a related thread there: https://github.com/spatie/laravel-backup/issues/107

snipe avatar Jun 13 '16 09:06 snipe

Shouldn't have had to change the paths for windows though.

Can you try uncommenting this line:

// base_path('node_modules'),

and running:

php backup:run

snipe avatar Jun 23 '16 22:06 snipe

Where should I be running php backup:run ? (Windows)

I get 'Could not open input file: backup:run'

ghost avatar Jun 24 '16 09:06 ghost

C:\inetpub\wwwroot\snipe-it>php artisan backup:run Starting backup... Dumping database snipeit... Backup failed because The dump process failed with exitcode 1 : General error : The filename, directory name, or volume label syntax is incorrect. . Backup completed!

ghost avatar Jun 24 '16 12:06 ghost

The command prompt backup will fail unless you use proper escape characters in the .env file. Due to the spacing and back slashes it's a bit more complex than linux. DB_DUMP_PATH="C:\progra~1\MARIAD~1.0\bin\" (single quote, double slash and short names )

In addition to the above you need to allow the application to backup properly, for this you need to add write permission to either the Application pool identity "IIS APPPOOL<AppPoolName>" (From inetmgr select the snipeIT website then basic settings to get the application pool name) or the IIS_IUSRS group on both c:\Windows\temp and your snipe-it\storage folder.

You will also need something like WinRAR to unzip, as windows compression has trouble with the pathing.

BrettFagerlund avatar Jul 07 '16 10:07 BrettFagerlund

I have installed snipe IT tool in windows 10 OS. I have given permissions as recommended by in doc. But still, I am facing issue when try to take backup. Please help me. C:\inetpub\wwwroot\snipe-it>php artisan backup:run Starting backup... Dumping database snipeit... Backup failed because The dump process failed with exitcode 1 : General error : The filename, directory name, or volume label syntax is incorrect. . Backup completed!

ramashish87 avatar Nov 04 '18 21:11 ramashish87