source-missing
An event leaves out its source.
- Route:
write-events - Description:
source is missing: expected a URI as defined by RFC 3986, such as 'https://library.eventsourcingdb.io' - Details:
event, the place of the event in its list, counting from 0.
Why It Happens#
Every event names the system it comes from in its source, as CloudEvents requires. The database reports this error when an event of a write leaves out source or sends it as an empty string. The source is the first value of an event that is checked, so an event that lacks more than its source reports this error first.
A typical cause is code that builds its events by hand and sets only the subject, the type, and the data.
How to Fix It#
Send a source with every event: a URI that names the system that writes it, such as https://library.eventsourcingdb.io. Sending the same request again fails the same way, since the error depends on the request alone.
Example#
For a write whose first event leaves out its source, EventSourcingDB answers with this error, as a line of the stream, and then ends the stream with its end item:
{
"type": "error",
"data": {
"code": "https://docs.eventsourcingdb.io/errors/source-missing",
"description": "source is missing: expected a URI as defined by RFC 3986, such as 'https://library.eventsourcingdb.io'",
"details": {
"event": 0
}
}
}