snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.09k stars 3.18k forks source link

Upgrade Failing (Completes without upgrading version) #8588

Open roomwillow opened 4 years ago

roomwillow commented 4 years ago

Expected Behavior (or desired behavior if a feature request)

snipe-it upgrades to V5 from V4.9.5 (build 4482)


Actual Behavior

version number does not change


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


Provide answers to these questions:

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

I have a system that has been running for about two weeks now without issue, I attempted to run the V5 upgrade today via "php upgrade.php". as I installed Snipe-IT via git, and upon logging out, clearing cookies, and reloading the page, logging back in, the version number had not changed. This appears to be similar behaviour to issue #7215, however, I can confirm that its not a permissions issue as it was in that issue, I've run ls -l and confirmed 775 permissions held recursively by www-data:www-data on the snipe-it directory. As #7215 reccomends, I attempted upgrade via git pull then php upgrade.php, git pull returns ending with "aborting" after listing a bunch of files, php upgrade.php goes:

-- Starting Backup...
Backup failed because: unlink(/var/www/snipe-it/storage/app/backup-temp/temp/db-dumps/mysql-snipeit.sql): Permission Denied.

In AuthHandler.php line 191:

Failed to authenticate on SMTP server with username "YOURUSERNAME" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 334 but got code "530", with message "530 must issue a STARTTLS command first". Authenticator PLAIN returned Expected response code 235 but got code "530", with message "530 Must issue a STARTTLS command first".

Application is now in maintenence mode

it then goes on to say git is installed, and lists a bunch of files with an M at the front, then tells me to clear cookies and login, which brings me back to the same version i started with.

Suggestions on how to proceed?

snipe commented 4 years ago

There are a few problems here....

Backup failed because: unlink(/var/www/snipe-it/storage/app/backup-temp/temp/db-dumps/mysql-snipeit.sql): Permission Denied.

That definitely implies there's a permissions problem.

Failed to authenticate on SMTP server with username "YOURUSERNAME"

You'll want to make sure your SMTP settings are correct in your .env.

roomwillow commented 4 years ago

Interestingly I nagivated to that directory and only the files inside of it where incorrectly assigned permissions levels, they all had 644 while everything else in snipe has been 775, I re-ran chmod 775 -R /var/www/snipe-it to be safe, along with chown www-data:www-data -R /var/www/snipe-it, but I'm not also noticing attempting backups from the webUI result in "whoops, looks like something went wrong", but it makes the backup anyways when i navigate to the backup directory, albiet, with only level 644 permissions.

I re-attempted upgrade after running these permissions commands and was faced with the same errors as before.

On the subject of the email server, is there any way to disable the email functionality? I never filled out the email information in the enviroment file because its not used in my enviroment, if its going to cause issue I guess I can have an arbitrary email account setup for snipe-it, I see no way to disable it according to the documentation, I will submit a ticket to have an email account setup for snipe in the meantime.

I see now that there seems to be some permissions issue going on, but its not being solved by recursive changes to the snipe directory... it seems to change the active files, but new backups atleast are still taking on 644, and obviously the upgrades are still failing.

snipe commented 4 years ago

but I'm not also noticing attempting backups from the webUI result in "whoops, looks like something went wrong"

Can you tell me what shows up in your storage/logs/laravel.log when you try that?

roomwillow commented 4 years ago

https://pastebin.com/dSqm4cTp see error from storage/logs/laravel.log when attempting a backup, note i redacted the internal testing email address with "REDACTED-EMAIL-ADDRESS", I notice the first few lines are relating to failing auth of SMTP, is it possible this is all tied back to not having email fully configured?

Pastebin
Pastebin.com - Potentially offensive content ahead!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
stale[bot] commented 3 years ago

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!