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

Upgrade 6.0.14 to newest 6.1 - failed and now access to GUI now #13126

Closed
2 tasks done
splork opened this issue Jun 6, 2023 · 15 comments
Closed
2 tasks done

Upgrade 6.0.14 to newest 6.1 - failed and now access to GUI now #13126

splork opened this issue Jun 6, 2023 · 15 comments
Assignees

Comments

@splork
Copy link

splork commented Jun 6, 2023

Debug mode

Describe the bug

Upgraded to newest 6.1 version and can no longer access GUI using same URL as previously. Here is the output from the upgrade:

WELCOME TO THE SNIPE-IT UPGRADER!

This script will attempt to:

  • validate some very basic .env file settings
  • check your PHP version and extension requirements
  • check directory permissions
  • do a git pull to bring you to the latest version
  • run composer install to get your vendors up to date
  • run migrations to get your schema up to date
  • clear out old cache settings

STEP 1: Checking .env file:

  • Your .env is located at /var/www/snipe-it/.env

√ Your APP_KEY is not blank.
√ Your APP_URL is not null or blank. It is set to http://snipe.lan
√ Your APP_URL is set to http://snipe.lan and starts with the protocol (https:// or http://)
√ Your APP_URL (http://snipe.lan) does not have a trailing slash.


STEP 2: Checking PHP requirements:

Current PHP version: (7.4.30) is at least 7.4.0 - continuing...
FYI: The php.ini used by this PHP is: /etc/php.ini

Checking Required PHP extensions...

√ bcmath is installed!
√ curl is installed!
√ fileinfo is installed!
√ gd is installed!
√ json is installed!
√ ldap is installed!
√ mbstring is installed!
√ mysqli is installed!
√ openssl is installed!
√ PDO is installed!
√ sodium is installed!
√ tokenizer is installed!
√ xml is installed!
√ zip is installed!


STEP 3: Checking directory permissions:

√ /var/www/snipe-it/bootstrap/cache is writable
√ /var/www/snipe-it/storage is writable
√ /var/www/snipe-it/storage/logs is writable
√ /var/www/snipe-it/storage/logs/laravel.log is writable
√ /var/www/snipe-it/storage/framework is writable
√ /var/www/snipe-it/storage/framework/cache is writable
√ /var/www/snipe-it/storage/framework/sessions is writable
√ /var/www/snipe-it/storage/framework/views is writable
√ /var/www/snipe-it/storage/app is writable
√ /var/www/snipe-it/storage/app/backups is writable
√ /var/www/snipe-it/storage/app/backup-temp is writable
√ /var/www/snipe-it/storage/private_uploads is writable
√ /var/www/snipe-it/public/uploads is writable


STEP 4: Backing up database:

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found


STEP 5: Putting application into maintenance mode:

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found


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

Git is installed.
Already on 'master'
-- No local changes to save
-- Your branch is up to date with 'origin/master'.
-- Already up to date.


STEP 7: Cleaning up old cached files:

√ No bootstrap/cache/compiled.php, so nothing to delete.
√ No bootstrap/cache/services.php, so nothing to delete.
√ No bootstrap/cache/config.php, so nothing to delete.
√ No vendor/symfony/translation/TranslatorInterface.php, so nothing to delete.

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found


STEP 8: Updating composer dependencies:
(This may take a moment.)

-- Running the app in production mode.
-- We couldn't find a local composer.phar. No worries, trying globally.
Since you are running composer globally, we won't try to update it for you.
If you run into issues with this step, try running composer self-update
before running this updater again

Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Package operations: 3 installs, 60 updates, 0 removals

  • Syncing symfony/deprecation-contracts (v2.5.2) into cache
  • Syncing guzzlehttp/psr7 (2.4.0) into cache
  • Syncing guzzlehttp/guzzle (7.4.5) into cache
  • Syncing symfony/polyfill-mbstring (v1.26.0) into cache
  • Syncing symfony/polyfill-php80 (v1.26.0) into cache
  • Syncing symfony/polyfill-ctype (v1.26.0) into cache
  • Syncing symfony/var-dumper (v5.4.9) into cache
  • Syncing symfony/polyfill-php72 (v1.26.0) into cache
  • Syncing symfony/polyfill-intl-normalizer (v1.26.0) into cache
  • Syncing symfony/polyfill-intl-idn (v1.26.0) into cache
  • Syncing symfony/mime (v5.4.10) into cache
  • Syncing symfony/polyfill-php73 (v1.26.0) into cache
  • Syncing symfony/http-foundation (v5.4.10) into cache
  • Syncing symfony/event-dispatcher-contracts (v2.5.2) into cache
  • Syncing symfony/event-dispatcher (v5.4.9) into cache
  • Syncing symfony/error-handler (v5.4.9) into cache
  • Syncing symfony/http-kernel (v5.4.10) into cache
  • Syncing symfony/polyfill-intl-grapheme (v1.26.0) into cache
  • Syncing symfony/string (v5.4.10) into cache
  • Syncing symfony/service-contracts (v2.5.2) into cache
  • Syncing symfony/console (v5.4.10) into cache
  • Syncing symfony/polyfill-iconv (v1.26.0) into cache
  • Syncing symfony/polyfill-php81 (v1.26.0) into cache
  • Syncing symfony/translation-contracts (v2.5.2) into cache
  • Syncing symfony/translation (v5.4.9) into cache
  • Syncing nesbot/carbon (2.59.1) into cache
  • Syncing monolog/monolog (2.7.0) into cache
  • Syncing league/commonmark (2.3.4) into cache
  • Syncing laravel/serializable-closure (v1.2.0) into cache
  • Syncing webmozart/assert (1.11.0) into cache
  • Syncing laravel/framework (v8.83.22) into cache
  • Syncing arietimmerman/laravel-scim-server (dev-master 9e8dd2d) into cache
  • Syncing barryvdh/laravel-debugbar (v3.7.0) into cache
  • Syncing phenx/php-svg-lib (0.5.0) into cache
  • Syncing masterminds/html5 (2.7.6) into cache
  • Syncing dompdf/dompdf (v2.0.3) into cache
  • Syncing barryvdh/laravel-dompdf (v2.0.0) into cache
  • Syncing doctrine/annotations (1.13.3) into cache
  • Syncing doctrine/reflection (1.2.3) into cache
  • Syncing doctrine/cache (1.13.0) into cache
  • Syncing doctrine/dbal (3.3.7) into cache
  • Syncing squizlabs/php_codesniffer (3.7.1) into cache
  • Syncing facade/ignition (2.17.6) into cache
  • Syncing fideloper/proxy (4.4.2) into cache
  • Syncing intervention/image (2.7.2) into cache
  • Syncing paragonie/constant_time_encoding (v2.6.3) into cache
  • Syncing nyholm/psr7 (1.5.1) into cache
  • Syncing league/uri (6.7.1) into cache
  • Syncing firebase/php-jwt (v6.3.0) into cache
  • Syncing league/oauth1-client (v1.10.1) into cache
  • Syncing laravel/socialite (v5.6.1) into cache
  • Syncing nikic/php-parser (v4.14.0) into cache
  • Syncing psy/psysh (v0.11.7) into cache
  • Syncing laravel/ui (v3.4.6) into cache
  • Syncing aws/aws-sdk-php (3.231.12) into cache
  • Syncing league/flysystem-aws-s3-v3 (1.0.30) into cache
  • Syncing maennchen/zipstream-php (2.2.1) into cache
  • Syncing phpoffice/phpspreadsheet (1.24.1) into cache
  • Syncing livewire/livewire (v2.10.6) into cache
  • Syncing paragonie/sodium_compat (v1.19.0) into cache
  • Syncing pragmarx/google2fa (v8.0.1) into cache
  • Syncing tecnickcom/tc-lib-color (1.14.14) into cache
  • Syncing tecnickcom/tc-lib-barcode (1.17.14) into cache
    0 [>---------------------------] 0 [->--------------------------]
  • Upgrading symfony/deprecation-contracts (v2.5.1 => v2.5.2): Checking out e8b495ea28 from cache
  • Upgrading guzzlehttp/psr7 (2.2.1 => 2.4.0): Checking out 13388f0095 from cache
  • Upgrading guzzlehttp/guzzle (7.4.2 => 7.4.5): Checking out 1dd98b0564 from cache
    symfony/polyfill-mbstring has modified files:
    M LICENSE
    M Mbstring.php
    M README.md
    M Resources/unidata/lowerCase.php
    M Resources/unidata/titleCaseRegexp.php
    M Resources/unidata/upperCase.php
    M bootstrap.php
    M bootstrap80.php
    M composer.json
    Discard changes [y,n,v,d,s,?]?
  • Upgrading symfony/polyfill-mbstring (v1.25.0 => v1.26.0): Checking out 9344f9cb97 from cache

In GitDownloader.php line 246:

Failed to execute git show-ref --head -d

fatal: detected dubious ownership in repository at '/var/www/snipe-it/vendor/symfony/polyfill-php80'
To add an exception for this directory, call:

    git config --global --add safe.directory /var/www/snipe-it/vendor/symfony/polyfill-php80

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [...]

Class ParsedownTest located in ./vendor/erusev/parsedown/test/ParsedownTest.php does not comply with psr-0 autoloading standard. Skipping.

Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover --ansi
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
Generating optimized autoload files

In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found


STEP 9: Migrating database:

In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found


STEP 10: Checking for OAuth keys:

√ OAuth keys detected. Skipping passport install.


STEP 11: Taking application out of maintenance mode:

--
In ProviderRepository.php line 208:

Class 'Laravel\Socialite\SocialiteServiceProvider' not found

---------------------- FINISHED! -----------------------
All done! Clear your browser cookies and re-login to use
your upgraded Snipe-IT!

[snipeit@WCS-snipeIT-01 snipe-it]$

@splork
Copy link
Author

splork commented Jun 6, 2023

This is from the debug:

Illuminate \ Contracts \ Container \ BindingResolutionException
Target class [session] does not exist.
Previous exceptions
Class session does not exist (-1)

@splork splork changed the title Upgrade 6.0.14 to newest 6.1 Upgrade 6.0.14 to newest 6.1 - failed and now access to GUI now Jun 7, 2023
@splork
Copy link
Author

splork commented Jun 7, 2023

Fixed:

I added the git config line from below and every time I upgrade.php it would give a new line. Did about 20 of them and it finally worked.

In GitDownloader.php line 248:

Failed to execute git show-ref --head -d

fatal: detected dubious ownership in repository at '/var/www/snipe-it/vendor/nyholm/psr7'

To add an exception for this directory, call:

    git config --global --add safe.directory /var/www/snipe-it/vendor/nyholm/psr7

@marcusmoore
Copy link
Collaborator

Hi there @splork, glad you got it working but it would be a lot better if you didn't have to keep running the command over and over...what platform are you using?

@marcusmoore marcusmoore self-assigned this Jun 7, 2023
@splork
Copy link
Author

splork commented Jun 7, 2023 via email

@marcusmoore
Copy link
Collaborator

Thanks for the response.

I'm going to close this since you got around the issues you experienced but we'll keep track of it if anyone else runs into the same problem.

@stf675
Copy link

stf675 commented Aug 3, 2023

Hello,

I got the same problem after running ./upgrade.php from 6.0.14 to latest.

I searched for GitDownloader.php but that file dose not exist.

at this time I am getting 500 error.

`

STEP 4: Backing up database:

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found


STEP 5: Putting application into maintenance mode:

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found


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

Git is installed.
Already on 'master'
-- No local changes to save
-- Your branch is up to date with 'origin/master'.
-- Already up to date.


STEP 7: Cleaning up old cached files:

v No bootstrap/cache/compiled.php, so nothing to delete.
v No bootstrap/cache/services.php, so nothing to delete.
v No bootstrap/cache/config.php, so nothing to delete.
v No vendor/symfony/translation/TranslatorInterface.php, so nothing to delete.

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found


STEP 8: Updating composer dependencies:
(This may take a moment.)

-- Running the app in production mode.
-- We couldn't find a local composer.phar. No worries, trying globally.
Since you are running composer globally, we won't try to update it for you.
If you run into issues with this step, try running composer self-update
before running this updater again

sh: composer: command not found
sh: composer: command not found


STEP 9: Migrating database:

In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found


STEP 10: Checking for OAuth keys:

v OAuth keys detected. Skipping passport install.


STEP 11: Taking application out of maintenance mode:

--
In ProviderRepository.php line 208:

Class "Laravel\Socialite\SocialiteServiceProvider" not found
`

@marcusmoore
Copy link
Collaborator

Hi @stf675

This line stood out to me: sh: composer: command not found can you verify that you can run composer successfully? It seems like it is not installed on the system anymore?

@stf675
Copy link

stf675 commented Aug 3, 2023

since initial setup over year ago, php ./upgrade.php always worked. this time after it broke on v 6.1.12, I ran php ./upgrade.php v6.1.0 and I got back to 6.1.0 and it worked - tried 6.1.2 and it failed same error

tried few time back and forth with same results

@stf675
Copy link

stf675 commented Aug 3, 2023

so going from 6.1.0 to 6.1.1 or 6.1.2 ends up with those errors

6.1.0 is good

@marcusmoore
Copy link
Collaborator

Sorry you're having issues with this.

Can you try the following:

  1. Upgrade to the latest using the upgrade script (knowing that it will fail)
  2. Run composer install --no-dev --prefer-source manually and confirm it runs successfully (and install Socialite)
  3. Run the upgrade again and hopefully it runs successfully
  4. Let me know how it goes

@stf675
Copy link

stf675 commented Aug 3, 2023

running #2 produce lots of "Synching...... into cache

then

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+devsnipeit.wolve.com+2023-08-03+2126 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+devsnipeit.wolve.com+2023-08-03+2126
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "/home/snipeit/.config/composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):
    Update of symfony/deprecation-contracts failed
  - Upgrading guzzlehttp/psr7 (2.2.1 => 2.4.0): Checking out 13388f0095 from cache
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+devsnipeit.wolve.com+2023-08-03+2126 to retrieve a token.
This token will have read-only permission for public information only.
When you need to access _private_ GitHub repositories as well, go to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+devsnipeit.wolve.com+2023-08-03+2126
Note that such tokens have broad read/write permissions on your behalf, even if not needed by Composer.
Tokens will be stored in plain text in "/home/snipeit/.config/composer/auth.json" for future use by Composer.
For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth
Token (hidden):

hitting enter not helping. CTRL-C messing up shell.

rebooted, ran upgrade.php - error 500

ran upgrade.php v6.1.0 back to ver 6.1.0 and working

@marcusmoore
Copy link
Collaborator

hitting enter not helping

That's odd...Did you generate a token and paste it in before hitting enter?

@stf675
Copy link

stf675 commented Aug 3, 2023

it did not prompt me, and I am not really know what token that should be.

@marcusmoore
Copy link
Collaborator

marcusmoore commented Aug 3, 2023

The message might be confusing because you're not accessing "private repos" but the prompt was at the top of your snippet:

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
When working with _public_ GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+devsnipeit.wolve.com+2023-08-03+2126 to retrieve a token.
This token will have read-only permission for public information only.

You usually won't get prompted for this but it can occur when composer install or composer update are run multiple times in a short amount of time and GitHub starts rate-limiting your IP address.

I would give the steps mentioned above and generate and paste in the token if prompted.

@stf675
Copy link

stf675 commented Aug 4, 2023

Fixed,

As you suggested....

ran

sudo php ./composer.phar install --no-dev --prefer-source

confirmed bunch of smaller updates, re-ran uograde.php, it updated some dependencies and now I am on 6.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants