Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__admin/requests - "Collection was modified" exception #308

Closed
gregoks opened this issue Jul 31, 2019 · 6 comments
Closed

__admin/requests - "Collection was modified" exception #308

gregoks opened this issue Jul 31, 2019 · 6 comments
Assignees
Labels

Comments

@gregoks
Copy link

gregoks commented Jul 31, 2019

Hi,

When I accesed /__admin/requests I got the following exception:

{"Status":"{"ClassName":"System.InvalidOperationException","Message":"Collection was modified; enumeration operation may not execute.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.Collections.Generic.List1.Enumerator.MoveNextRare()\\r\\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n at WireMock.Server.FluentMockServer.ToJson[T](T result, Boolean keepNullValues)\r\n at WireMock.ResponseProviders.DynamicResponseProvider.ProvideResponseAsync(RequestMessage requestMessage, IFluentMockServerSettings settings)\r\n at WireMock.Mapping.ResponseToAsync(RequestMessage requestMessage)\r\n at WireMock.Owin.WireMockMiddleware.InvokeInternal(HttpContext ctx)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2146233079,"Source":"System.Private.CoreLib","WatsonBuckets":null}"}

Can you please check?

Thanks,

Greg

@StefH StefH self-assigned this Jul 31, 2019
@StefH StefH added the bug label Jul 31, 2019
@StefH
Copy link
Collaborator

StefH commented Jul 31, 2019

I'll take a look, probably I need to deep clone this collection when it's requested, so that you get a copy and not a reference.

@gregoks
Copy link
Author

gregoks commented Jul 31, 2019

thanks @StefH !

@StefH
Copy link
Collaborator

StefH commented Jul 31, 2019

Can you try new version from MyGet?
WireMock.Net.1.0.26-ci-11549

@gregoks
Copy link
Author

gregoks commented Aug 1, 2019

Sure, I'll run it for few days and see if it happens again since it doesnt happen always..

@gregoks
Copy link
Author

gregoks commented Aug 9, 2019

Havent seen this error since the fix.

@StefH
Copy link
Collaborator

StefH commented Aug 10, 2019

I'll merge that PR to master and create a new NuGet.

In case this happens again, please open a new issue.

@StefH StefH closed this as completed Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants