can't stop subscription

Here the code of my projection :
fromCategory(‘ticket’)
.foreachStream()
.when({
“TicketOpened” : function(s,e) {
var streamUid = “ticket-” + e.body[“aggregateUid”];
emit(“stream-ticket-aggregate”, “StreamCreated”, {“streamId” : streamUid});
}
});
I use the same type of projection (juste the name of category and the name of Catched event change) that works perfeclty.
But this one, don’t create stream-ticket-aggregate stream with StreamCreated event. However, in the projection dashboard view, I can see it treat the good number of event

Events/sec
0.0
Buffered events
0
Events processed
1152
Partitions cached
1152
Reads in-progress
0
Writes in-progress
1
Write queue
0
Write queue (chkp)
1150
Checkpoint status
Requested
Position
$ce-ticket: 22219
Last checkpoint
$ce-ticket: -1
At the end, the projection don’t work, and when i try to stop it, I can’t, the projection down to StoppingRequested state.

How can I “reset” this kind of projections ?
I don’t know if it is important, but i perform hard delete for several stream for several categories.

Thx for your help.

What benefit is there to using fromCategory here or foreachStream? You don’t even use anything from state.

fromAll()
.when({
“TicketOpened” : function(s,e) {
var streamUid = “ticket-” + e.body[“aggregateUid”];
emit(“stream-ticket-aggregate”, “StreamCreated”, {“streamId” : streamUid});
}
});

I use this to limit the scope of listenning (just an intuition).
It was not a good intuition ? :slight_smile:

It doesn’t really limit much. Projections are much smarted than people give them credit for.

If you really wanted to limit scope on that query it would be:

fromStream(’$et-TicketOpened’) //stream per type!

.when …

Of course if you use the fromAll its smart enough to convert it into the above if the by type projection index exists

Ok, fromAll is good for me. Thx for the tips.

I have the problem again, my projection don’t work very well and i can’t stop it to delete it after & retry it.

fromAll()
.when({
“TicketOpened” : function(s,e) {
var streamUid = “ticket-” + e.body[“aggregateUid”];
emit(“stream-ticket-aggregate”, “StreamCreated”, {“streamId” : streamUid});
}
});

Have you any idea ?

My last log of database :

