[Solved] Mise à jour de Nextcloud 28.0.6 vers 30.0.8

What type of hardware are you using: Internet Cube with VPN
What YunoHost version are you running: YunoHost 12.0.12
What app is this about: Nextcloud

Describe your issue

Hi everyone,
I’m trying to upgrade Nextcloud 28.0.6 to 30.0.8 since a while.
I disabled some apps then di-installed some but for the moment, it fail with :

InvalidArgumentException: Index name "sa" for table "oc_social_3_stream_act" collides with the constraint on table "oc_social_stream_act".

I notice too that the process has to :

Clean up old calendar subscriptions from deleted users that were not cleaned-up

Here is the last log file :

Share relevant logs or error messages

https://paste.yunohost.org/raw/amoxuporim

Thanks a lot for your help !

Can you provide more info :

sudo yunohost app shell nextcloud 
php -v
php occ app:list
php occ db:add-missing-indices
php occ maintenance:repair --include-expensive

Thank you @jarod5001 for your response.

sudo yunohost app shell nextcloud

asks for a nextcloud password I don’t find. Where could I find it ?

Thank you

No, using sudo, asks for your password

Yes it is but after that,
I’ve got a prompt nextcloud@myname:~$
The command php -v returns

Error in argument 1, char 1: no argument for option -
I don’t understand why.

Ignore that step
It was to know what php version was your nextcloud using. You can get that running sudo yunohost app setting nextcloud php_version .
What’s the output of the rest of the commands?

The command return nothing ! It just come back to the prompt.

I really don’t understand.
:roll_eyes:

Let’s get the php version of nextcloud :

sudo grep php_version /etc/yunohost/app s/nextcloud/settings.yml

Now open nextcloud environment :
sudo yunohost app shell nextcloud

List nextcloud apps :
php8.3 occ app:list

Replace php8.3 with the correct php version (for example php8.2) in the previous command.

Hi @jarod5001,

sudo grep php_version /etc/yunohost/apps/nextcloud/settings.yml doesn’t answer anything, but /etc/yunohost/app s/nextcloud/settings.yml does exist !
php8.3 occ app:list give me the message :

An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

php8.2 occ app:list is more explicit :

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - audioplayer: 3.4.1
  - calendar: 4.7.16
  - circles: 28.0.0
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contacts: 5.5.3
  - contactsinteraction: 1.9.0
  - dav: 1.29.1
  - event_update_notification: 2.4.0
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_linkeditor: 1.1.22
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.11.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - support: 1.11.1
  - survey_client: 1.16.0
  - systemtags: 1.18.0
  - tasks: 0.16.1
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - user_ldap: 1.19.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - bruteforcesettings: 2.8.0
  - dashboard: 7.8.0 (installed 7.7.0)
  - deck: 1.12.7 (installed 1.12.7)
  - encryption: 2.16.0
  - suspicious_login: 6.0.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0 (installed 1.12.0)
  - weather_status: 1.8.0 (installed 1.7.0)

php 8.3 seems not to be used by Nextcloud.

At some point you had the social app in nextcloud.
There is an issue here describing how to fix it : Upgrade to NC28 yields "Exception: Database error when running migration…" · Issue #1871 · nextcloud/social · GitHub

You have to drop some tables in the nextcloud db.

I installed phpMyAdmin to look at The db.

I see oc_social_action or oc_social_follow and oc_social_stream_act, _dest or _tag

Do I have to clic on drop button ?

I don’t know what index aot or aoa or sa, etc mean.

I wonder if I were not too far aways from my skills !
:zany_face:

How could I know which indexes are relevant to the social things?

Is the “drop” process reversible (I have exported the nextcloud db with phpMyAdmin to have a backup) ?

Since you have a backup, you can use command line :

mysql
USE nextcloud;

Wait a bit then paste the drop sequence above. Then retry the upgrade

Thank you @jarod5001 for your help.
I’m not sure to understand the way follow your advice.
I can connect to my server through the command line and then
1- how to use mysql commands ?
2- I don’t know how to do the drop sequence

I installed PhpMyAdmin. Is there a way through it to do what I have to ?

Thanks !
Noob Noob !

Oh, it’s been a while.

Let’s retry

sudo yunohost app shell nextcloud 
php8.2 occ db:add-missing-indices
php8.2 occ maintenance:repair --include-expensive

Hello @jarod5001 ,

The 3 command lines were ok.

Then I tried to upgrade and failed with :

InvalidArgumentException: Index name "object_id_prim" for table "oc_social_3_stream" collides with the constraint on table "oc_social_stream".

So, I think I’ve to drop the indexes as it is said on Upgrade to NC28 yields "Exception: Database error when running migration…" · Issue #1871 · nextcloud/social · GitHub

Do I have to have command like this :
nextcloud@MyUSER:~$ drop index aot on oc_social_action;
Of course the command is not found.

So I tried through PhpMyAdmin to find oc_social_stream and discover i didn’t drop it last time.
And now the update seems to be a success !

Thank you one more time @jarod5001, It solved my issue.

:ok_hand: :smiley:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.