We are using projections but sometimes they are failing without any clear reason. I need some help debugging this problem or investigating what is wrong.
Multiple projections are occasionally failing, usually only one or two at the time. After resetting the projection they are working just fine again.
When I retrieve status of the projection I get the following info:
{
“coreProcessingTime”: 2,
“version”: 1,
“epoch”: -1,
“effectiveName”: “frontend.authorization.roles_per_person.2”,
“writesInProgress”: 0,
“readsInProgress”: 0,
“partitionsCached”: 2,
“status”: “Running”,
“stateReason”: “”,
“name”: “frontend.authorization.roles_per_person.2”,
“mode”: “Continuous”,
“position”: “$ce-psybizz.neon.domainmodel.person: 15”,
“progress”: 100.0,
“lastCheckpoint”: “$ce-psybizz.neon.domainmodel.person: -1”,
“eventsProcessedAfterRestart”: 6,
“statusUrl”: “http:///projection/frontend.authorization.roles_per_person.2”,
“stateUrl”: “http:///projection/frontend.authorization.roles_per_person.2/state”,
“resultUrl”: “http:///projection/frontend.authorization.roles_per_person.2/result”,
“queryUrl”: “http:///projection/frontend.authorization.roles_per_person.2/query%3Fconfig=yes”,
“enableCommandUrl”: “http:///projection/frontend.authorization.roles_per_person.2/command/enable”,
“disableCommandUrl”: “http:///projection/frontend.authorization.roles_per_person.2/command/disable”,
“checkpointStatus”: “”,
“bufferedEvents”: 0,
“writePendingEventsBeforeCheckpoint”: 0,
“writePendingEventsAfterCheckpoint”: 0
}
``
When I try to retrieve the state or result of the projection it returns an empty result:
curl http:///projection/frontend.authorization.roles_per_person.2/state -I -XGET
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Headers: Content-Type, X-Requested-With, X-Forwarded-Host, X-PINGOTHER, Authorization, ES-LongPoll, ES-ExpectedVersion, ES-EventId, ES-EventType, ES-RequiresMaster, ES-HardDelete, ES-ResolveLinkTo, ES-ExpectedVersion
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location, ES-Position
ES-Position: {"$s":{"$ce-psybizz.neon.domainmodel.person":15}}
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept
Content-Type: application/json; charset=utf-8
Server: Mono-HTTPAPI/1.0
Content-Length: 0
Keep-Alive: timeout=15,max=10
``
Code of this projection:
fromCategory(‘psybizz.neon.domainmodel.person’)
.foreachStream()
.when({
‘$init’: function() {
return [];
},
‘Psybizz\Neon\DomainModel\Person\RoleAssignedToPerson’: roleAssignedToPersonHandler
});
function roleAssignedToPersonHandler(state, event) {
state.push(event.data.roleDefinitionId);
return state;
}
``
Small note: This information is retrieved from my local dev stack which is ES3.5, but we have the same problem on our acceptance environment which we just upgraded to 3.9.1