[EventStore.Client] [Projections] Deleting a projection and then creating a projection with the same name fails

Hi!

I’ve disabled & deleted a projection using the ProjectionsManager class (respectively its Disable() and Delete() methods). I’ve modified the code and then tried to create a new projection using CreateContinuous(). Unfortunately this fails now:

EventStore.ClientAPI.Exceptions.ProjectionCommandFailedException: Server returned 408 (Server was unable to handle request in time) for POST on http://127.0.0.1:2113/projections/continuous?name=MyProjection&type=JS&emit=1

If I look at the projections in the web interface I can see the new transaction, however, it hangs in “Writing/Initial” state forever.

What went wrong?

Failed with newest production-ready build as well as the RC2 of v3.

Best regards,

Dominik

Have you tried updating the query? I ran into similar problems when deleting things…

something like this:

var currentProjections = projectionsManager.ListContinuous(credentials);

if (currentProjections.Contains(projectionName))

{

projectionsManager.UpdateQuery(projectionName, projectionQuery, credentials);

}

else

{

projectionsManager.CreateContinuous(projectionName, projectionQuery, credentials);

}

Tom

I’ve the following - even more robust - code:

if (!IsProjectionInstalled (projectionsManager))

{

projectionsManager.CreateContinuous (c_myProjectionName, c_myProjectionQuery, s_userCredentials);

Console.WriteLine (“Successfully enabled the projection.”);

}

else

{

Console.WriteLine (“The projection is already installed.”);

}

and IsProjectionInstalled is currently implemented as:

var projections = projectionsManager.ListContinuous (s_userCredentials);

return projections.Contains (c_myProjectionName);

So that should not be the problem…