Skip to content

Commit afcf606

Browse files
committed
fix: improve logging when failing to get newly created user
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent ffb0564 commit afcf606

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
@@ -454,7 +454,16 @@ public function createUserFromBackend($uid, $password, UserInterface $backend):
454454
if ($state === false) {
455455
throw new \InvalidArgumentException($l->t('Could not create account'));
456456
}
457-
$user = $this->getUserObject($uid, $backend);
457+
try {
458+
$user = $this->getUserObject($uid, $backend);
459+
} catch (\RuntimeException $e) {
460+
$this->logger->error('Failed to get user after creation', [
461+
'exception' => $e,
462+
'uid' => $uid,
463+
'exists_backend' => $backend->userExists($uid),
464+
]);
465+
throw new \RuntimeException('Failed to get user after creation', previous: $e);
466+
}
458467
if ($user instanceof IUser) {
459468
/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
460469
$this->emit('\OC\User', 'postCreateUser', [$user, $password]);

0 commit comments

Comments
 (0)