Closed quenenni closed 1 year ago
The getDisplayName()
function is available since carddavclient library version 1.3.0, which is required for rcmcarddav v5.
Since it is not available, but composer would take care of it being installed when you install rcmcarddav v5, my guess is that you might have two versions of carddavclient installed, one inside the plugin directory (roundcube_install_path/plugins/carddav/vendor
) and one inside the roundcube main vendor directory (roundcube_install_path/vendor
). This can either happen if you ran composer inside the plugin directory anytime before or you used a tarball installation method and later on upgraded using composer without cleaning up the tarball version.
Anyway, to check:
roundcube_install_path/plugins/carddav/vendor
directory, delete it.composer show
. It should show mstilkerich/carddavclient
with version v1.3.0.composer update --no-dev
Thanks for the help.
Since it is not available, but composer would take care of it being installed when you install rcmcarddav v5, I didn't use composer when I upgraded my plugin.
As the install doc mentions, "Note: Release tarballs prior to v4.1.0 lack the dependencies and require to run composer. See the INSTALL.md file inside that tarball for the appropriate instructions.". As I donwloaded v5, I thought I didn't need to use composer.
my guess is that you might have two versions of carddavclient installed, one inside the plugin directory (roundcube_install_path/plugins/carddav/vendor) and one inside the roundcube main vendor directory (roundcube_install_path/vendor)
You're right:
roundcube/plugins/carddav/vendor/mstilkerich/carddavclient/ (## Version 1.3 : function getDisplayName exists)
roundcube/vendor/mstilkerich/carddavclient/ (## Version 1.2.1 : function getDisplayName doens't exists)
This can either happen if you ran composer inside the plugin directory anytime before or you used a tarball installation method and later on upgraded using composer without cleaning up the tarball version
What happened since the first attempt to upgrade to v5.
In March, my colleguea downloaded the v5, switched the carddav plugin folder with the newly downloaded v5 and adapted the config file. He connected to RC and as it was not working, he put back the v4.3 folder. He didn't use composer in the process.
Then, in April, I downloaded the last version and switched the v4.3 folder with the newly downloaded v5 plugin and I adapted the config. I didn't use composer. But I had the other errors I talked about in the other issues.
The only time we used composer in carddav folder was to install the v4.3 version.
Is there a way to adapt this or is the only way to fix this is to uninstall completely the plugin and re-install it?
Thanks.
[EDIT]
To upgrade my RC, I used the script ./bin/installto.sh <TARGET-FOLDER>
as mentioned in their documentation.
First you have to decide whether you want to install the plugin using composer or tarball. I suspect you did at least once install using composer, because otherwise there should not be a carddavclient library in the roundcube vendor directory. I recommend installation using composer, since you can avoid the mess of having two different versions of the same library installed (there are libraries which both roundcube and rcmcarddav use, e.g. guzzle).
cp plugins/carddav/config.inc.php rcmcarddav_config.inc.php
rm -rf plugins/carddav
roundcube/carddav
inside composer.json
with a text editor of your choice. As I wrote, I suspect it is already there. Make sure it depends on version 5, e.g. "roundcube/carddav": "^5.0.0"
(this will always upgrade to the latest 5.x.x release, which should not contain backwards incompatible changes and therefore be safe, whereas upgrading to the next major version should be done with care and only after reading the upgrade instructions).composer update --no-dev -o
- it should reinstall the carddav plugin and upgrade carddavclient in the process.mv rcmcarddav_config.inc.php plugins/carddav/config.inc.php
composer update --no-dev -o
cp plugins/carddav/config.inc.php rcmcarddav_config.inc.php
composer.json
and remove the dependency to roundcube/carddav
if it is present.composer update --no-dev -o
, roundcube/carddav and dependencies including mstilkerich/carddavclient should be removedcomposer dump-autoload -o
, and then composer update --no-dev -o
composer update --no-dev -o
one more time, it should now work.mv rcmcarddav_config.inc.php plugins/carddav/config.inc.php
Could you fix the issue?
I'm planning to try to fix it this week. I was under heavy load last week (and had 2 days without internet in the middle of this, so much fun).
Sorry for the delay.
Closing this for lack of feedback and since I believe there is no issue with rcmcarddav here.
Sorry for the delay. I was able to do another try to update my rouncube + plugin, and the plugin update failed.
I started from a new copy of our prod setup, meaning, with carddav plugin to v4.7 and without any attempts to update it.
Here are the exact steps I did:
executed the script to update my Rc (bin/installto.sh /var/www/roundcube-test/
)
..... (lots of lines without problems)
- Upgrading roundcube/plugin-installer (0.3.1 => 0.3.2): Extracting archive
- Installing dasprid/enum (1.0.4): Extracting archive
- Installing bacon/bacon-qr-code (2.0.8): Extracting archive
- Installing symfony/deprecation-contracts (v3.2.1): Extracting archive
- Upgrading psr/http-message (1.0.1 => 1.1): Extracting archive
- Upgrading psr/http-client (1.0.1 => 1.0.2): Extracting archive
- Installing psr/http-factory (1.0.2): Extracting archive
- Upgrading guzzlehttp/psr7 (1.8.3 => 2.5.0): Extracting archive
- Upgrading guzzlehttp/promises (1.5.1 => 2.0.0): Extracting archive
- Upgrading guzzlehttp/guzzle (6.5.5 => 7.7.0): Extracting archive
- Upgrading masterminds/html5 (2.7.5 => 2.7.6): Extracting archive
- Upgrading pear/console_commandline (v1.2.4 => v1.2.6): Extracting archive
- Upgrading pear/crypt_gpg (v1.6.6 => v1.6.7): Extracting archive
- Upgrading pear/pear-core-minimal (v1.10.11 => v1.10.13): Extracting archive
- Upgrading pear/net_sieve (1.4.5 => 1.4.6): Extracting archive
- Upgrading pear/net_smtp (1.10.0 => 1.10.1): Extracting archive
- Upgrading sabre/uri (2.2.2 => 2.3.2): Extracting archive
- Upgrading sabre/xml (2.2.5 => 3.0.0): Extracting archive
- Upgrading sabre/vobject (4.4.0 => 4.5.3): Extracting archive
- Upgrading psr/log (1.1.4 => 3.0.0): Extracting archive
- Upgrading mstilkerich/carddavclient (v1.2.1 => v1.3.0): Extracting archive
Update of roundcube/carddav failed
0/20 [>---------------------------] 0%
4/20 [=====>----------------------] 20%
14/20 [===================>--------] 70%
20/20 [============================] 100%
[ErrorException]
require(/var/www/roundcube-test/vendor/composer/../symfony/polyfill-intl-normalizer/bootstrap.php): Failed to open stream: No such file or directory
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--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] [--] [
php composer.phar update --no-dev
This instance of Roundcube is up-to-date.
My Roundcube was updated but an error when trying to update the carddav plugin.
- I went into my RC folder to execete again the composer command:
sudo -u www-data php composer.phar update --no-dev Loading composer repositories with package information Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies Nothing to modify in lock file Installing dependencies from lock file Package operations: 0 installs, 1 update, 0 removals
Downloading roundcube/carddav (dev-master 21170df) Update of roundcube/carddav failed
[ErrorException]
require(/var/www/roundcube-test/vendor/composer/../symfony/polyfill-intl-normalizer/bootstrap.php): Failed to open stream: No such file or directory
update [--with WITH] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--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] [--] [
I then decided to try the upgrade process as explained in carddav plugin doc:
- I removed the carddav plugin folder (rm -R plugins/carddav)
- I edited the composer.json from RC and modified:
I switched this line: "roundcube/carddav": "dev-master",
by this line: "roundcube/carddav": "^5.0.0",
- I executed the command `sudo -u www-data composer update --no-dev -o`
PHP Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony/Component/Console/Helper/HelperSet.php on line 103
Deprecated: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony/Component/Console/Helper/HelperSet.php on line 103
Deprecation Notice: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/share/php/JsonSchema/Constraints/Constraint.php:48
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Symfony\Component\Process\Process::getIterator($flags = 0) should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Symfony/Component/Process/Process.php:622
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\ArrayRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/ArrayRepository.php:277
Deprecation Notice: Return type of Composer\Repository\CompositeRepository::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/Repository/CompositeRepository.php:180
Loading composer repositories with package information
Deprecation Notice: Implicit conversion from float 204.57 to int loses precision in /usr/share/php/Composer/Platform/Version.php:100
Info from https://repo.packagist.org: #StandWithUkraine
Deprecation Notice: Return type of Composer\DependencyResolver\Pool::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Pool.php:76
Updating dependencies
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSet.php:116
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSet::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSet.php:101
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:155
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:165
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:160
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:170
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:150
Deprecation Notice: Return type of Composer\DependencyResolver\Decisions::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/Decisions.php:145
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSetIterator.php:36
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSetIterator.php:46
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSetIterator.php:41
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSetIterator.php:89
Deprecation Notice: Return type of Composer\DependencyResolver\RuleSetIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/share/php/Composer/DependencyResolver/RuleSetIterator.php:70
Lock file operations: 0 installs, 1 update, 0 removals
In autoload_real.php line 75:
require(/var/www/roundcube-test/vendor/composer/../symfony/polyfill-intl-normalizer/bootstrap.php): Failed to open stream: No such file or directory
At this point, I have my Rc updated but no more carddav plugin at all.
The Db tables for carddav didn't change at all.
Php version used is v8.1.18
Have you tried
If you get errors in the process (uninstalling roundcube plugins with composer can raise errors), run composer dump-autoload -o, and then composer update --no-dev -o
If this doesn’t help I have no further ideas and would suggest to first remove the plugin (keep the DB) and reinstall it. That is, remove it from composer json, delete the carddav directory (backup your config), run composer update and dump autoload commands to remove it from the composer database, and then install again with composer require command.
Big big thanks.
The command composer dump-autoload -o,
indeed fixed the problem.
After it, the command composer update --no-dev -o
installed the right version of the carddav plugin.
On first connexion to Roundcube, the carddav plugin updated without problem the DB and the addressbooks from our cloud were synchronised into Roundcube.. and that's amazing.
Thank you very much for all the help you gave me. It wouldn't have been possible to make it work without your help.
If I use in config.inc.php the option
I have this error:
I can see this function in
vendor/mstilkerich/carddavclient/src/AddressbookCollection.php
. But I don't know why it doens't have this public method getDisplayName() available.If I use '%c' (all except %N and %D) as substitute for the addressbook name, everything is working nicely.