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

After upgrade from v4.9.3 to v5 git pull doesn't work

Open swift2512 opened this issue 6 years ago • 12 comments

Expected Behavior (or desired behavior if a feature request)

First of all I was expecting upgrade from 4.9.3 to 4.9.5 and not to v5.0.0. :) Desired behaviour: git pull fetches minor version upgrades

Actual Behavior

git pull ends up with errors error: Your local changes to the following files would be overwritten by merge: <...> error: The following untracked working tree files would be overwritten by merge: <...> Aborting


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


Provide answers to these questions:

  • Is this a fresh install or an upgrade? Upgrade from v4.9.3 to v5.0.0
  • Version of Snipe-IT you're running Version v5.0.0 - build 4484 (master)
  • Version of PHP you're running PHP 7.2.24-0ubuntu0.18.04.7 (cli) (built: Oct 7 2020 15:24:25) ( NTS )
  • Version of MySQL/MariaDB you're running mysql Ver 14.14 Distrib 5.7.31, for Linux (x86_64) using EditLine wrapper
  • What OS and web server you're running Snipe-IT on Ubuntu 18.04.5 LTS
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) git clone
  • Include any additional information you can find in 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. sudo chown -R www-data:www-data /var/www/snipeit sudo chmod -R 775 /var/www/snipeit my user is added to www-data group tried sudo git pull - doesn't work either

snipe@server:/var/www/snipeit$ git log commit af06e4205627b29f583b2e2e770fd2913fce5e46 (HEAD -> master, tag: v4.9.3)

Is this normal? Shouldn't it say tag: v5.0.0?

swift2512 avatar Oct 21 '20 10:10 swift2512

That means something in your local filesystem has changed. It can't pull because it would overwrite whatever changed locally. Try running git stash and try pulling again.

snipe avatar Oct 21 '20 21:10 snipe

That means something in your local filesystem has changed. It can't pull because it would overwrite whatever changed locally. Try running git stash and try pulling again.

I am not familiar with git and how it works so any help would be appreciated. `user@ubuntu:/var/www/snipeit$ git stash

*** Please tell me who you are.

Run

git config --global user.email "[email protected]" git config --global user.name "Your Name"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'user@ubuntu.(none)') Cannot save the current index state`

Can I put any of my email addresses when running git config --global user.email "[email protected]"?

swift2512 avatar Oct 23 '20 06:10 swift2512

You should be able to, yeah

snipe avatar Oct 23 '20 06:10 snipe

I don't know why, but git stash left me with blank SnipeIT screen (even in private browser window). user@ubuntu:/var/www/snipeit$ git stash Saved working directory and index state WIP on master: af06e4205 Bumped version user@ubuntu:/var/www/snipeit$ git status On branch master Your branch is behind 'origin/master' by 987 commits, and can be fast-forwarded. (use "git pull" to update your local branch) Blank SnipeIT page user@ubuntu:/var/www/snipeit$ git pull Updating af06e4205..c3e8f6406 error: The following untracked working tree files would be overwritten by merge: <...> aborting

Ran php upgrade.php and somehow ended up with downgrade from v5.0.0 to v4.9.3.

swift2512 avatar Oct 23 '20 08:10 swift2512

Try clearing your config cache - php artisan config:clear

snipe avatar Oct 23 '20 08:10 snipe

Actually, the aborting business means the git pull didn't work.

error: The following untracked working tree files would be overwritten by merge:

Try git stash again and then running php upgrade.php

snipe avatar Oct 23 '20 08:10 snipe

user@ubuntu:/var/www/snipeit$ php artisan config:clear
Configuration cache cleared!
user@ubuntu:/var/www/snipeit$ git stash
No local changes to save
user@ubuntu:/var/www/snipeit$ php upgrade.php
Welcome to the Snipe-IT upgrader.

Please note that this script will not download the latest Snipe-IT
files for you unless you have git installed.
It simply runs the standard composer and artisan
commands needed to finalize the upgrade after.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! If you have any encrypted custom fields, BE SURE TO run the recrypter if upgrading from v3 to v4.
!! See the Snipe-IT documentation for help:
!! https://snipe-it.readme.io/docs/upgrading-to-v4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--------------------------------------------------------
STEP 1: Backing up database:
--------------------------------------------------------

-- Starting backup...
Dumping database snipeit...
Determining files to backup...
Zipping 214 files...
Created zip containing 214 files. Size is 14.05 MB
Copying zip to disk named local...
Successfully copied zip to disk named local.
Backup completed!


--------------------------------------------------------
STEP 2: Putting application into maintenance mode:
--------------------------------------------------------

-- Application is now in maintenance mode.


--------------------------------------------------------
STEP 3: Pulling latest from Git (master branch):
--------------------------------------------------------

Git is installed.
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 8 (delta 5), reused 8 (delta 5), pack-reused 0
Unpacking objects: 100% (8/8), done.
From https://github.com/snipe/snipe-it
   c3e8f6406..f182ce1c8  master     -> origin/master
   68cfbaab2..c6dde67e8  develop    -> origin/develop
 * [new tag]             v5.0.2     -> v5.0.2
Already on 'master'
error: The following untracked working tree files would be overwritten by merge:
        .github/autolabeler.yml
        .github/config.yml
        .github/pull_request_template.md
        .github/weekly-digest.yml
        .nvmrc
        Dockerfile.alpine
        ansible/freebsd/vagrant_playbook.yml
        app/Console/Commands/CheckinLicensesFromAllUsers.php
        app/Console/Commands/CheckoutLicenseToAllUsers.php
        app/Console/Commands/MergeUsersByUsername.php
        app/Console/Commands/MoveUploadsToNewDisk.php
        app/Console/Commands/SendCurrentInventoryToUsers.php
        app/Events/CheckoutAccepted.php
        app/Events/CheckoutDeclined.php
        app/Events/CheckoutableCheckedIn.php
        app/Events/CheckoutableCheckedOut.php
        app/Http/Controllers/Accessories/AccessoriesController.php
        app/Http/Controllers/Accessories/AccessoryCheckinController.php
        app/Http/Controllers/Accessories/AccessoryCheckoutController.php
        app/Http/Controllers/Account/AcceptanceController.php
        app/Http/Controllers/Api/PredefinedKitsController.php
        app/Http/Controllers/Assets/AssetCheckinController.php
        app/Http/Controllers/Assets/AssetCheckoutController.php
        app/Http/Controllers/Assets/AssetFilesController.php
        app/Http/Controllers/Assets/AssetsController.php
        app/Http/Controllers/Assets/BulkAssetsController.php
        app/Http/Controllers/Auth/SamlController.php
        app/Http/Controllers/BulkAssetModelsController.php
        app/Http/Controllers/Components/ComponentCheckinController.php
        app/Http/Controllers/Components/ComponentCheckoutController.php
        app/Http/Controllers/Components/ComponentsController.php
        app/Http/Controllers/Consumables/ConsumableCheckoutController.php
        app/Http/Controllers/Consumables/ConsumablesController.php
        app/Http/Controllers/Kits/CheckoutKitController.php
        app/Http/Controllers/Kits/PredefinedKitsController.php
        app/Http/Controllers/Licenses/LicenseCheckinController.php
        app/Http/Controllers/Licenses/LicenseCheckoutController.php
        app/Http/Controllers/Licenses/LicenseFilesController.php
        app/Http/Controllers/Licenses/LicensesController.php
        app/Http/Controllers/Users/BulkUsersController.php
        app/Http/Controllers/Users/LDAPImportController.php
        app/Http/Controllers/Users/UserFilesController.php
        app/Http/Controllers/Users/UsersController.php
        app/Http/Middleware/SecurityHeaders.php
        app/Http/Requests/LicenseCheckoutRequest.php
        app/Http/Requests/SettingsSamlRequest.php
        app/Http/Transformers/DepartmentsTransformer.php
        app/Http/Transformers/LoginAttemptsTransformer.php
        app/Http/Transformers/PredefinedKitsTransformer.php
        app/Listeners/CheckoutableListener.php
        app/Listeners/LogListener.php
        app/Models/CheckoutAcceptance.php
        app/Models/PredefinedKit.php
        app/Models/Traits/Acceptable.php
        app/Notifications/CheckinLicenseSeatNotification.php
        app/Notifications/CheckoutLicenseSeatNotification.php
        app/Notifications/CurrentInventory.php
        app/Observers/SettingObserver.php
        app/Presenters/LicenseSeatPresenter.php
        app/Presenters/PredefinedKitPresenter.php
        app/Providers/LdapServiceProvider.php
        app/Providers/SamlServiceProvider.php
        app/Services/LdapAd.php
        app/Services/LdapAdConfiguration.php
        app/Services/PredefinedKitCheckoutService.php
        app/Services/Saml.php
        config/hashing.php
        config/logging.php
        config/mail-auto-embed.php
        config/passport.php
        database/factories/CustomFieldsetFactory.php
        database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php
        database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php
        database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php
        database/migrations/2016_06_01_000004_create_oauth_clients_table.php
        database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php
        database/migrations/2018_07_28_023826_create_checkout_acceptances_table.php
        database/migrations/2018_08_20_204842_add_depreciation_option_to_settings.php
        database/migrations/2018_09_10_082212_create_checkout_acceptances_for_unaccepted_assets.php
        database/migrations/2018_10_18_191228_add_kits_licenses_table.php
        database/migrations/2018_10_19_153910_add_kits_table.php
        database/migrations/2018_10_19_154013_add_kits_models_table.php
        database/migrations/2018_12_05_
