Skip to content

Conversation

@butonic
Copy link
Member

@butonic butonic commented Jun 10, 2016

This will prevent upgrade experiences like this:

I tried to prepare our next upgrade from 8.2.5 to 9.0.2. The occ-script 
is throwing an error: 

[root@owncloud owncloud_9.0.2]# php55 occ -vvv upgrade 
--skip-migration-test 
ownCloud or one of the apps require upgrade - only a limited number of 
commands are available 
You may use your browser or the occ upgrade command to do the upgrade 
2016-06-06T11:20:43+02:00 Set log level to debug 
2016-06-06T11:20:43+02:00 Turned on maintenance mode 
2016-06-06T11:20:43+02:00 Repair step: Repair MySQL database engine 
2016-06-06T11:20:43+02:00 Repair step: Repair MySQL collation 
2016-06-06T11:20:43+02:00 Repair step: Repair SQLite autoincrement 
2016-06-06T11:20:43+02:00 Repair step: Repair duplicate entries in 
oc_lucene_status 
2016-06-06T11:20:43+02:00 Repair info: lucene_status table does not 
exist -> nothing to do 
2016-06-06T11:20:43+02:00 Updating database schema 
2016-06-06T11:20:44+02:00 Updated database 
2016-06-06T11:20:44+02:00 Disabled 3rd-party app: files_videoviewer 
2016-06-06T11:20:44+02:00 Disabled 3rd-party app: updater 
2016-06-06T11:20:44+02:00 Updating <files_pdfviewer> ... 
2016-06-06T11:20:44+02:00 Updated <files_pdfviewer> to 0.8.1 
2016-06-06T11:20:44+02:00 Updating <files_texteditor> ... 
2016-06-06T11:20:44+02:00 Updated <files_texteditor> to 2.1 
2016-06-06T11:20:44+02:00 Updating <gallery> ... 
2016-06-06T11:20:44+02:00 Updated <gallery> to 14.5.0 
2016-06-06T11:20:44+02:00 Updating <user_ldap> ... 
2016-06-06T11:20:44+02:00 Updated <user_ldap> to 0.8.0 
2016-06-06T11:20:44+02:00 Updating <files> ... 
2016-06-06T11:20:44+02:00 Updated <files> to 1.4.4 
2016-06-06T11:20:44+02:00 Updating <activity> ... 
2016-06-06T11:20:44+02:00 Updated <activity> to 2.2.1 
2016-06-06T11:20:44+02:00 Updating <files_sharing> ... 
2016-06-06T11:20:44+02:00 Updated <files_sharing> to 0.9.1 
2016-06-06T11:20:44+02:00 Updating <files_trashbin> ... 
2016-06-06T11:20:44+02:00 Updated <files_trashbin> to 0.8.0 
2016-06-06T11:20:44+02:00 Updating <files_versions> ... 
2016-06-06T11:20:44+02:00 Updated <files_versions> to 1.2.0 
2016-06-06T11:20:44+02:00 Updating <firewall> ... 
2016-06-06T11:20:44+02:00 Updated <firewall> to 2.3.0 
2016-06-06T11:20:44+02:00 Updating <notifications> ... 
2016-06-06T11:20:44+02:00 Updated <notifications> to 0.2.3 
2016-06-06T11:20:44+02:00 Updating <provisioning_api> ... 
2016-06-06T11:20:44+02:00 Updated <provisioning_api> to 0.4.1 
2016-06-06T11:20:44+02:00 Updating <admin_audit> ... 
2016-06-06T11:20:44+02:00 Updated <admin_audit> to 0.7 
PHP Fatal error: Call to a member function processAttributes() on a 
non-object in 
/var/www/html/owncloud_9.0.2/apps/user_ldap/lib/access.php 
on line 733 
[root@owncloud owncloud_9.0.2]# 

Leaves the qestion why do we get null from the ldap user manager ...

00005599

@DeepDiver1975 DeepDiver1975 added this to the 9.1-current milestone Jun 10, 2016
@PVince81
Copy link
Contributor

@butonic can you rerun it on the failed environment ? For which user did it return null ? Maybe it was a disabled/obsoleted/stray user ?

@butonic
Copy link
Member Author

butonic commented Jun 10, 2016

It is a test environment. Will see what we can find out...

@PVince81
Copy link
Contributor

