krayin/laravel-crm · error · RuntimeException
Failed to refresh Google access token: {}
Error message
Failed to refresh Google access token: {} What it means
Error "Failed to refresh Google access token: {}" thrown in krayin/laravel-crm.
Source
Thrown at packages/Webkul/GoogleContact/src/Services/TokenRefresher.php:54
return $client;
}
/**
* Refresh and persist a new access token.
*
* Google frequently omits `refresh_token` on refresh responses, so the
* previously stored refresh token is only replaced when a new one is given.
*/
protected function refresh(Client $client, GoogleContactAccount $account): void
{
if (! $account->refresh_token) {
throw new RuntimeException('Google account has no refresh token; the user must reconnect their Google account.');
}
$token = $client->fetchAccessTokenWithRefreshToken($account->refresh_token);
if (isset($token['error'])) {
throw new RuntimeException('Failed to refresh Google access token: '.($token['error_description'] ?? $token['error']));
}
$this->googleContactAccountRepository->update([
'access_token' => $token['access_token'],
'refresh_token' => $token['refresh_token'] ?? $account->refresh_token,
'expires_at' => now()->addSeconds($token['expires_in'] ?? 3600),
], $account->id);
$client->setAccessToken($token);
}
}
View on GitHub (pinned to 13d6988cda)
When it happens
Trigger: Thrown at packages/Webkul/GoogleContact/src/Services/TokenRefresher.php:54 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of krayin/laravel-crm@13d6988cda (2026-08-17).
Data as JSON: /api/errors/a722cd8013d27b07.
Report an issue: GitHub.