[00009,13,12:00:00.170] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 100ms. Handler: UnwrapEnvelopeHandler.
[00009,13,12:00:00.170] SLOW QUEUE MSG [Projection Core #2]: UnwrapEnvelopeMessage - 100ms. Q: 0/4.
[00009,27,12:00:29.807] Replying 404 for /js/ace/worker-javascript.js ==> /js/ace/worker-javascript.js
[00009,25,12:00:34.043] Replying 404 for /js/ace/worker-javascript.js ==> /js/ace/worker-javascript.js
[00009,10,12:00:36.023] Disabling ‘stream-ticket-aggregate-projection’ projection
[00009,11,12:01:05.055] Writing checkpoint for stream-clientAccount-aggregate-projection at C:132936494/P:132936494; ClientAccountCreated: -1; with expected version number 11
[00009,11,12:01:05.172] Checkpoint has be written for projection stream-clientAccount-aggregate-projection at sequence number 12 (current)
[00009,13,12:01:45.097] Writing checkpoint for $stream_by_category at C:133463683/P:133463683 with expected version number 11
[00009,11,12:01:45.097] Writing checkpoint for $streams at C:133463683/P:133463683 with expected version number 11
[00009,12,12:01:45.230] Writing checkpoint for $by_category at C:133463683/P:133463683 with expected version number 11
[00009,11,12:01:45.261] Checkpoint has be written for projection $streams at sequence number 12 (current)
[00009,13,12:01:45.261] Checkpoint has be written for projection $stream_by_category at sequence number 12 (current)
[00009,11,12:01:45.261] Writing checkpoint for $by_event_type at C:133463683/P:133463683 with expected version number 11
[00009,12,12:01:45.330] Checkpoint has be written for projection $by_category at sequence number 12 (current)
[00009,11,12:01:45.389] Checkpoint has be written for projection $by_event_type at sequence number 12 (current)
[00009,11,12:02:45.121] SLOW BUS MSG [bus]: CoreTick - 67ms. Handler: ProjectionCoreService.
[00009,11,12:02:45.122] SLOW QUEUE MSG [Projection Core #0]: CoreTick - 68ms. Q: 2/5.
[00009,13,12:02:49.297] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 66ms. Handler: UnwrapEnvelopeHandler.
[00009,13,12:02:49.297] SLOW QUEUE MSG [Projection Core #2]: UnwrapEnvelopeMessage - 66ms. Q: 0/3.
[00009,12,12:02:55.302] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 50ms. Handler: UnwrapEnvelopeHandler.
[00009,12,12:02:55.302] SLOW QUEUE MSG [Projection Core #1]: UnwrapEnvelopeMessage - 50ms. Q: 1/5.
[00009,11,12:03:11.989] SLOW BUS MSG [bus]: CoreTick - 52ms. Handler: ProjectionCoreService.
[00009,11,12:03:11.989] SLOW QUEUE MSG [Projection Core #0]: CoreTick - 52ms. Q: 1/4.
[00009,10,12:03:14.205] SLOW BUS MSG [manager input bus]: GetStatistics - 53ms. Handler: ProjectionManager.
[00009,10,12:03:14.205] SLOW QUEUE MSG [Projections Master]: GetStatistics - 53ms. Q: 0/1.
[00009,09,12:03:58.921] SLOW BUS MSG [MainBus]: ReadAllEventsForward - 100ms. Handler: WideningHandler`2.
[00009,09,12:03:58.921] SLOW QUEUE MSG [MainQueue]: ReadAllEventsForward - 100ms. Q: 3/3.
[00009,25,12:04:00.993] Replying 404 for /js/ace/worker-javascript.js ==> /js/ace/worker-javascript.js
[00009,10,12:04:07.747] Disabling ‘stream-user-aggregate-projection’ projection
[00009,12,12:04:07.821] Error while processing message EventStore.Projections.Core.Messages.CoreProjectionManagementMessage+Stop in queued handler ‘Projection Core #1’.
Current state is Faulted. Expected states are: LoadStateRequested, StateLoaded, Subscribed, Running, CompletingPhase, PhaseCompleted
[00009,11,12:04:33.795] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 49ms. Handler: UnwrapEnvelopeHandler.
[00009,11,12:04:33.795] SLOW QUEUE MSG [Projection Core #0]: UnwrapEnvelopeMessage - 50ms. Q: 0/4.
[00009,11,12:04:36.287] SLOW BUS MSG [bus]: CoreTick - 62ms. Handler: ProjectionCoreService.
[00009,11,12:04:36.287] SLOW QUEUE MSG [Projection Core #0]: CoreTick - 62ms. Q: 3/7.
[00009,10,12:04:40.342] SLOW BUS MSG [manager input bus]: GetStatistics - 60ms. Handler: ProjectionManager.
[00009,10,12:04:40.342] SLOW QUEUE MSG [Projections Master]: GetStatistics - 60ms. Q: 0/0.
[00009,11,12:05:00.276] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 50ms. Handler: UnwrapEnvelopeHandler.
[00009,11,12:05:00.276] SLOW QUEUE MSG [Projection Core #0]: UnwrapEnvelopeMessage - 50ms. Q: 1/7.
[00009,11,12:05:05.284] SLOW BUS MSG [Core Output]: ReadAllEventsForward - 66ms. Handler: RequestResponseQueueForwarder.
[00009,11,12:05:05.284] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 66ms. Handler: UnwrapEnvelopeHandler.
[00009,11,12:05:05.284] SLOW QUEUE MSG [Projection Core #0]: UnwrapEnvelopeMessage - 66ms. Q: 0/4.
[00009,11,12:05:16.661] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 99ms. Handler: UnwrapEnvelopeHandler.
[00009,11,12:05:16.661] SLOW QUEUE MSG [Projection Core #0]: UnwrapEnvelopeMessage - 99ms. Q: 0/3.
[00009,10,12:05:22.239] SLOW BUS MSG [manager input bus]: GetStatistics - 51ms. Handler: ProjectionManager.
[00009,10,12:05:22.239] SLOW QUEUE MSG [Projections Master]: GetStatistics - 51ms. Q: 0/1.
[00009,13,12:05:27.968] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 64ms. Handler: UnwrapEnvelopeHandler.
[00009,13,12:05:27.968] SLOW QUEUE MSG [Projection Core #2]: UnwrapEnvelopeMessage - 64ms. Q: 0/2.
[00009,12,12:05:27.968] SLOW BUS MSG [bus]: UnwrapEnvelopeMessage - 64ms. Handler: UnwrapEnvelopeHandler.
[00009,12,12:05:27.968] SLOW QUEUE MSG [Projection Core #1]: UnwrapEnvelopeMessage - 65ms. Q: 0/4.
[00009,09,12:05:34.794] SLOW BUS MSG [MainBus]: CommitAck - 50ms. Handler: RequestManagementService.
[00009,09,12:05:34.794] SLOW QUEUE MSG [MainQueue]: CommitAck - 50ms. Q: 4/5.

It says you rejection is faulted.

Current state is Faulted. Expected states are: LoadStateRequested, StateLoaded, Subscribed, Running, CompletingPhase, PhaseCompleted

What does the ui say about it being faulted? Eg an error happened previously…

ui only say that :
Failure (tap notification to dismiss)

projection could not be stopped

when i try to stop projection

But effectively i want to stop my projection because it don’t works well, in fact the projection process event in stream-ticket-aggregate but this view : http://62.210.124.153:2113/web/index.html#/projections display 0 for Events/Processed column dashboard.

I use other projection exaclty of the same form & works perfeclty.

You do realize that we can’t log into your server? And that his is a public list?

Your projection says its faulted. If you click on it in the ui it will most likely say why it’s faulted.

When I click on the projection on the ui, the ui says nothing about why projection fail & I can’t stop the projection or delete it.
Do you know a way to force stop/delete the projection ?

Maybe you can tell us what it does say? Does it say the projection is faulted? If so you can’t disable a faulted projection because it’s already disabled because it’s faulted. You can’t stop it because it’s already stopped because it’s faulted.

The message you put up before said its in a faulted state. What does the ui say?

the ui

So reset etc do nothing? The projection is statiting thatnits faulted. What does a restart or if clustered a node switch do?

Reset don’t work.
But I restart the database server & it is ok.
I was looking for a solution to perform this without restart server, because I won’t be able to do this every time.
Thx for helping.

The problem is not happening at the point you show though, the problem happened at some point previously (when it appears to have faulted or maybe was manually stopped/stopped via restful api etc and did not successfully stop). We would need to see the log etc or have more explanation from that point to figure out what is happening there.