PVince81 commented Jun 10, 2016

So far I'm worried that we might be skipping legitimate users. But if those are broken/deleted users then your PR would be fine.

@PVince81
Copy link
Contributor

@owncloud/ldap

@michaelstingl
Copy link

@butonic A user applied the patch and provided feedback: 00005599

@butonic
Copy link
Member Author

butonic commented Jun 13, 2016

with the new patch the update completes fine. asked them to classify the users that are logged with this PR

@PVince81
Copy link
Contributor

@michaelstingl mind posting the (anonymized) feedback here, if possible ?

@michaelstingl
Copy link

@PVince81 As @butonic described, after he patched the patch, the upgrade worked fine.

@michaelstingl
Copy link

@butonic I've got the log from the latest upgrade:
s3.owncloud.com_owncloud/Shared/owncloud/support/github-issues/core/25062/owncloud.log.zip

Could you check for disabled/obsoleted/stray users?

@PVince81
Copy link
Contributor

This PR could also help with #24733 (non-update case)

@DeepDiver1975 DeepDiver1975 force-pushed the fix-npe-in-user-ldap branch from 9c30d24 to 5134286 Compare June 21, 2016 09:12
@DeepDiver1975
Copy link
Member

squashed and rebased

@DeepDiver1975
Copy link
Member

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returned

@PVince81
Copy link
Contributor

👍 I agree to merge. Better be more robust here and log errors in case they can help debugging.

@DeepDiver1975 DeepDiver1975 merged commit 704a993 into master Jun 21, 2016
@DeepDiver1975 DeepDiver1975 deleted the fix-npe-in-user-ldap branch June 21, 2016 14:30
@michaelstingl
Copy link

Could you check for disabled/obsoleted/stray users?

@butonic Have you seen something in their logs that needs to be fixed on their side?

@butonic
Copy link
Member Author

butonic commented Jun 29, 2016

The log shows 144 occurrences where the ldap user manager returns null for a userid. @michaelstingl can they try to check if the uids exist in the oc_ldap_user_mapping table in the owncloud_name column, eg:

SELECT * FROM oc_ldap_user_mapping WHERE owncloud_name IN ('foo@bar.com', 'baz@bar.com', ...)

@butonic
Copy link
Member Author

butonic commented Jun 29, 2016

Other than this I see a lot of

{"reqId":"o\/lf1DbXqp3ThGA8Ont3",
"remoteAddr":"",
"app":"no app in context",
"message":"
Exception: {\"Exception\":\"InvalidArgumentException\",
\"Message\":\"Card does not exists: LDAP:foo@bar.com.vcf\",
\"Code\":0,
\"Trace\":\"#0 /var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/carddavbackend.php(884): OCA\DAV\CardDAV\CardDavBackend->getCardId('5', 'LDAP:foo@bar...')
#1 /var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/carddavbackend.php(499): OCA\DAV\CardDAV\CardDavBackend->updateProperties('5', 'LDAP:foo@bar...', 'BEGIN:VCARD\r\\nVE...')
#2 /var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/syncservice.php(225): OCA\DAV\CardDAV\CardDavBackend->createCard('5', 'LDAP:foo@bar...', 'BEGIN:VCARD\r\\nVE...')
#3 /var/www/html/owncloud_9.0.2/apps/dav/lib/hookmanager.php(99): OCA\DAV\CardDAV\SyncService->updateUser(Object(OC\User\User))
#4 [internal function]: OCA\DAV\HookManager->changeUser(Array)
#5 /var/www/html/owncloud_9.0.2/lib/private/hook.php(105): call_user_func(Array, Array)
#6 /var/www/html/owncloud_9.0.2/lib/private/server.php(244): OC_Hook::emit('OC_User', 'changeUser', Array)
#7 [internal function]: OC\Server->OC\{closure}(Object(OC\User\User), 'quota', '30 GB')
#8 /var/www/html/owncloud_9.0.2/lib/private/hooks/emittertrait.php(98): call_user_func_array(Object(Closure), Array)
#9 /var/www/html/owncloud_9.0.2/lib/private/hooks/publicemitter.php(32): OC\Hooks\BasicEmitter->emit('\\OC\\User', 'changeUser', Array)
#10 /var/www/html/owncloud_9.0.2/lib/private/user/user.php(417): OC\Hooks\PublicEmitter->emit('\\OC\\User', 'changeUser', Array)
#11 /var/www/html/owncloud_9.0.2/lib/private/user/user.php(364): OC\User\User->triggerChange('quota', '30 GB')
#12 /var/www/html/owncloud_9.0.2/apps/user_ldap/lib/user/user.php(465): OC\User\User->setQuota('30 GB')
#13 /var/www/html/owncloud_9.0.2/apps/user_ldap/lib/user/user.php(160): OCA\user_ldap\lib\user\User->updateQuota('30 GB')
#14 /var/www/html/owncloud_9.0.2/apps/user_ldap/lib/access.php(734): OCA\user_ldap\lib\user\User->processAttributes(Array)
#15 /var/www/html/owncloud_9.0.2/apps/user_ldap/lib/access.php(706): OCA\user_ldap\lib\Access->batchApplyUserAttributes(Array)
#16 /var/www/html/owncloud_9.0.2/apps/user_ldap/user_ldap.php(192): OCA\user_ldap\lib\Access->fetchListOfUsers('(&(|(objectclas...', Array, 500, 500)
#17 /var/www/html/owncloud_9.0.2/lib/private/user/manager.php(337): OCA\user_ldap\USER_LDAP->getUsers('', 500, 500)
#18 /var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/syncservice.php(269): OC\User\Manager->callForAllUsers(Object(Closure))
#19 /var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/syncjob.php(38): OCA\DAV\CardDAV\SyncService->syncInstance()
#20 /var/www/html/owncloud_9.0.2/lib/private/backgroundjob/job.php(52): OCA\DAV\CardDAV\SyncJob->run(NULL)
#21 /var/www/html/owncloud_9.0.2/lib/private/backgroundjob/timedjob.php(53): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#22 /var/www/html/owncloud_9.0.2/cron.php(145): OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#23 {main}\",\"File\":\"/var/www/html/owncloud_9.0.2/apps/dav/lib/carddav/carddavbackend.php\",
\"Line\":961}",
"level":3,
"time":"2016-06-13T12:04:17+00:00",
"method":"--",
"url":"--",
"user":"--"}

@DeepDiver1975 this happens during the migration ... critical or can be ignored?

@butonic
Copy link
Member Author

butonic commented Jun 29, 2016

also:

{"reqId":"...","remoteAddr":"128.176.190.117","app":"PHP","message":"hash_file(\/var\/www\/html\/owncloud_9.0.2\/apps\/user_ldap\/lib\/access.php.orig): failed to open stream: Permission denied at \/var\/www\/html\/owncloud_9.0.2\/lib\/private\/integritycheck\/checker.php#224","level":3,"time":"2016-06-13T12:01:24+00:00","method":"GET","url":"\/settings\/integrity\/rescan?requesttoken=...","user":"adminUser"}

indicates a patched 9.0.2 was used. the error will go away with 9.0.3.

@DeepDiver1975
Copy link
Member

@DeepDiver1975 this happens during the migration ... critical or can be ignored?

worth a look - I'll take care

@DeepDiver1975
Copy link
Member

@butonic @michaelstingl which dbms is used there?

@butonic
Copy link
Member Author

butonic commented Jun 29, 2016

@DeepDiver1975 they use a galera cluster

@DeepDiver1975
Copy link
Member

@DeepDiver1975 they use a galera cluster

hmmm .... this might explain why the card cannot be selected from the db after insert?

@michaelstingl
Copy link

michaelstingl commented Jun 30, 2016

@butonic @DeepDiver1975 Here is a investigation about the LDAP users that caused the trouble:
/Shared/owncloud/support/github-issues/core/25062/ldap-user-investigation.txt

This shows nothing unexpected.

What next?

@butonic
Copy link
Member Author

butonic commented Jul 1, 2016

@michaelstingl do we have the results of #25062 (comment)

@michaelstingl
Copy link

@butonic No, but I will ask…

@michaelstingl
Copy link

michaelstingl commented Jul 1, 2016

@michaelstingl do we have the results of #25062 (comment)

Here is the output:
Shared/owncloud/support/github-issues/core/25062/oc_ldap_user_mapping.txt

I think, this all looks good. Doesn't it?

@butonic
Copy link
Member Author

butonic commented Jul 1, 2016

The mappings are all there ... looks fine.

@lock
Copy link

lock bot commented Aug 5, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants