- Issue created by @joachim
- Status changed to Fixed
almost 2 years ago 11:50am 15 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.
If the Zendesk library throws an exception, this gets caught and re-thrown by the user entity storage, as seen when reproducing the problem in this issue 🐛 Zendesk user sync not working for existing zendesk users when drupal email has capitals Closed: duplicate .
Drupal\Core\Entity\EntityStorageException: Client error: `POST https://d3v-joachim.zendesk.com/api/v2/users.json` resulted in a `422 Unprocessable Entity` response: {"error":"RecordInvalid","description":"Record validation errors","details":{"email":[{"description":"Email: capitals@he (truncated...) [details] {"error":"RecordInvalid","description":"Record validation errors","details":{"email":[{"description":"Email: capitals@here.com is already being used by another user","error":"DuplicateValue"}]}} in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object) (Line: 204)
GuzzleHttp\Promise\Promise::callHandler(1, Object, NULL) (Line: 153)
GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() (Line: 48)
GuzzleHttp\Promise\TaskQueue->run(1) (Line: 248)
GuzzleHttp\Promise\Promise->invokeWaitFn() (Line: 224)
GuzzleHttp\Promise\Promise->waitIfPending() (Line: 269)
GuzzleHttp\Promise\Promise->invokeWaitList() (Line: 226)
GuzzleHttp\Promise\Promise->waitIfPending() (Line: 62)
GuzzleHttp\Promise\Promise->wait() (Line: 129)
GuzzleHttp\Client->send(Object, Array) (Line: 92)
Zendesk\API\Http::send(Object, 'users.json', Array) (Line: 494)
Zendesk\API\HttpClient->post('users.json', Array) (Line: 32)
Zendesk\API\Resources\Core\Users->create(Array) (Line: 110)
Drupal\zendesk_users\ZendeskUsers->createUser(Object) (Line: 61)
Exceptions should be caught and logged.
Fixed
3.0
Code
Automatically closed - issue fixed for 2 weeks with no activity.