Closed jmartins1 closed 2 years ago
How big is the file you're trying to restore?
I’ve tried two.
One: 14.6 MB
The other: 1.26 MB
I'm having a similar issue. C:\inetpub\wwwroot\snipe-it>php artisan snipeit:restore C:\inetpub\wwwroot\snipe-it\storage\app\backups\snipe-it-2022-03-22-18-45-00.zip Current working directory is: C:\inetpub\wwwroot\snipe-it
Are you sure you wish to restore from the given backup file? This can lead to MASSIVE DATA LOSS! (yes/no) [no]:
yes
Found a sql file!
ErrorException : fwrite(): write of 52 bytes failed with errno=22 Invalid argument
at C:\inetpub\wwwroot\snipe-it\app\Console\Commands\RestoreFromBackup.php:240 236| } 237| 238| while(($buffer = fgets($sql_contents)) !== false ) { 239| //$this->info("Buffer is: '$buffer'");
240| $bytes_written = fwrite($pipes[0],$buffer); 241| if($bytes_written === false) { 242| $stdout = fgets($pipes[1]); 243| $this->info($stdout); 244| $stderr = fgets($pipes[2]);
Exception trace:
1 fwrite() C:\inetpub\wwwroot\snipe-it\app\Console\Commands\RestoreFromBackup.php:240
2 App\Console\Commands\RestoreFromBackup::handle() C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
Please use the argument -v to see more details.
I don't think we've tested the restore script extensively on Windows, but it does look like both you and the OP are running WAMP. Is it possible the temp directory isn't writable or the file isn't readable by the user who is attempting to do the restore?
I suspect we're not properly launching the mysql command-line binary - pathing issues are often a problem on Windows :/
If there's a way you can ensure that you can run mysql
from the command line (perhaps by adding its directory to the PATH environment variable) then you might have better luck?
Just an FYI, you probably already know but just to be sure... inetpub is part of Microsoft Internet Information Services (IIS). It's not related to WAMP Server.
Yes it's IIS, I just attached to this thread as I have a similar issue. Uberbrady, you seem to be on to something there, but I'm not sure the next step. Can you elaborate.
I don’t know how path variables work on Windows. But, your mysql
binary lives somewhere on your system. Whatever directory it lives in, needs to be added to your path. Then, if you log out and log back in to your Windows session, you should be able to type mysql
on the command-line and it should launch the binary.
What may be confusing this is that it’s possible that your web server has a different concept of what the path environment variable is. But let’s just start with using the Artisan command-line tool to start with and work our way over.
I did a little googling and this is what I was able to come up with: https://www.computerhope.com/issues/ch000549.htm
Information on how to set the path and environment variables in Windows 2000, Windows XP, Windows Vista, and Windows 7.
Just updating. I'm working on this all day. I made sure under under my environment variables by going to windows x, system, environment variables, that there is a PHP path pointing at my PHP Folder under C:\PHP7 Just to be sure deleted it and restored it. I'm not sure how to test mysql. If I just launch cmd and type mysql I get C:\inetpub\wwwroot\snipe-it>mysql 'mysql' is not recognized as an internal or external command, operable program or batch file.
Still researching...
Not sure if it matters, but I'm using MariaDB
Okay, I misunderstood. Since it appears like a PHP issue I was working the wrong problem. Added Mariadb path in my environment variables. Restarted the server. Restore still fails. Verified under services Mariadb is running. Trying to figure out how to test it at the cmd line
C:\Program Files\MariaDB 10.6\bin>mysql -u root -p Enter password: ** Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.6.7-MariaDB mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> MariaDB [(none)]>
I just ran into this on our own hosted platform. When I tried to extract the mysql dump file from the zip, then manually pipe it into the mysql command-line client, I got the following error message:
ERROR 1193 (HY000) at line 14: Unknown system variable 'GTID_PURGED'
So I think what happened here is that the mysql dump file I was working with is from a newer version of mysql than the one I'm using. I simply deleted the appropriate line (SET @@GLOBAL.GTID_PURGED='';
) from the SQL file and then the mysql import worked.
It sure would be a lot nicer if we had a way to catch the error that MySQL spits out and display it to the user rather than the cryptic "fwrite failed" error message :/
More info here: https://stackoverflow.com/questions/45858723/error-1193-hy000-unknown-system-variable-gtid-purged
Stack OverflowI took backup of database from workbench from a remote server. So when I import it on my local environment I got error: ERROR 1193 (HY000): Unknown system variable 'GTID_PURGED' I'm using xampp
Hi snipe, I am having a similar issue with the backup restore. I tried to restore directly on the GUI app using the restore button and since then have been stock with the error 500. log report can be seen below. thanks you for assistance.
log report:
[2022-06-08 09:17:23] production.ERROR: Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length() {"exception":"[object] (Error(code: 0): Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length() at C:\wamp\www\inventory\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:100) [stacktrace]
"}
Is it possible your APP_KEY changed from what it used to be and whatever the current APP_KEY is?
Thank you for the responds. the APP_KEY didn't change. I had to restore the system from a manual backup I had. I will try the using the restore again hopefully it works this time.
Thanks
Thank you for the responds. the APP_KEY didn't change. I had to restore the system from a manual backup I had. I will try the using the restore again hopefully it works this time.
Thanks
+1, I have same error, WAMP,click the restore button will occures server error 500.
Did you resolved this issue ?
Not yet, I will have to create a new test environment before trying again.
On Tue, Jun 21, 2022 at 11:32 PM wikilike7 @.***> wrote:
Thank you for the responds. the APP_KEY didn't change. I had to restore the system from a manual backup I had. I will try the using the restore again hopefully it works this time.
Thanks
+1, I have same error, WAMP,click the restore button will occures server error 500.
Did you resolved this issue ?
— Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/10714#issuecomment-1162627680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQRH6POOZHUFN5MAVTAKTKTVQKJPVANCNFSM5PCKCZOQ . You are receiving this because you commented.Message ID: @.***>
Thanx so much! Will have some time tonite, I hope.
On Sunday, June 26, 2022, toti-feroy @.***> wrote:
Not yet, I will have to create a new test environment before trying again.
On Tue, Jun 21, 2022 at 11:32 PM wikilike7 @.***> wrote:
Thank you for the responds. the APP_KEY didn't change. I had to restore the system from a manual backup I had. I will try the using the restore again hopefully it works this time.
Thanks
+1, I have samex so much? error, WAMP,click the restore button will occures server error 500.
Did you resolved this issue ?
— Reply to this email directly, view it on GitHub <https://github.com/snipe/snipe-it/issues/10714#issuecomment-1162627680 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ AQRH6POOZHUFN5MAVTAKTKTVQKJPVANCNFSM5PCKCZOQ . You are receiving this because you commented.Message ID: @.***>
— Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/10714#issuecomment-1166499015, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWXRVHLED7H4C6D2EZFAALVRA34BANCNFSM5PCKCZOQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- regards,
Elamar Yarden, Adv.
Elamar Yarden, Law Office Tel: +972-52-5533353 e-mail: @.***
Important Note: This e-mail message and any files transmitted with it are subject to attorney-client privilege and contain confidential information intended only for the addressee(s). Please note that any disclosure, copying or distribution of the content of this information is strictly forbidden. If you have received this e-mail message in error, please destroy it immediately and notify us by e-mail or call: +972-52-5533353
For those having the cipher issue, can you tell me what version you were upgrading from?
(Also if you don’t have any encrypted fields, you can try regenerating your APP_KEY)
Hi there - We haven't heard back in a bit, so I'm going to close this ticket for now, but will re-open it if you're still having issues.
No, my updates are consistent; I use a powershell script to automate updates. The .env file is copied over from the previous installation. I also compare the .env file against the new .envexample file for updates.
Also, using MySQL Workbench I do not have any issues importing the DB.
From: snipe @.> Sent: Wednesday, June 8, 2022 9:37 AM To: snipe/snipe-it @.> Cc: jmartins1 @.>; Author @.> Subject: Re: [snipe/snipe-it] Restore from Backup File - Not working (Issue #10714)
Is it possible your APP_KEY changed from what it used to be and whatever the current APP_KEY is?
— Reply to this email directly, view it on GitHub https://github.com/snipe/snipe-it/issues/10714#issuecomment-1150080278 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOF6F627L7WAIMOWY3DCATVOC4ZRANCNFSM5PCKCZOQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AHOF6FY5YSXGS2C5C75SKC3VOC4ZRA5CNFSM5PCKCZO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOISGNKFQ.gif Message ID: @. @.> >
Debug mode
Describe the bug
Using any of the backup restore options from the "Restore from Backup File" page produces an error.
Ref: https://snipe-it.readme.io/docs/restore-from-backup-file
Reproduction steps
I'm not sure if there is a different path format I should be using on Windows. I have tried:
php artisan snipeit:restore //backup.zip php artisan snipeit:restore c://backup.zip php artisan snipeit:restore c:\backup.zip php artisan snipeit:restore c:\backup.zip
None appear to work
Expected behavior
Backup DB restoration
Screenshots
Snipe-IT Version
5.3.10
Operating System
Windows 11
Web Server
WAMP 3.2.5
PHP Version
7.4.9
Operating System
WIndows 11
Browser
Chrome
Version
98.0.4758.102 (Official Build) (64-bit)
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
Additional context
No response