Aborting
-- -- No local changes to save
-- Your branch is behind 'origin/master' by 1020 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
-- Updating af06e4205..f182ce1c8
--------------------------------------------------------
Step 4: Cleaning up old cached files:
--------------------------------------------------------

-- No bootstrap/cache/compiled.php, so nothing to delete.
-- Deleting bootstrap/cache/services.php. It it no longer used.
-- No bootstrap/cache/config.php, so nothing to delete.
-- Configuration cache cleared!
-- Cache cleared successfully.
-- Route cache cleared!
-- Compiled views cleared!

--------------------------------------------------------
Step 5: Updating composer dependencies:
(This may take an moment.)
--------------------------------------------------------

-- Local composer.phar detected, so we'll use that.

-- Updating local composer.phar

A preview release of the next major version of Composer is available (2.0.0-RC2), run "composer self-update --preview" to give it a try. See also https://github.com/composer/composer/releases for changelogs.
You are already using composer version 1.10.15 (stable channel).


Deprecation Notice: Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\Notifications\RequestAssetCancelationNotification located in ./app/Notifications/RequestAssetCancelation.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\Http\Transformers\DepartmentsTransformer located in ./app/Http/Transformers/DepartmentsTranformer.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Warning: Ambiguous class resolution, "App\Http\Transformers\DepartmentsTransformer" was found in both "/var/www/snipeit/app/Http/Transformers/DepartmentsTransformer.php" and "/var/www/snipeit/app/Http/Transformers/DepartmentsTranformer.php", the first will be used.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Loading composer repositories with package information
Installing dependencies from lock file
Nothing to install or update
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Generating optimized autoload files
Deprecation Notice: Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\Notifications\RequestAssetCancelationNotification located in ./app/Notifications/RequestAssetCancelation.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class App\Http\Transformers\DepartmentsTransformer located in ./app/Http/Transformers/DepartmentsTranformer.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/snipeit/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
Warning: Ambiguous class resolution, "App\Http\Transformers\DepartmentsTransformer" was found in both "/var/www/snipeit/app/Http/Transformers/DepartmentsTransformer.php" and "/var/www/snipeit/app/Http/Transformers/DepartmentsTranformer.php", the first will be used.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
21 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
Discovered Package: barryvdh/laravel-cors
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: eduardokum/laravel-mail-auto-embed
Discovered Package: fideloper/proxy
Discovered Package: intervention/image
Discovered Package: laravel/passport
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: nesbot/carbon
Discovered Package: pragmarx/google2fa-laravel
Discovered Package: rollbar/rollbar-laravel
Discovered Package: schuppo/password-strength
Discovered Package: spatie/laravel-backup
Discovered Package: tightenco/ziggy
Discovered Package: unicodeveloper/laravel-password
Package manifest generated successfully.
Generated optimized autoload files containing 4487 classes


Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.
Discovered Package: barryvdh/laravel-cors
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: eduardokum/laravel-mail-auto-embed
Discovered Package: fideloper/proxy
Discovered Package: intervention/image
Discovered Package: laravel/passport
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: nesbot/carbon
Discovered Package: pragmarx/google2fa-laravel
Discovered Package: rollbar/rollbar-laravel
Discovered Package: schuppo/password-strength
Discovered Package: spatie/laravel-backup
Discovered Package: tightenco/ziggy
Discovered Package: unicodeveloper/laravel-password
Package manifest generated successfully.


--------------------------------------------------------
Step 6: Migrating database:
--------------------------------------------------------

-- Nothing to migrate.


--------------------------------------------------------
Step 7: Checking for OAuth keys:
--------------------------------------------------------

- OAuth keys detected. Skipping passport install.

--------------------------------------------------------
Step 8: Caching routes and config:
--------------------------------------------------------

