Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore fails with docker 6.0.9 because a folder is missing #11708

Closed
2 tasks done
lausser opened this issue Aug 20, 2022 · 1 comment
Closed
2 tasks done

restore fails with docker 6.0.9 because a folder is missing #11708

lausser opened this issue Aug 20, 2022 · 1 comment
Assignees

Comments

@lausser
Copy link

lausser commented Aug 20, 2022

Debug mode

Describe the bug

php artisan snipeit:restore fails with an error message (maybe only if there are additional files for models. I uploaded some pdf manuals and handbooks)

Reproduction steps

  1. backup an existing instance
  2. start the docker version of snipe-it
  3. cp the backup zip-file to the container
  4. exec into the container
  5. run php artisan snipeit:restore
    ...

Expected behavior

php artisan snipeit:restore runs and restores without error message

Screenshots

No response

Snipe-IT Version

6.0.9

Operating System

docker

Web Server

whatever the docker version uses

PHP Version

whatever the docker version uses

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

root@snipe-7545fb8ccc-zrm46:/var/www/html# php artisan snipeit:restore ~/snipe-it-2022-08-20-19-26-14.zip
...
Weird problem, here are file details? Array
(
    [dest] => storage/private_uploads/assetmodels
    [index] => 16
)


   ErrorException 

  fopen(storage/private_uploads/assetmodels/assetmodels): failed to open stream: No such file or directory

  at app/Console/Commands/RestoreFromBackup.php:304
    300▕         foreach ($interesting_files as $pretty_file_name => $file_details) {
    301▕             $ugly_file_name = $za->statIndex($file_details['index'])['name'];
    302▕             $fp = $za->getStream($ugly_file_name);
    303▕             $this->info("Weird problem, here are file details? ".print_r($file_details,true));
  ➜ 304▕             $migrated_file = fopen($file_details['dest'].'/'.basename($pretty_file_name), 'w');
    305▕             while (($buffer = fgets($fp, self::$buffer_size)) !== false) {
    306▕                 fwrite($migrated_file, $buffer);
    307▕             }
    308▕             fclose($migrated_file);

  1   app/Console/Commands/RestoreFromBackup.php:304


### Additional context

I manually mkdir storage/private_uploads/assetmodels and then it works.
@welcome
Copy link

welcome bot commented Aug 20, 2022

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe added a commit that referenced this issue Aug 25, 2022
…estore

Fixed #11708 - pre-create private_storage directories for Docker restores
@snipe snipe closed this as completed in 8ad5fb3 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants