SourcesFetchFailedPayload sources.fetch.failed@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- sources
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-017
- Schema
https://openvibe.network/contracts/events/payloads/sources.fetch.failed.v1.json
sources.fetch.failed v1 (OpenVibe.Sources server/ingest.js failedEvent). One endpoint fetch of a source failed and counts as a failure: robots denied or unreachable, an HTTP error, the site's 429, a parse error or an internal error. Not sent for 304, a disabled source, a missing credential or the local rate limit. No item is created or changed. Envelope: subject { type: source, id: <source_key> }, visibility internal, priority important, actor service:sources.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
source_key | string | yes |
| |
category | enum | yes |
| |
run_id | string | yes | The recorded fetch run (GET /api/v1/sources/:key/runs). |
|
endpoint_url | string | yes |
| |
state | enum | yes |
| |
error_code | string | yes | robots | address_refused | port_refused | bad_url | upstream_429 | http_<status> | unreadable | adapter_error | internal. |
|
http_status | integer | null | yes |
| |
consecutive_failures | integer | yes | The source's consecutive failed runs including this one. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: http-503
{
"source_key": "bbc-world",
"category": "news",
"run_id": "frn_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"endpoint_url": "https://feeds.bbci.co.uk/news/world/rss.xml",
"state": "http_error",
"error_code": "http_503",
"http_status": 503,
"consecutive_failures": 2
}Valid: robots-denied
{
"source_key": "shop-sitemap",
"category": "deals",
"run_id": "frn_01JAB2C3D4E5F6G7H8J9K0MNPR",
"endpoint_url": "https://shop.example.com/sitemap.xml",
"state": "robots_denied",
"error_code": "robots",
"http_status": null,
"consecutive_failures": 1
}Rejected: not-modified
{
"source_key": "bbc-world",
"category": "news",
"run_id": "frn_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"endpoint_url": "https://feeds.bbci.co.uk/news/world/rss.xml",
"state": "not_modified",
"error_code": null,
"http_status": 304,
"consecutive_failures": 0
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('sources.fetch.failed@1', value); // { valid, errors: [{ path, message }] }