Projection won't start after EventStore restart

a few hours ago, I stopped my EventStore instance (to replicate environment locally, but thats not important). Since then, my application misbehaved which I could narrow down to my one EventStore projection.

It seems to be in “Starting” status for hours and I can’t seem to find a way to fix that, restarting EventStore again doesn’t solve it.

The ES log shows the following:

» 15:42:27.961 [PID:00652:017 2014.07.18 13:41:53.088 ERROR ProjectionManager ] The ‘per-context’ projection faulted due to 'Cannot create a projection state handler.

» 15:42:27.961

» 15:42:27.961 Handler type: JS

» 15:42:27.961 Query:

» 15:42:27.961

» 15:42:27.961 options({});fromAll() .when({$any: function (s, e) { if(e.metadata && e.metadata.AssociatedBoundedContext) {linkTo(“context-”+e.metadata.AssociatedBoundedContext, e);}}})

» 15:42:27.961

» 15:42:27.961 Message:

» 15:42:27.961

» 15:42:27.961 Failed to compile script. Terminated?’

» 15:42:27.968 EventStore.Projections.Core.v8.Js1Exception: Failed to compile script. Terminated?

» 15:42:27.968 at EventStore.Projections.Core.v8.CompiledScript.CheckResult(IntPtr scriptHandle, Boolean terminated, Boolean disposeScriptOnException) in c:\BuildAgent1\work\oss\windows\releasebuilds\src\EventStore\EventStore.Projections.Core\v8\CompiledScript.cs:line 78

» 15:42:27.968 at EventStore.Projections.Core.v8.PreludeScript…ctor(String script, String fileName, Func2 getModuleSourceAndFileName, Action2 cancelCallbackFactory, Action`1 logger) in c:\BuildAgent1\work\oss\windows\releasebuilds\src\EventStore\EventStore.Projections.Core\v8\PreludeScript.cs:line 69

» 15:42:27.968 at EventStore.Projections.Core.Services.v8.V8ProjectionStateHandler…ctor(String preludeName, String querySource, Func2 getModuleSource, Action1 logger, Action`2 cancelCallbackFactory) in c:\BuildAgent1\work\oss\windows\releasebuilds\src\EventStore\EventStore.Projections.Core\Services\v8\V8ProjectionStateHandler.cs:line 54

» 15:42:27.968 at EventStore.Projections.Core.Services.Management.ProjectionStateHandlerFactory.Create(String factoryType, String source, Action2 cancelCallbackFactory, Action1 logger) in c:\BuildAgent1\work\oss\windows\releasebuilds\src\EventStore\EventStore.Projections.Core\Services\Management\ProjectionStateHandlerFactory.cs:line 75

» 15:42:27.968 at EventStore.Projections.Core.Services.Management.ManagedProjection.<>c__DisplayClass42.b__41() in c:\BuildAgent1\work\oss\windows\releasebuilds\src\EventStore\EventStore.Projections.Core\Services\Management\ManagedProjection.cs:line 741

The projection code is trivial, just linking all events of a bounded context to a combined stream, nothing fancy, and worked fine for months now.

The current data is not that important, so I could reset my EventStore, but I’d rather fix it than just ignore it if it happens again.

Is there a way to fix this projection?



What version are you running on?

oops, totally forgot that part.
I am running 3.0.0rc2

SingleNode or Cluster?

SingleNode with default arguments except paths, ip and --run-projections.

Hosted on an Azure XS virtual machine with data stored on a dedicated data disk.

Connectivity is achieved via Azure virtual network.

I am curious if you run trunk you get the same behaviour? It appears to be a timeout from looking at source

Also @James @Yuriy I am a bit confused debugging this as the line numbers of exception rather obviously do not match the source code of RC2 perhaps we have an issue with the tag?

Currently testing out with trunk,
but it seems like I was running 2.0.1 … could’ve sworn it was 3.0.0rc2 in all our environments (all the others do use 3.0.0rc2), so that should explain the mismatch of line numbers :slight_smile:

ok that makes more sense then :slight_smile: I was really confuzzled looking through the code.

Yeah, sorry about that :slight_smile:

Had to reset my EventStore, since projections had even more problems now, but I’m pretty sure that was related to me not stopping the projections before the upgrade to 3.0/dev/trunk as one should do (because of me not knowing that it was pre-3.0).

So it’s hard to say if that fixed it, but at least I think so. Locally, I was able to start it with the same dataset and the trunk version. I guess the problem only occured because of the old event store version, so this can pretty much be ignored.

Thank you

OK Great sorry for the issues you experienced, glad to hear everything is good again.