Closed ahynesmidway closed 2 years ago
π Thanks for opening your first issue here! If you're reporting a π bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
I am having a very similar issue when running the upgrade script. I updated composer and now it asks for a Github token at step 8, and I have no idea what do about about that. I also get Error 500 when trying to load the webui. I am trying to move from 5.3.3 to 6.0.5
Did you try running composer self-update
like it suggests?
Did you try running
composer self-update
like it suggests?
Yep, before running that it did not ask for GitHub token, afterwards it does, but it tells me that there is nothing to update when I run it now.
I have restored to a snap shot that I took before all of this. And this time I will upgrade the OS (from 18.04 to 20.04), verify that it is all working. And then, after another snap shot, I will try the upgrade again and see how it goes, but I don't think much will be different, but you never know.
What version of Composer is needed for 6.0.5?
I should also mention that I tried to generate a GitHub token and use it, that simply threw up other errors (that I forgot to capture), but I'll be more methodical with this update now and post my findings. Other than the upgrade script output, are there any log files I should look to post here?
Okay, I did the following:
Reverted back to 18.04LTS. Confirmed everything was working, and I was running 5.3.3 again.
Install all the OS updates (apt update && apt upgrade). Rebooted and confirmed things were still working.
Ran the OS upgrade (do-release-upgrade), rebooted. Confirmed it was at 20.04LTS and that 5.3.3 was still working. Verified some versions:
PHP - 7.4.3 (June 13, 2022)
Composer - 1.7.3 2018-11-01
Installed the PHP XML module as I knew it was required. Tested the Web UI, all still working.
So now I have a fully functional Snipe on Ubuntu, but I am not sure if I should update composer and try the upgrade script, or if I should just run the upgrade script? Some advice on this would be welcome before I move to the next steps,
Ok, so I decided to just update composer manually (composer self-update
) and verified that it installed 2.7.3, just for good measure I rebooted and check to make sure Snipe came up and was working, it was.
I then ran the upgrade script and got the output below, and Snipe no longer worked and I get a error 500 when trying to load it.
Jarrod, you have successfully hijacked my post- I will now need to close this and repost. You have drowned out my query and fully taken over my post. You need to learn how to post you own issue mate.
closing and will repost on Monday AEST due to hijacked post
@ahynesmidway these looks like similar issues, not hijacking.
Jarrod, you have successfully hijacked my post- I will now need to close this and repost. You have drowned out my query and fully taken over my post. You need to learn how to post you own issue mate.
Well I do know how to post my own issue, but since your issue and mine are super similar I figured I would contribute to the problem rather than opening up a duplicate issue that would probably just get merged into yours anyway. I suspect that the solution to this will be the same for both of us.
I agree there are some similarities, must be a better way to post logs especially when they tend to drown out posts...
@ahynesmidway I already edited that post to use disclosure arrows.
@jarrodCoombes This part is key I think:
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+odo+2022-06-24+1547 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+odo+2022-06-24+1547
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 "/var/www/.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):
I think GH is disallowing the composer install to run. When you run php composer install --no-dev --prefer-source
manually, do you see the same thing?
@ahynesmidway same suggestion for you - when you run php composer install --no-dev --prefer-source
, what's your output?
@snipe I am not sure what I am doing wrong, but I get Could not open input file: composer
I tried running the same command, minus the PHP at the front and got:
Cool, I learned a thing today, how to make logs and things disappear in a disclosure arrow. Thanks @snipe for that tip.
@jarrodCoombes So it looks like you've got some PHP extensions that you need to enable in order for Composer to complete:
Problem 1
- aws/aws-sdk-php is locked to version 3.185.0 and an update of this package was not requested.
- aws/aws-sdk-php 3.185.0 requires ext-simplexml * -> it is missing from your system. Install or enable PHP's simplexml extension.
Problem 2
- eduardokum/laravel-mail-auto-embed is locked to version 1.0.5 and an update of this package was not requested.
- eduardokum/laravel-mail-auto-embed 1.0.5 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
Problem 3
- enshrined/svg-sanitize is locked to version 0.13.3 and an update of this package was not requested.
- enshrined/svg-sanitize 0.13.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
Problem 4
- masterminds/html5 is locked to version 2.7.4 and an update of this package was not requested.
- masterminds/html5 2.7.4 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
Problem 5
- squizlabs/php_codesniffer is locked to version 3.6.0 and an update of this package was not requested.
- squizlabs/php_codesniffer 3.6.0 requires ext-simplexml * -> it is missing from your system. Install or enable PHP's simplexml extension.
Problem 6
- tijsverkoyen/css-to-inline-styles is locked to version 2.2.3 and an update of this package was not requested.
- tijsverkoyen/css-to-inline-styles 2.2.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
Problem 7
- tijsverkoyen/css-to-inline-styles 2.2.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
- laravel/framework v6.20.29 requires tijsverkoyen/css-to-inline-styles ^2.2.1 -> satisfiable by tijsverkoyen/css-to-inline-styles[2.2.3].
- laravel/framework is locked to version v6.20.29 and an update of this package was not requested.
@snipe thanks for your help, currently snipe is in service after being restored via backup, so will need to wait until Monday AEST for another update attempt, I will run php composer install --no-dev --prefer-source and let you know the outcome of this :)
Ok, so modules were installed (sudo apt install php7.4-dom
which installed both dom and simplexml) and verified that they were present, I ran composer install --no-dev --prefer-source
and got:
That looked promising, so I ran the upgrade again, no dice.
We're back to
When working with public GitHub repositories only, head to https://github.com/settings/tokens/new?scopes=&description=Composer+on+odo+2022-06-24+1701 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+odo+2022-06-24+1701
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 "/var/www/.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):
I generated a token with read only access, ran the upgrade again, still doesn't work, but the error changes a bit.
Still seeing that tho
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+odo+2022-06-24+1830 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+odo+2022-06-24+1830
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 "/var/www/.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):
Ok, fixed it.
I logged in as www-data, then ran composer install --no-dev --prefer-source
as www-data, and got the prompt for a token, entered it and noted there was an error about a missing auth.json
So I then ran composer config --global --auth github-oauth.github.com <token>
and again, got that same error about not being able to touch (create) /var/www/.config/composer/auth.json
so I just created that directory and ran the config command again, it created the auth.json file. I then re-ran the Snipe upgrader, and while it threw out a few errors, it actually seemed to download and install some other things. And once it was done, I was up and running again, this time at version 6.0.5
Near as I can guess, the symfony/deprecation-contracts
repository is causing the need for a token. No idea why.
@ahynesmidway I'd suggest checking your composer version, upgrading it (composer self-update
) then run the command @snipe suggested with a token you generate at github (just follow the link in the output) and if it's complaining about auth.json
missing, then simply create that folder, and run composer config --global --auth github-oauth.github.com <token>
to let it create said json, the run the upgrade again. Hopefully that works for you.
I did see this, not sure if this is problem or not though, but it is completely unrelated to the main issue.
@ahynesmidway Try running ALTER TABLE users ROW_FORMAT=DYNAMIC;
on your mysql DB and re-run the upgrader
Okay, and when you run migrations (or the upgrader) again, what happens?
Okay, and when you run migrations (or the upgrader) again, what happens?
Didn't realize the alter table thing was directed at me. Well even though it showed nothing being affected when run, the update finished with no error there anymore. So I think I am good to go. Thanks @snipe
@jarrodCoombes sorry, I mistagged in my reply - multitasking FTL! Glad you're sorted :)
I have completed all steps recommended and upgrade for composer went well per instructions (required same folder path creation for composer config --global --auth github-oauth.github.com
GitHub
A free open source IT asset/license management system - GitHub - snipe/snipe-it: A free open source IT asset/license management system
@ahynesmidway - I believe this is your issue:
Your github oauth token for [github.com](http://github.com/) contains invalid characters: "dAZMWQJhR3e/yIgZvYxa1xVK8G6k61pzF+JIkLN+gbQ="
Regenerate the token on GitHub and try it again, you may need to delete the auth.json
file or edit it with the new token. You probably do not want to post tokens like that one publicly in future though.
Also, check to make sure you have all the needed PHP modules (and that they are enabled). php -m
should list them all. Based on your output you're looking to make sure the dom
module is in the list, if it's not, then you'll need to work out how to install and enable it (can't help you with this one, as I have no idea how to do this on a Windows machine, only on Linux at this point).
Cheers @jarrodCoombes I have got as far as discovering after update.php a missing php extension after new token on composer update- sodium, but unsure on where to install- this aint my setup its on a windows host so unique in comparison with a Linux build per folder locations- and documentation.. dom module is installed on the list
Closer inspection shows the sodium extension is there
bit confused on what has occurred- will restore from backups and await more feedback
Cheers @jarrodCoombes & @snipe
There and enabled are not the same thing. Please see the php docs on sodium to see how to enable sodium on windows
ok cheers @snipe Ill look into this and try again when I have more info
Sounds good - let me know how you make out :)
Hey @snipe & @jarrodCoombes you have both helped alot with the upgrade, I am now showing v6.0.5- only reqd the ;sodium ext uncommented, oncve I got a chance to do the upgrade I went through a few of the tasks- composer update to 2.3.7- ran- composer config --global --auth github-oauth.github.com
Awesome, glad you're sorted!
Thanks for the thread and support. For me, re-running "php upgrade.php" after running "composer install --no-dev --prefer-source" worked. Appreciate your help! I am on v6.0.14 - build 9038 (master) now.
Debug mode
Describe the bug
After running the upgrade and reopening the snipe url 500 error is displayed. Have checked PHP version @ 7.4.21 debug shows error below-
In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found
please assist
Cheers Adrian
Reproduction steps
Expected behavior
to upgrade without 500 error, have previously upgraded via git successfully before and worked very well
Screenshots
Snipe-IT Version
5.4.2
Operating System
Server 2016
Web Server
IIS
PHP Version
7.4.21
Operating System
W10
Browser
Chrome- all
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
Click to expand
``` [2022-06-24 10:23:33] production.ERROR: Uncaught ReflectionException: Class view does not exist in C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\Container.php:803 Stack trace: #0 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\Container.php(803): ReflectionClass->__construct() #1 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\Container.php(681): Illuminate\Container\Container->build() #2 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(785): Illuminate\Container\Container->resolve() #3 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\Container.php(629): Illuminate\Foundation\Application->resolve() #4 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(770): Illuminate\Container\Container->make() #5 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Container\Container.php(1244): Illuminate\Foundation\Application->make() #6 C {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Uncaught ReflectionException: Class view does not exist in C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php:803 Stack trace: #0 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(803): ReflectionClass->__construct() #1 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(681): Illuminate\\Container\\Container->build() #2 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(785): Illuminate\\Container\\Container->resolve() #3 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(629): Illuminate\\Foundation\\Application->resolve() #4 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(770): Illuminate\\Container\\Container->make() #5 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php(1244): Illuminate\\Foundation\\Application->make() #6 C at C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Container\\Container.php:805) [stacktrace] #0 {main} "} [2022-06-24 10:31:29] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Class 'Barryvdh\DomPDF\ServiceProvider' not found in C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php:208 Stack trace: #0 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php(144): Illuminate\Foundation\ProviderRepository->createProvider() #1 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php(61): Illuminate\Foundation\ProviderRepository->compileManifest() #2 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(593): Illuminate\Foundation\ProviderRepository->load() #3 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\RegisterProviders.php(17): Illuminate\Foundation\Application->registerConfiguredProviders() #4 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(219): Illuminate\Foundation\Bootstrap\RegisterProviders->bootstrap() #5 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(320): Illuminate\Foundation\Application->bootstrapWith() #6 C:\inetpub\wwwroot\snipe-it\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(129): Illuminate\Foundation\Console\Kernel->bootstrap() #7 C:\inetpub\wwwroot\snipe-it\artisan(35): Illuminate\Foundation\Console\Kernel->handle() #8 {main} [2022-06-24 10:31:29] production.ERROR: Class 'Barryvdh\DomPDF\ServiceProvider' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Barryvdh\\DomPDF\\ServiceProvider' not found at C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRepository.php:208) [stacktrace] #0 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRepository.php(144): Illuminate\\Foundation\\ProviderRepository->createProvider() #1 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\ProviderRepository.php(61): Illuminate\\Foundation\\ProviderRepository->compileManifest() #2 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(593): Illuminate\\Foundation\\ProviderRepository->load() #3 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Bootstrap\\RegisterProviders.php(17): Illuminate\\Foundation\\Application->registerConfiguredProviders() #4 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Application.php(219): Illuminate\\Foundation\\Bootstrap\\RegisterProviders->bootstrap() #5 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(320): Illuminate\\Foundation\\Application->bootstrapWith() #6 C:\\inetpub\\wwwroot\\snipe-it\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Console\\Kernel.php(129): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #7 C:\\inetpub\\wwwroot\\snipe-it\\artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle() #8 {main} "} ```Additional context
Click to expand
``` C:\inetpub\wwwroot\snipe-it>php artisan config:clear In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found not reproducable via the demo page below the following extract from upgrade.php all other steps seem to have gone normally -------------------------------------------------------- Step 5: Cleaning up old cached files: -------------------------------------------------------- v No bootstrap/cache/compiled.php, so nothing to delete. v No bootsrap/cache/services.php, so nothing to delete. v No bootstrap/cache/config.php, so nothing to delete. -- In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found -- In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found -- In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found -- In ProviderRepository.php line 208: Class 'Barryvdh\DomPDF\ServiceProvider' not found -------------------------------------------------------- Step 6: Updating composer dependencies: (This may take a moment.) -------------------------------------------------------- -- We couldn't find a local composer.phar. No worries, trying globally. Generating optimized autoload files> 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 Loading composer repositories with package information Installing dependencies from lock file Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for doctrine/dbal 3.3.6 -> satisfiable by doctrine/dbal[3.3.6]. - doctrine/dbal 3.3.6 requires composer-runtime-api ^2 -> no matching package found. Problem 2 - Installation request for lcobucci/jwt 4.1.5 -> satisfiable by lcobucci/jwt[4.1.5]. - lcobucci/jwt 4.1.5 requires ext-sodium * -> the requested PHP extension sodium is missing from your system. Problem 3 - lcobucci/jwt 4.1.5 requires ext-sodium * -> the requested PHP extension sodium is missing from your system. - laravel/passport v10.4.1 requires lcobucci/jwt ^3.4|^4.0 -> satisfiable by lcobucci/jwt[4.1.5]. - Installation request for laravel/passport v10.4.1 -> satisfiable by laravel/passport[v10.4.1]. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see