PHP Deprecated, j’y vais pour faire la màj, ou pas?

Hello,

Je cherchais à mettre à jour mon instance de Nextcloud, et j’ai ça :

$ php updater.phar

PHP Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/blablabla/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 12

Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/blablabla/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 12

PHP Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/blablabla/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 16

Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/blablabla/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 16

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 phar:///home/clients/blablabla/sites/nextcloud/updater/updater.phar/vendor/symfony/console/Helper/HelperSet.php on line 111

Nextcloud Updater - version: v24.0.0beta3-1-g67bf13b dirty

Current version is 24.0.9.

Update to Nextcloud 25.0.3 available. (channel: "stable")

Following file will be downloaded automatically: [https://download.nextcloud.com/.../nextcloud-25.0.3.zip](https://download.nextcloud.com/server/releases/nextcloud-25.0.3.zip?fbclid=IwAR1bMzm80U-cHny21QYjOrfeJb3spScMJ5LvJaxhxqb6CPJ_OJ1xw4VQx5c)

Open changelog

Je suis en PHP 8.1, je suis repassé en 8.0 (car j’ai vu que c’était la version recommandée pour la 24.x), et j’ai même essayé de passer provisoirement en 7.4, mais j’ai le même genre d’ « erreur Deprecated ».

Que faire ? Je ne voudrais pas planter mon instance en faisant la màj de trop, enfin trop précipitamment.

Merci.

Bonjour @neccloud, qu’elle était la version de base de php au début ?

Hello. Je crois bien que j’étais en version 8 avant la tentative de màj. Mais quand j’ai installé Nextcloud, j’étais en 7.4 il me semble bien.

Je n’avais pas vu ton message avant l’update que j’ai tout de même fait vers la dernière de la branche 24, pensant que ça allait corriger le problème (enfin je ne sais pas si c’est un problème, c’est à dire que ce n’est pas précisé si c’est juste des warnings ou des erreurs).

Alors voilà ce que j’ai avec PHP 8.0 :

$ php updater.phar
PHP Deprecated:  Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/monuser/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 12

Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/monuser/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 12
PHP Deprecated:  Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/monuser/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 16

Deprecated: Return type of HumbugBox3111\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/clients/monuser/sites/nextcloud/updater/updater.phar/.box/src/RequirementCollection.php on line 16
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 phar:///home/clients/monuser/sites/nextcloud/updater/updater.phar/vendor/symfony/console/Helper/HelperSet.php on line 111
Nextcloud Updater - version: v24.0.0beta3-1-g67bf13b dirty

Current version is 24.0.10.

Update to Nextcloud 25.0.4 available. (channel: "stable")

@neccloud essayer cette commande : sudo -u www-data php -v pour etre sur que nextcloud utilise bien la bonne version modifier (www-data si l’utilisateur linux ayant accès au dossier nextcloud est différent)

Avez vous vérifier que les autres php ( que nextcloud a besoin) sont aussi mis à jour ?

Avez vous regarder les logs de nextcloud ??

Alors c’est un hébergement mutualisé chez Infomaniak, donc je n’ai pas accès à sudo (il me demande le mot de passe de sudo). En fait, je suis chrooté dans ma home avec mon nom de client en login, et dans un environnement multi-php.

J’ai d’autres sites sur cet hébergement encore en PHP 7.4, je ne sais pas si ça joue.

En CLI, j’ai ça :

$ php -v
PHP 8.1.14 (cli) (built: Jan 31 2023 08:03:51) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.14, Copyright (c) Zend Technologies

@neccloud regardez avec votre compte admin de votre nextcloud dans paramètre admin > système, si la version de php est bien la bonne

Alors dans /index.php/settings/admin/serverinfo j’ai ça :
Version: 8.0.27

@neccloud ok, donc on sait pas réellement ce qui bloque …

avez vous essayez de faire la mise à jour avec la page web de nextcloud ?

Non, je ne l’ai jamais fait.

C’est bien de ce bouton dont vous parlez ?
2023-02-25_15-30-39

@neccloud Oui

La màj semblait bien se passer, et lors de la réparation, j’ai ça par l’interface graphique : Erreur de réparation : An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1833 Cannot change column 'id': used in a foreign key constraint 'FK_1C85E16C3C947C0F' of table '8n37i_clouder.oc_polls_share'

Ok, il y avait un lien tous en bas des logs détaillés : Cliquez pour rechargez la page.
J’ai cliqué, et Nexcloud est réapparu dans mon interface web.

Par contre, je pense que je dois régler quelque chose en ligne de commande, non ? Virer le module de vote, quitte à le réinstaller ?

Merci de ton avis.

Ok, alors j’ai désactivé Polls, et je l’ai désinstallée. À voir si je dois la réinstaller dans un futur, car j’ai noté que cette application est un peu problématique sur mon instance : Problem to update Nextcloud 20.x (poll module do errors) - #2 by JimmyKater

Merci à toi, et bon week-end.

1 Like

@neccloud, peut être que le problème peut être résolu via ligne de commande notamment avec les commandes occ. Si vous êtes intéressé dites le moi. Bon week end !

Je ne suis pas sur que ça aidera, le message d’erreur indique un problème dans la base de données or la désinstallation de l’app ne surprime pas les données de cette application dans la base de données

Ah zut, je pensais régler ça de cette manière.

Ce problème est apparu spontanément, sans que je ne ne fasse rien de spécial sur mon occurrence Nextcloud. C’est donc cette apps qui met le bazar… Je vais ouvrir un ticket, si je peux trouver plus d’aide de ce côté.

Oui je suis intéressé. Merci de votre aide.

@neccloud réinstaller l’application et dans un terminal faites cette commande :

sudo -u www-data php /.../nextcloud/occ maintenance:repair ( modifier les par le chemin de votre dossier nextcloud

si ça ne fonctionne pas ou une erreur est toujours présente concerant l’apps, essayé ceci :
sudo -u www-data php /.../nextcloud/occ polls:db:rebuild ( en modifiant les …)

@Mageunic
Oh my gosh, je crois que tout est ok à présent !

$ php occ maintenance:repair
 - Repair MySQL collation
     - All tables already have the correct collation -> nothing to do
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Repair invalid shares
 - Move .step file of updater to backup location
 - Add move avatar background job
     - Repair step already executed
 - Add preview cleanup background jobs
 - Migrate oauth2_clients table to nextcloud schema
     - Update the oauth2_access_tokens table schema.
     - Update the oauth2_clients table schema.
 - Fix potential broken mount points
     - No mounts updated
 - Repair language codes
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - JS cache cleared
 - Clear every generated avatar on major updates
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Cleanup invalid photocache files for carddav
 - Add background job to cleanup login flow v2 tokens
 - Remove potentially over exposing share links
     - No need to remove link shares.
 - Clear access cache of projects
 - Reset generated avatar flag
 - Keep legacy encryption enabled
 - Check encryption key format
 - Remove old dashboard app config data
 - Add job to cleanup the bruteforce entries
 - Queue a one-time job to check for user uploaded certificates
 - Repair DAV shares
 - Add background job to set the lookup server share state for users
 - Add token cleanup job
 - Clean up abandoned apps
 - Add possibly missing system config
 - Add read permissions for existing announcements
    0 [->--------------------------]
 - Migrate user theme settings
 - Fix component of birthday calendars
     - 5 birthday calendars updated.
 - Regenerating birthday calendars to use new icons and fix old birthday events without year
     - Repair step already executed
 - Fix broken values of calendar objects
    0 [----->----------------------]
 - Registering building of calendar search index as background job
     - Repair step already executed
 - Register building of social profile search index as background job
 - Registering background jobs to update cache for webcal calendars
     - Added 0 background jobs to update webcal calendars
 - Registering building of calendar reminder index as background job
     - Repair step already executed
 - Clean up orphan event and contact data
     - 0 events without a calendar have been cleaned up
     - 0 properties without an events have been cleaned up
     - 0 changes without a calendar have been cleaned up
     - 0 cached events without a calendar subscription have been cleaned up
     - 0 changes without a calendar subscription have been cleaned up
     - 0 contacts without an addressbook have been cleaned up
     - 0 properties without a contact have been cleaned up
     - 0 changes without an addressbook have been cleaned up
 - Remove activity entries of private events
     - Removed 0 activity entries
 - Clean up old calendar subscriptions from deleted users that were not cleaned-up
    0 [--------->------------------]
     - 0 calendar subscriptions without an user have been cleaned up
 - Remove invalid object properties
     - 0 invalid object properties removed.
 - Fix the share type of guest shares when migrating from ownCloud
 - Copy the share password into the dedicated column
 - Set existing shares as accepted
 - Update OAuth token expiration times
 - Polls - Create indices and foreign key constraints
     - Polls - Foreign key contraints created.
     - Polls - Indices created.
 - Create help command
 - Invalidate access cache for projects conversation provider
     - Invalidation not required
 - Cache the user display names
 - Switches from default updater server to the customer one if a valid subscription is available
     - Repair step already executed
 - Send an admin notification if monthly report is disabled
 - Initialize migration of background images from dashboard to theming app
 - Add background job to check for backup codes
 - Populating added database structures for workflows

Vous confirmez ?

Merci à vous, et votre patience.

1 Like