-
Notifications
You must be signed in to change notification settings - Fork 30
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
cv upgrade:db failed on 5.47.0 codebase #112
Comments
I had a similar but different problem and it was that I somehow had a mismatched version of symfony/console and needed to run composer install. |
Run composer install where? I had cv downloaded as the phar and was upgrading a D7-based civi site (not composer based). |
Oh ok this might be different then - I had it built from source. For what it's worth I just tried the 0.3.18 phar and the ConfirmationQuestion worked ok here. |
Yeah, I'm having trouble reproducing as well. Worked for me on D7+WP using v0.3.18. A few sanity checks to try: ## Check both version and md5sum of PHAR.
$ cv --version
cv v0.3.18
$ md5sum `which cv`
873d89af61cc2810dd76793bc63575d2 /Users/totten/bknix/bin/cv
## PHP version
$ php --version
PHP 7.4.26 (cli) (built: Nov 28 2021 18:18:12) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.26, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
## Check content of phar - it should have class `ConfirmationQuestion` and its parent `Question`
$ phar list -f `which cv` | grep vendor.*Question
| | | |-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Helper/QuestionHelper.php
| | | |-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Helper/SymfonyQuestionHelper.php
| | |-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Question
| | | |-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Question/ChoiceQuestion.php
| | | |-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Question/ConfirmationQuestion.php
| | | \-phar:///Users/totten/bknix/bin/cv/vendor/symfony/console/Question/Question.php
## Check that the file has the functions
$ mkdir /tmp/z ; phar extract -f `which cv` -i 'Question' /tmp/z
//Users/totten/bknix/bin/cv/vendor/symfony/console/Helper/QuestionHelper.php ...ok
//Users/totten/bknix/bin/cv/vendor/symfony/console/Helper/SymfonyQuestionHelper.php ...ok
//Users/totten/bknix/bin/cv/vendor/symfony/console/Question/ChoiceQuestion.php ...ok
//Users/totten/bknix/bin/cv/vendor/symfony/console/Question/ConfirmationQuestion.php ...ok
//Users/totten/bknix/bin/cv/vendor/symfony/console/Question/Question.php ...ok
$ grep -r getAutocompleterCallback /tmp/z
/tmp/z/Users/totten/bknix/bin/cv/vendor/symfony/console/Question/Question.php:$callback = $this->getAutocompleterCallback();
/tmp/z/Users/totten/bknix/bin/cv/vendor/symfony/console/Question/Question.php:public function getAutocompleterCallback(): ?callable
/tmp/z/Users/totten/bknix/bin/cv/vendor/symfony/console/Helper/QuestionHelper.php:$autocomplete = $question->getAutocompleterCallback();
$ grep -r 'class ConfirmationQuestion' /tmp/z
/tmp/z/Users/totten/bknix/bin/cv/vendor/symfony/console/Question/ConfirmationQuestion.php:class ConfirmationQuestion extends Question
|
Snap, I get the same, I think. But I'm on php 7.4.28
|
Nb. it's happy to run now there's nothing to do.
|
A possibility: Drupal 8+ has its own version of symfony/console. If it's a different version, and for whatever reason its version of Question.php gets autoloaded earlier, then if cv's version of QuestionHelper.php gets loaded later there's a mismatch. This might be more likely if it was originally a Drupal 8 site (as opposed to Drupal 9). |
Yeah, but my site was a D7 one! |
I'm going to close this, I'll reopen if it reoccurs - I'm doing lots of upgrades at the mo. |
I had the same trouble today upgrading a client's site from 5.49 to 5.57 on d7, cv v0.3.30. (Note that drush civicrm-upgrade-db ran through fine, though it's not as nice as it doesn't warn about replacing msgTemplates) |
Solution: totten/civix#299 (comment) |
version:
cv v0.3.18
Moving from 5.36.1 to 5.47.0, i.e. have replaced the civicrm/ dir, and want to run the db upgrade I got this error:
I was able to run the upgrade through using
drush civicrm-upgrade-db
instead.Not sure if I did something wrong, or if this is a bug?
The text was updated successfully, but these errors were encountered: