Closed astrugatch closed 2 years ago
Try running composer self-update --2
and try upgrade again. I don't know if you are already on composer 2 or not.
Storing "stable" as default update channel for the next self-update run.
You are already using the latest available Composer version 2.3.8 (2.x channel).
Try composer update
on it's own.
When I try to re-reun composer install I get:
file_put_contents(/var/www/.config/composer/auth.json): failed to open stream: No such file or directory
Composer update gets:
snipeadmin@snipeit:/var/www/html/snipe-it/snipe-it$ composer update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 57 updates, 0 removals
- Upgrading aws/aws-sdk-php (3.222.13 => 3.229.2)
- Upgrading barryvdh/laravel-debugbar (v3.6.7 => v3.6.8)
- Upgrading barryvdh/laravel-dompdf (v1.0.0 => v1.0.2)
- Upgrading doctrine/annotations (1.13.2 => 1.13.3)
- Upgrading doctrine/cache (1.12.1 => 1.13.0)
- Upgrading doctrine/dbal (3.3.6 => 3.3.7)
- Upgrading doctrine/reflection (1.2.2 => 1.2.3)
- Upgrading facade/ignition (2.17.5 => 2.17.6)
- Upgrading guzzlehttp/guzzle (7.4.2 => 7.4.5)
- Upgrading guzzlehttp/psr7 (2.2.1 => 2.4.0)
- Upgrading intervention/image (2.7.1 => 2.7.2)
- Upgrading laravel/framework (v8.83.12 => v8.83.18)
- Upgrading laravel/serializable-closure (v1.1.1 => v1.2.0)
- Upgrading laravel/ui (v3.4.5 => v3.4.6)
- Upgrading league/commonmark (2.3.1 => 2.3.3)
- Upgrading league/flysystem-aws-s3-v3 (1.0.29 => 1.0.30)
- Upgrading league/uri (6.5.0 => 6.7.1)
- Upgrading livewire/livewire (v2.10.5 => v2.10.6)
- Upgrading maennchen/zipstream-php (2.1.0 => 2.2.1)
- Upgrading monolog/monolog (2.6.0 => 2.7.0)
- Upgrading nesbot/carbon (2.58.0 => 2.59.1)
- Upgrading nikic/php-parser (v4.13.2 => v4.14.0)
- Upgrading nyholm/psr7 (1.5.0 => 1.5.1)
- Upgrading overtrue/phplint (3.0.6 => 3.1.1)
- Upgrading paragonie/constant_time_encoding (v2.5.0 => v2.6.3)
- Upgrading phpunit/phpunit (9.5.20 => 9.5.21)
- Upgrading pragmarx/google2fa (8.0.0 => v8.0.1)
- Upgrading psy/psysh (v0.11.4 => v0.11.6)
- Upgrading squizlabs/php_codesniffer (3.6.2 => 3.7.1)
- Upgrading symfony/console (v5.4.8 => v5.4.10)
- Upgrading symfony/deprecation-contracts (v2.5.1 => v2.5.2)
- Upgrading symfony/dom-crawler (v4.4.39 => v4.4.42)
- Upgrading symfony/error-handler (v5.4.8 => v5.4.9)
- Upgrading symfony/event-dispatcher (v5.4.3 => v5.4.9)
- Upgrading symfony/event-dispatcher-contracts (v2.5.1 => v2.5.2)
- Upgrading symfony/http-foundation (v5.4.8 => v5.4.10)
- Upgrading symfony/http-kernel (v5.4.8 => v5.4.10)
- Upgrading symfony/mime (v5.4.8 => v5.4.10)
- Upgrading symfony/polyfill-ctype (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-iconv (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-intl-grapheme (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-intl-idn (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-intl-normalizer (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-mbstring (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-php72 (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-php73 (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-php80 (v1.25.0 => v1.26.0)
- Upgrading symfony/polyfill-php81 (v1.25.0 => v1.26.0)
- Upgrading symfony/service-contracts (v2.5.1 => v2.5.2)
- Upgrading symfony/string (v5.4.8 => v5.4.10)
- Upgrading symfony/translation (v5.4.8 => v5.4.9)
- Upgrading symfony/translation-contracts (v2.5.1 => v2.5.2)
- Upgrading symfony/var-dumper (v5.4.8 => v5.4.9)
- Upgrading symfony/yaml (v5.4.3 => v5.4.10)
- Upgrading tecnickcom/tc-lib-barcode (1.17.11 => 1.17.14)
- Upgrading tecnickcom/tc-lib-color (1.14.10 => 1.14.14)
- Upgrading webmozart/assert (1.10.0 => 1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 76 installs, 99 updates, 10 removals
- Syncing symfony/deprecation-contracts (v2.5.2) into cache
Failed to download psr/http-client from dist: /var/www/html/snipe-it/snipe-it/vendor/psr/http-client does not exist and could not be created.
Now trying to download from source
- Syncing psr/http-client (1.0.1) into cache
- Syncing guzzlehttp/psr7 (2.4.0) into cache
- Syncing guzzlehttp/promises (1.5.1) into cache
- Syncing guzzlehttp/guzzle (7.4.5) into cache
- Syncing symfony/polyfill-mbstring (v1.26.0) into cache
- Syncing alek13/slack (2.2.1) into cache
In Filesystem.php line 268:
/var/www/html/snipe-it/snipe-it/vendor/tmilos does not exist and could not be created.
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-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] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>...]
Does snipeadmin own /var/www/html/snipe-it/snipe-it?
It is owned by www-data
User and group www-data?
drwxr-xr-x 18 www-data www-data 4096 Jul 5 10:20 snipe-it
Unless you’re a developer, you shouldn’t run composer update
on its own. That updates our dependencies and can lead to really unpredictable behavior, and generates a new package.lock, which means git pulls will fail in the future.
cd to /var/www/html/snipe-it/
sudo chown -R snipeadmin:www-data snipe-it
sudo usermod -a -G www-data snipeadmin
sudo find snipe-it -type f -exec chmod 664 {} \;
sudo chgrp -R www-data snipe-it/storage snipe-it/bootstrap/cache snipe-it/public/uploads
sudo chmod -R ug+rwx snipe-it/storage snipe-it/bootstrap/cache snipe-it/public/uploads
Then try the php upgrade.php again.
@snipe
What is the proper procedure for updating composer?
@mikeroq I'm rolling back a snapshot so I can test your permissions fix without the composer update that @snipe recommended not running.
I cloned version 5.2.0 and I also get the barryvdh dompdf error, but my composer seems to go though just fine. It's still going (seems slow AF on windows).
This part on yours however from the beginning:
- Syncing symfony/deprecation-contracts (v2.5.1) into 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+snipeit+2022-07-05+0954 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+snipeit+2022-07-05+0954
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):
Maybe this would help that:
sudo apt-get install unzip
unzip is already installed.
Ran the upgrade twice. First time got the barryvdh dompdf error, second time it went through after discarding lots of changes.
@snipe Are those discard changes requests due to me possibly doing a composer update in the past? I really don't dig into this server that often (as my version probably shows). So I don't know if I tried that troubleshooting in the past.
unzip is already installed.
Ran the upgrade twice. First time got the barryvdh dompdf error, second time it went through after discarding lots of changes.
@snipe Are those discard changes requests due to me possibly doing a composer update in the past? I really don't dig into this server that often (as my version probably shows). So I don't know if I tried that troubleshooting in the past.
Was the upgrade successful?
Yes. Upgraded to 6.0.6. Site loads properly even after clearing caches/using private window. Still keeping my 5.2 snapshot around for a while, while my team uses it, just in case.
This is basically the same as #11385
Debug mode
Describe the bug
Running upgrade.php Getting the following in multiple sections.
Reproduction steps
Running Ubuntu 20.04 checked to make sure I have all the correct PHP extensions ran a self upgrade on composer, chown & chmod 755 on snipeit folder for www-data to fix permission error. Running upgrade.php as www-data Did git fetch --all & git reset --hard origin/master
Expected behavior
Expect to run through the upgrade process without errors. This is definitely self inflicted, I just don't see what I'm missing.
Screenshots
No response
Snipe-IT Version
5.2
Operating System
Ubuntu
Web Server
Apache
PHP Version
7.4
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
I don't remember what process was originally used for the install. It was a ways back.