Skip to content

Commit 5435055

Browse files
Merge pull request #63074 from nextcloud/backport/62795/stable33
[stable33] fix: improve logging when failing to get newly created user
2 parents 29986e4 + 7d87228 commit 5435055

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
@@ -445,7 +445,16 @@ public function createUserFromBackend($uid, $password, UserInterface $backend) {
445445
if ($state === false) {
446446
throw new \InvalidArgumentException($l->t('Could not create account'));
447447
}
448-
$user = $this->getUserObject($uid, $backend);
448+
try {
449+
$user = $this->getUserObject($uid, $backend);
450+
} catch (\RuntimeException $e) {
451+
$this->logger->error('Failed to get user after creation', [
452+
'exception' => $e,
453+
'uid' => $uid,
454+
'exists_backend' => $backend->userExists($uid),
455+
]);
456+
throw new \RuntimeException('Failed to get user after creation', previous: $e);
457+
}
449458
if ($user instanceof IUser) {
450459
/** @deprecated 21.0.0 use UserCreatedEvent event with the IEventDispatcher instead */
451460
$this->emit('\OC\User', 'postCreateUser', [$user, $password]);

0 commit comments

Comments
 (0)