Open skid9000 opened 1 year ago
Is this bug present after an update or on a fresh install?
I never tried to enable user_ldap before so i can't tell if this bug existed in a previous major update, sorry :/
Ok but this isn't a fresh install, right? Just to understand if this is a migration error or a codebase error.
Yes, this isn't a fresh install.
Thanks. Just to complete the report, please execute :
./occ db:add-missing-indices
./occ db:add-missing-columns
./occ db:add-missing-primary-keys
And report back please if this helps.
Thanks, but it dosen't seem to work :/
nextcloud@nextcloud ~/live ./occ db:add-missing-indices
./occ db:add-missing-columns
./occ db:add-missing-primary-keys
Check indices of the share table.
Check indices of the filecache table.
Check indices of the twofactor_providers table.
Check indices of the login_flow_v2 table.
Check indices of the whats_new table.
Check indices of the cards table.
Check indices of the cards_properties table.
Check indices of the calendarobjects_props table.
Check indices of the schedulingobjects table.
Check indices of the oc_properties table.
Check indices of the oc_jobs table.
Check indices of the oc_direct_edit table.
Check indices of the oc_preferences table.
Check indices of the oc_mounts table.
Done.
Check columns of the comments table.
Done.
Check primary keys.
Done.
nextcloud@nextcloud ~/live ./occ app:enable user_ldap
An exception occurred while executing a query: SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist
I have the same issue, also on an existing install. This is an old instance that I've been upgrading ever since the owncloud days, so it's been through a fair amount of migrations and updates. I tried running the various db:add-missing commands to no effect.
Can you provide the output of:
NC_debug=1 ./occ migrations:status user_ldap
Though this almost looks like it's coming from the app management not user_ldap
migrations itself.
Sorry about the late reply, busy days. This is the output I get.
jarl@nextcloud1:/var/www/nextcloud$ sudo -u www-data NC_debug=1 ./occ migrations:status user_ldap
In MigrationService.php line 498:
Migration step 'OCA\User_LDAP\Migration\Version1010Date20200630192842' is unknown
migrations:status <app>
I can enable other apps just fine.
I think the most unusual thing about this instance is that it's been continuously upgraded, migrated, and moved all the way from the ownCloud days, though I can't recall if I've wiped and recreated the database at any point during these years. I believe I did so when transitioning from ownCloud to Nextcloud, but I don't know for sure.
Intriguing. It'll be interesting to see if the OP (@skid9000) gets something similar.
What's the contents of your apps/user_ldap/lib/Migration
folder?
Something is causing some of the classes to not load for both of you.
Version1010Date2020630192842.php
should be this (hopefully): https://github.com/nextcloud/server/blob/stable25/apps/user_ldap/lib/Migration/Version1010Date20200630192842.phpnextcloud
user and www-data
group.Version1010Date2020630192842.php
it's identical.
Yep, same here - contents are identical, and this is the folder listing:
jarl@nextcloud1:/var/www/nextcloud$ sudo -u www-data ls -la apps/user_ldap/lib/Migration
total 139
drwxr-xr-x 2 www-data www-data 17 Sep 9 16:16 .
drwxr-xr-x 16 www-data www-data 42 Sep 9 16:16 ..
-rw-r--r-- 1 www-data www-data 2105 Sep 9 16:16 GroupMappingMigration.php
-rw-r--r-- 1 www-data www-data 1879 Sep 9 16:16 RemoveRefreshTime.php
-rw-r--r-- 1 www-data www-data 1650 Sep 9 16:16 SetDefaultProvider.php
-rw-r--r-- 1 www-data www-data 1525 Sep 9 16:16 UnsetDefaultProvider.php
-rw-r--r-- 1 www-data www-data 1146 Sep 9 16:16 UUIDFixGroup.php
-rw-r--r-- 1 www-data www-data 2948 Sep 9 16:16 UUIDFixInsert.php
-rw-r--r-- 1 www-data www-data 1676 Sep 9 16:16 UUIDFix.php
-rw-r--r-- 1 www-data www-data 1141 Sep 9 16:16 UUIDFixUser.php
-rw-r--r-- 1 www-data www-data 3447 Sep 9 16:16 Version1010Date20200630192842.php
-rw-r--r-- 1 www-data www-data 4838 Sep 9 16:16 Version1120Date20210917155206.php
-rw-r--r-- 1 www-data www-data 9114 Sep 9 16:16 Version1130Date20211102154716.php
-rw-r--r-- 1 www-data www-data 2263 Sep 9 16:16 Version1130Date20220110154717.php
-rw-r--r-- 1 www-data www-data 2928 Sep 9 16:16 Version1130Date20220110154718.php
-rw-r--r-- 1 www-data www-data 1679 Sep 9 16:16 Version1130Date20220110154719.php
-rw-r--r-- 1 www-data www-data 3402 Sep 9 16:16 Version1141Date20220323143801.php
Oh, there is one unusual thing about my setup that I forgot to mention - the entire installation directory is on an NFS share, with the data directory stored separately.
jarl@nextcloud1:~$ mount
[...]
192.168.0.25:/mnt/bones-primary/nextcloud on /mnt/nextcloud type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.70,local_lock=none,addr=192.168.0.25,_netdev)
192.168.0.25:/mnt/bones-primary/sites/jarl/nextcloud on /var/www/nextcloud type nfs4 (rw,relatime,sync,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.70,local_lock=none,addr=192.168.0.25,_netdev)
[...]
Everything is stored locally on my side, so i doubt NFS is the problem here.
Unfortunately, in hindsight, you're both getting the Migration step ... is unknown
error simply due to the user_ldap
app never fully getting enabled (due to the original An exception occurred while executing a query: SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist
error). So, unfortunately, the inability to check the db migration status is a red herring.
I think I'm getting closer to the real culprit in any case: doctrine/dbal#2925 and is similar to #30539. It was addressed in #30568 though.
I'm currently stumped regarding why you two are impacted still.
@Nihlus Are you running PostgreSQL as well?
Since i made this issue i'm now running PostgreSQL 15.4 and NC 27.0.2 (w/php 8.2), i don't know if that information could help you out.
(Back then i was running PostgreSQL 14 and NC 25.0.4.1 (w/php 8.1) iirc)
@joshtrichards Yep, running Postgres 14.7-1.pgdg110+1. My PHP version is 7.4.
It's odd that there is an empty version string for your user_ldap
app installation. It should contain what is in user_ldap/appinfo/info.xml
:
Disabled:
- bruteforcesettings: 2.3.0
- federation: 1.3.0
- files_versions: 1.16.0
- firstrunwizard: 2.2.1
- gpxedit: 0.0.14
- gpxpod: 5.0.4
- keeweb: 0.6.10
- sharebymail: 1.3.0
- survey_client: 1.1.0
- suspicious_login
- user_ldap
Any chance you at one point ran an Release Candidate (RC) [particularly 23.0.1RC1, 22.2.4RC1] against this installation?
Any chance you at one point ran an Release Candidate (RC) [particularly 23.0.1RC1, 22.2.4RC1] against this installation?
I don't think so, i always stayed on stable branch and updated through the nextcloud updater, so my instance should never have seen any RC version.
⚠️ This issue respects the following points: ⚠️
Bug description
I'm unable to enable the user_ldap app, resulting with the following error :
An exception occurred while executing a query: SQLSTATE[42704]: Undefined object: 7 ERROR: index "primary" does not exist
Steps to reproduce
Expected behavior
The app should enable.
Installation method
Community Manual installation with Archive
Operating system
Other
PHP engine version
PHP 8.1
Web server
Nginx
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response