-- Configuration cache cleared!
Configuration cached successfully!
-- Route cache cleared!
Routes cached successfully!

--------------------------------------------------------
Step 9: Taking application out of maintenance mode:
--------------------------------------------------------

-- Application is now live.


--------------------------------------------------------
FINISHED! Clear your browser cookies and re-login to use :
your upgraded Snipe-IT.
--------------------------------------------------------

<blockquote><img src="/favicon.ico" width="48" align="right"><div>Snipe-IT Documentation</div><div><strong><a href="https://snipe-it.readme.io/docs/upgrading-to-v4">Upgrading to v4 from v3</a></strong></div><div>Snipe-IT v4 includes a ton of new features and bug fixes, and all users are strongly encouraged to upgrade. For a full list of what's new in V4, click here. Please note that Snipe-IT v4 does require PHP &gt;= 5.6.4. Please see the list of requirements before upgrading.Updating Snipe-IT should normal...</div></blockquote>
<blockquote><img src="https://repository-images.githubusercontent.com/14346979/164a6580-7d79-11e9-865f-eae87593e11a" width="48" align="right"><div><img src="https://github.githubassets.com/favicons/favicon.svg" height="14"> GitHub</div><div><strong><a href="https://github.com/snipe/snipe-it">snipe/snipe-it</a></strong></div><div>A free open source IT asset/license management system - snipe/snipe-it</div></blockquote>
<blockquote><img src="https://avatars3.githubusercontent.com/u/837015?s=400&v=4" width="48" align="right"><div><img src="https://github.githubassets.com/favicons/favicon.svg" height="14"> GitHub</div><div><strong><a href="/composer/composer/releases">Releases · composer/composer</a></strong></div><div>Dependency Manager for PHP. Contribute to composer/composer development by creating an account on GitHub.</div></blockquote>
<blockquote><img src="/favicon.ico" width="48" align="right"><div><strong><a href="https://carbon.nesbot.com/docs/#api-carbon-2">Carbon - A simple PHP API extension for DateTime.</a></strong></div><div>Carbon - A simple PHP API extension for DateTime.</div></blockquote>

swift2512 avatar Oct 23 '20 08:10 swift2512

Did that work?

snipe avatar Oct 23 '20 08:10 snipe

Version v4.9.3 - build 4395 (master)

I think, I'll leave it this way for now. :)

swift2512 avatar Oct 23 '20 08:10 swift2512

I have the same error. Not updated to the latest version. the git stash command didn't help


STEP 3: Pulling latest from Git (master branch):

Git is installed. Already on 'master' warning: CRLF will be replaced by LF in .github/ISSUE_TEMPLATE/Bug_report.md. The file will have its original line endings in your working directory. warning: CRLF will be replaced by LF in .github/ISSUE_TEMPLATE/Feature_request.md. The file will have its original line endings in your working directory. warning: CRLF will be replaced by LF in .github/ISSUE_TEMPLATE/Bug_report.md. The file will have its original line endings in your working directory. warning: CRLF will be replaced by LF in .github/ISSUE_TEMPLATE/Feature_request.md. The file will have its original line endings in your working directory. error: Your local changes to the following files would be overwritten by merge: .github/ISSUE_TEMPLATE/Bug_report.md Please, commit your changes or stash them before you can merge. Aborting -- -- Saved working directory and index state WIP on master: b9e1946 Bumped version for v4.9.5 HEAD is now at b9e1946 Bumped version for v4.9.5 -- M .github/ISSUE_TEMPLATE/Bug_report.md M .github/ISSUE_TEMPLATE/Feature_request.md Your branch is behind 'origin/master' by 1047 commits, and can be fast-forwarded. (use "git pull" to update your local branch) -- Updating b9e1946..9e319e9

Step 4: Cleaning up old cached files:

git pull Updating b9e1946..9e319e9 error: Your local changes to the following files would be overwritten by merge: .github/ISSUE_TEMPLATE/Bug_report.md Please, commit your changes or stash them before you can merge. Aborting

UserGoodtm avatar Nov 10 '20 08:11 UserGoodtm

error: Your local changes to the following files would be overwritten by merge: .github/ISSUE_TEMPLATE/Bug_report.md

It still appears you have local changes, so you'd need to resolve that before you can git pull.

snipe avatar Nov 10 '20 08:11 snipe

This answer from the comment helped me https://github.com/snipe/snipe-it/issues/8440#issuecomment-693354374

UserGoodtm avatar Nov 10 '20 08:11 UserGoodtm