-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Issue backing up from web interface #4458
Comments
Is your backup directory writable? Without specific errors, I don't really have any way of knowing why it failed. You can try upgrading, as we've added slightly more verbose feedback if a backup failed in later versions. |
username@stuff:/var/www/snipeit/storage/app$ drwxr-xr-x 3 www-data www-data 4096 Nov 4 19:00 backups |
username@stuff:/var/www/snipeit/storage/app/backups$ ls -l The zip that's there from before is from root, not sure if that's relevant or not but noticed the difference between that and the env backup directory. |
A lot of the other content I was going through, people had their mysql dumps pointed at /usr/local/bin. But I don't think that should matter, especially considering it looks like mine dumps into the /usr/bin. Do you see any syntax issues that I am missing that could be telling Snipe a different location? e.g., /usr/bin vs. /usr/bin/ I can try an upgrade as well if you would think it can help. We've not fully used it yet, I was just trying to get a backup going at this 'fresh start' point before I accidentally break it in the near future getting it setup. We got a new shipment of 100+ Chromebooks we're going to put in to get the kinks worked out before we move our entire inventory into it. |
We use |
OK that's what I thought and what I have. I was hoping it would be something embarrassingly easy. One thing I noticed is that in my .env the APP_URL did not match the actual current IP address. When I initially set it up I was in a different physical location from where I am now finishing the setup. I corrected it in the .env APP_URL and ran the php artisan config:clear, but the problem still persists. |
APP_URL isn't used by the backup script (it wouldn't, since backups would relate to the path, not the URL). It's still super important to have that APP_URL correct, as all kinds of other stuff will break (javascript, ajax menus, etc) because of Cross-Domain browser restrictions, but it's not related to this. Try running |
(The web UI simply invokes that artisan command, so running it via cli is the same as hitting the "backup" button) |
username@stuff:/var/www/snipeit$ php artisan snipeit:backup -vvv [UnexpectedValueException] |
Is |
Okay, related to spatie/laravel-backup#92 (comment) - possibly a permissions issue re: mysqldump? |
(That's the library we use for backups - |
Updated the comment above (you were too fast!) with a picture. Is the fact that root the owner of laravel-backups related? Also thank you for reference, looking through it now. |
Well, it looks like www-data is the owner of the backups dir.
What I'm wondering about is if your user has permission to use mysqldump, or if maybe that Are you running SELinux by any chance? |
I don't believe I am. ( http://www.microhowto.info/howto/determine_whether_selinux_is_enabled.html ) getenforce prompted me to run sudo apt install selinux-utlis. I'm not very familiar with it, so had to Google how to check if you are using SELinux. As for my note on the laravel-backup and root, the error thrown "Directory nonexistent" during the |
We also tell you how to check for SELinux in our docs. |
Which user would it be that you're referring to? www-data, mysql? A different one? Also here's the current permissions for everything in the /usr/bin for mysql. Not sure if that's of any help. |
It's still saying it can't create that log file though, which is odd. In your .env, add or update |
Whichever one you're logged in as when you run the cli backup tool. |
All right,
My username is currently a member of the following groups: I'm not very good with Linux, especially permissions so I apologize in advance. If there's anything that is outside of the scope of "your problem" let me know and I will try to resolve it on my end and get back to you. I appreciate your help thus far! |
Heh, this is all kinda outside the scope of a Snipe-IT problem, but I'd still rather take some time and get you set up correctly. Now that you've changed to a single log file format, try running that cli backup again and see if the errors are any different. I feel like we've narrowed this down to a permissions issue, either on the backup directory or on mysqldump, but let's see what happens when you run that cli backup again. |
When I use the web UI (clicky button) to run it, what user account is Snipe-IT using to attempt to run artisan command? I could make a new group or utilize an existing one to chown of the mysql files in /usr/bin - so long as I make sure whatever else needs it can still use it. |
It's going to run it as whatever user apache (or whatever web server you're using) runs as, which in your case I hope is
Let's try this: chmod your storage directory (and all subdirs) to 777. We won't keep it that way forever but let's just see if we get a different error.
Then re-run your cli backup. |
Well well well.... So it definitely looks like a permissions/group issue. |
The great green clicky button on the web UI also works, logs are now correctly populating the /admin/backs webpage. |
Okay let's try dropping it down to 775 then. |
(I basically want to give it the smaller permissions allowable for it to still work) |
Fails. But only one line this time. Backup failed because The dump process failed with exitcode 2 : Misuse of shell builtins : sh: 1: cannot create /var/www/snipeit/storage/laravel-backups/temp//snipeit.sql: Directory nonexistent |
Okay - there's probably some finessing you can do with regard to users/groups permissions to try to prevent having to grant 777, but at least it works now at 777. (Switch it back to 777.) I'm going to close this ticket for now. Feel free to open a new one if you have additional issues. |
Hello! php artisan snipeit: backup After that the button of the web interface returned to work well. |
In our case the snipeit\storage\app\backup folder did not have 775 permission. |
Expected Behavior (or desired behavior if a feature request)
To have a backup file saved when I click the green "Generate Backup" button on the /admin/backups page.
Actual Behavior
Get the message " Success: A new backup file was successfully created." but nothing is listed under the Backups page. When I navigate to /var/www/snipeit/storage/app/backups there is only one file (.zip) that was backed up 10 days ago, and a env-backups directory that is empty. None of the expected 'new' backups.
Please confirm you have done the following before posting your bug report:
Provide answers to these questions:
Pretty much a fresh install
Version v4.1.0 build beta2
PHP 7.0.22-0ubuntu0.16.04.1
mysql Ver 15.1 Distrib 10.1.28-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Ubuntu Server 16.04.1 Server version: Apache/2.4.18 (Ubuntu)
install.sh
No errors.
/admin/backups page, clicking the green Generate Backup button.
Any errors that appear in your browser's error console.
n/a
Confirm whether the error is reproduceable on the demo: https://snipeitapp.com/demo.
n/a (DEMO MODE: Some features are disabled for this installation.)
Include any additional information you can find in
app/storage/logs
and your webserver's logs.n/a
Include what you've done so far in the installation, and if you got any error messages along the way.
Confirmed that .env is DB_DUMP_PATH='/usr/bin' /usr/bin has all the mysql dumps and files in there.
Indicate whether or not you've manually edited any data directly in the database
I have edited some items, such as Database Settings (user, password, etc.) and smtp settings. Nothing edited to my knowledge that would effect the problem at hand.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
https://snipe-it.readme.io/docs/getting-help
The text was updated successfully, but these errors were encountered: