Open ghost opened 10 years ago
Hi David, This is the first issue reported related to caching so I haven't heard anything about this before. I'm not very familiar with Elmah so I don't really know what Elmah does that causes this to occur. For me to be able to help I would need to see your security configuration and a bit more info on where this error occurs. Is it only on a particular route or do you get this issue on every controller/action? You can send you're config to me at mail@fluentsecurity.net if you do not wish to share it here. / Kristoffer
Hi,
Thanks for your reply.
Seems we have worked out how this is happening. A session keep alive javascript is regularly pinging the website from the browser, but in the event that the app pool has been recycled (e.g. on publish or app pool settings) the session keep alive is essentially anonymous and FluentSecurity denys anonymous access to the controller action.. and it is at this point that we get the error from FluentSecurity – perhaps a key from when logged in clashes with that from the anonymous request?
Elmah is a Nuget package becoming popular for logging unhandled exceptions.. so it did not cause the error, just alerted us to the error happening. We were ignorant of this error occuring until installing Elmah.
If you have not come across this, no problem. I think we will essentially change the way we perform the session keep alive and just rely on the session timeout and therefore it will no longer be an issue. However, very much appreciate your response.
Cheers, David.
From: Kristoffer Ahl Sent: Thursday, December 19, 2013 9:03 PM To: kristofferahl/FluentSecurity Cc: yay4penguins Subject: Re: [FluentSecurity] Key already exists in cache collection. (#71)
Hi David, This is the first issue reported related to caching so I haven't heard anything about this before. I'm not very familiar with Elmah so I don't really know what Elmah does that causes this to occur. For me to be able to help I would need to see your security configuration and a bit more info on where this error occurs. Is it only on a particular route or do you get this issue on every controller/action? You can send you're config to me at mail@fluentsecurity.net if you do not wish to share it here. / Kristoffer
— Reply to this email directly or view it on GitHub.
Since this issue seems to have been resolved I am closing it now. Please feel free to re-open it again if you feel it is still an issue.
It seems this issue was a proper one after all. It seems the container is the villain and it should not be too hard to fix so the next release should have it fixed.
I do see this error in my ELMAH logs, but I haven't experienced an app crash while using a site with either the current release version, or the WebAPI WIP version.
Need a beta tester? :)
@tiesont The log messages you see, are they from when the application is starting up or do they occur at random when the app is running? Sure, any help with testing is appreciated! I'll make sure to ping you once I have a new package!
@kristofferahl Seems like the latter. I can zip up some relevant logs if you want. Appears to happen roughly once per day, so maybe it's a startup error?
@tiesont Thanks but I think we've got it covered and a fix is in the makings. I'll let you know when we have a package for it.
Any updates on this? The latest package I see in nuget is 2.1.0, and I'm still seeing this exception. I'm happy to help, if you could point me in the right direction.
@jrummell There is a set of unpublished packages that seemed to fix the duplicate key issue. It seems like they were generated using the develop branch. I've attached the packages if you want to use them:
Thanks, @tiesont . I'll give that a go.
@jrummell No problem. I haven't used Fluent Security recently, but those were some packages @kristofferahl gave me to test when he was last actively working on this project. Not sure if anyone has a more active fork. Kind of a shame - I really liked being able to setup my authorizations in one block of code, rather than decorating controllers and actions.
Hi, we are experiencing in v 2.0 and 2.1 the following error:
This occurs when the app pool is first loaded (or recycled).. but then everything seems to work ok as far as the security is concerned. We only started catching these errors after implementing Elmah logging and capturing unhandled exceptions.
Do you know what is happening here?
Cheers, David.