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

Index must be within the bounds of the List - Bug #327

Closed
gregoks opened this issue Aug 21, 2019 · 12 comments
Closed

Index must be within the bounds of the List - Bug #327

gregoks opened this issue Aug 21, 2019 · 12 comments
Assignees
Labels

Comments

@gregoks
Copy link

gregoks commented Aug 21, 2019

hi,

I'm getting the following error when using the MyGet version - 1.0.27-11567

I'm using it with the following properties:

MaxRequestLogCount = 100
RequestLogExpirationDuration = 6

HttpStatusCode set to 500 System.ArgumentOutOfRangeException: Index must be within the bounds of the List. Parameter name: index at System.Collections.Generic.List1.Insert(Int32 index, T item) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) at WireMock.Util.ConcurrentObservableCollection`1.InsertItem(Int32 index, T item) at WireMock.Owin.WireMockMiddleware.LogRequest(LogEntry entry, Boolean addRequest) at WireMock.Owin.WireMockMiddleware.InvokeInternal(HttpContext ctx) at WireMock.Owin.GlobalExceptionMiddleware.InvokeInternal(HttpContext ctx)

Can you please check?

Thanks :)

Greg

@StefH StefH self-assigned this Aug 21, 2019
@StefH StefH added the bug label Aug 21, 2019
StefH added a commit that referenced this issue Aug 21, 2019
@StefH
Copy link
Collaborator

StefH commented Aug 21, 2019

Please try 1.0.28-ci-11744

@gregoks
Copy link
Author

gregoks commented Aug 22, 2019

I have tried using version 1.0.28 and its still happening, 1.0.28 was deployed later than 1.0.28-ci-11744?

@StefH
Copy link
Collaborator

StefH commented Aug 22, 2019

A possible fix for your problem is only present in preview version : 1.0.28-ci-11744

StefH added a commit that referenced this issue Aug 23, 2019
@StefH StefH closed this as completed Aug 23, 2019
@gregoks
Copy link
Author

gregoks commented Sep 4, 2019

hi @StefH , this issue still happens in version 1.0.31-ci-11865. can you please check?

@StefH StefH reopened this Sep 4, 2019
@StefH StefH closed this as completed Sep 17, 2019
@gregoks
Copy link
Author

gregoks commented Nov 17, 2019

hi @StefH ,

I'm using version 1.0.37 and still getting the following error:

HttpStatusCode set to 500 System.ArgumentOutOfRangeException: Index must be within the bounds of the List. Parameter name: index at System.Collections.Generic.List1.Insert(Int32 index, T item) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) at WireMock.Util.ConcurrentObservableCollection`1.InsertItem(Int32 index, T item) at WireMock.Owin.WireMockMiddleware.LogRequest(LogEntry entry, Boolean addRequest) at WireMock.Owin.WireMockMiddleware.InvokeInternal(HttpContext ctx) at WireMock.Owin.GlobalExceptionMiddleware.InvokeInternal(HttpContext ctx)

this is how I start the wiremock:

var fluentMockServer = StandAloneApp.Start(new FluentMockServerSettings
{
Port = port,
StartAdminInterface = true,
StartTimeout = 5000,
MaxRequestLogCount = 100,
RequestLogExpirationDuration = 6,
Logger = new WireMockLogger(port)
});

WireMockLogger is my class and I assign to an open port.

@StefH StefH reopened this Nov 17, 2019
@StefH
Copy link
Collaborator

StefH commented Nov 17, 2019

It maybe has to do with a lot of (fast) requests. Or maybe the logic for MaxRequestLogCount and RequestLogExpirationDuration is wrongly implemented. I need to make a sample where your settings are used and where I use HttpClient to send 100+ requests.

@StefH
Copy link
Collaborator

StefH commented Nov 19, 2019

I've created a example console app:
https://github.com/WireMock-Net/WireMock.Net/tree/master/examples/WireMock.Net.Console.RequestLogTest

Can you take a look if this is the code you use? And make a PullRequest if you have different code.

@gregoks
Copy link
Author

gregoks commented Nov 20, 2019

@StefH looks ok. did the error recreated when you ran your code?

@StefH
Copy link
Collaborator

StefH commented Nov 20, 2019

I had no errors when running this example code, but you can try yourself and maybe use your own logger?

@StefH
Copy link
Collaborator

StefH commented Jul 7, 2020

@gregoks
Did you have any luck solving this issue yet ?

@gregoks
Copy link
Author

gregoks commented Jul 10, 2020

Sorry, havent got around to handle it. Im not sure it still happens though

@StefH
Copy link
Collaborator

StefH commented Sep 6, 2020

Hello @gregoks

I'm closing this issue for now. It could be that this is related to #478, so please take a look at that issue + solution.

In case you encounter this again, please raise a new issue.

@StefH StefH closed this as completed Sep 6, 2020
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