## Summary
Closes elastic#217154
Improvements to sync integrations status API and error reporting
- Saving custom asset update errors to the package SO in
`latest_custom_asset_install_failed_attempts` field
- Reading these errors in the status API and UI
- Fix sync status calculation: show `FAILED` if one of integrations or
custom assets are in failed state, `SYNCHRONIZING` if one of
integrations or custom assets are in synchronizing state, otherwise show
`COMPLETED` state.
<img width="608" alt="image"
src="https://github.com/user-attachments/assets/15a17690-443b-4ca1-b705-cc92ec7d3b20"
/>
- Reading the `followStats` API to report on fatal errors, found that
the `followInfo` API doesn't report if the connection to the remote
cluster fails. Reproduced this by updating an active Remote Cluster with
an invalid port. The `followInfo` API still reports `active` status.
<img width="612" alt="image"
src="https://github.com/user-attachments/assets/e95ebc62-4ed9-42c2-9954-93d9438b6ece"
/>
```
GET fleet-synced-integrations-ccr-main/_ccr/stats
{
"indices": [
{
"index": "fleet-synced-integrations-ccr-main",
"shards": [
{
"remote_cluster": "main",
"leader_index": "fleet-synced-integrations",
"follower_index": "fleet-synced-integrations-ccr-main",
...
"fatal_exception": {
"type": "exception",
"reason": "java.lang.IllegalArgumentException: port out of range:93001",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "port out of range:93001"
}
}
}
]
}
]
}
```
### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Summary
Closes #217154
Improvements to sync integrations status API and error reporting
Saving custom asset update errors to the package SO in
latest_custom_asset_install_failed_attemptsfieldReading these errors in the status API and UI
Fix sync status calculation: show
FAILEDif one of integrations or custom assets are in failed state,SYNCHRONIZINGif one of integrations or custom assets are in synchronizing state, otherwise showCOMPLETEDstate.followStatsAPI to report on fatal errors, found that thefollowInfoAPI doesn't report if the connection to the remote cluster fails. Reproduced this by updating an active Remote Cluster with an invalid port. ThefollowInfoAPI still reportsactivestatus.Checklist