Skip to content

Commit a8594aa

Browse files
Merge pull request #63075 from nextcloud/backport/62795/stable34
[stable34] fix: improve logging when failing to get newly created user
2 parents e4f1431 + ac3c9f8 commit a8594aa

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/private/User/Manager.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,16 @@ public function createUserFromBackend($uid, $password, UserInterface $backend):
456456
if ($state === false) {
457457
throw new \InvalidArgumentException($l->t('Could not create account'));
458458
}
459-
$user = $this->getUserObject($uid, $backend);
459+
try {
460+
$user = $this->getUserObject($uid, $backend);
461+
} catch (\RuntimeException $e) {
462+
$this->logger->error('Failed to get user after creation', [
463+
'exception' => $e,
464+
'uid' => $uid,
465+
'exists_backend' => $backend->userExists($uid),
466+
]);
467+
throw new \RuntimeException('Failed to get user after creation', previous: $e);
468+
}
460469
if ($user instanceof IUser) {
461470
/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
462471
$this->emit('\OC\User', 'postCreateUser', [$user, $password]);

0 commit comments

Comments
 (0)