-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
DurableHttpUsingFileSizeRolledBuffers silently fails when write no permissions on buffer file. #95
Comments
Hi there and welcome to this repository! A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it. |
Hi WrathZA! Sorry for taking this long before getting back to you, but you will soon understand why. Some of the reported issues on this repo indicate that there is a discrepancy between what one is expecting from Serilog, and what actually happens. Sometimes this isn't because the sink is behaving badly, it's because there are some aspects of Serilog, very few I would add, that aren't intuitive. I cannot fix these unexpected behaviors, but I can try to bridge the gap by describing these problems, why they exist, and their remedy. I've created a wiki page in this repo called Common problems that aim to document unexpected behaviors, like yours. Would you be willing to read that page and tell me if it gives you an explanation to your problem? I think other developers with the exact same problem as you will have a better chance of finding the information on the wiki than in this issue. What do you think? Thank you very much for being the trigger of creating that wiki page, I praise you for creating this issue although you didn't have to, you solved your issue yourself! |
Thanks, the wiki is very helpful. I'm guessing the issue is serilog-sinks-http/src/Serilog.Sinks.Http/Sinks/Http/Private/Network/HttpLogShipper.cs Line 212 in 6144c36
Where is assumes the file is always locked. I can do a PR on the Bookmark File or on the ctor of the Sink to confirm we have RW access to the files system and self log that fact for others? |
Lets back up, making sure that we are on the same page. I think the following statements are true, and you have to tell me which aren't from your point of view.
|
I think I understand, though you have much much more experience and context than me. When digging through the code, I noticed there is validation in the form of application exceptions in other ctors. Close if it's inline with your design, though I'm happy to help with anything should you require it. |
You're correct on this one. There are most certainly exceptions thrown from code that perhaps shouldn't have been thrown, that should have been written to When it comes to validation, the problem with I/O, whether it's disk or network, is that it doesn't matter if we validate anything at the start, because its state isn't constant. Even if we validate that we can write to disk when the sink is created, there are many things that can cause us not being able to write to disk after any duration of time. |
I am facing the same problem in my production servers. no clue what is the reason for file being locked. |
Is the file locked at the very beginning when your application is starting, or later when the application has been working for a time? |
It is getting locked after sometime. After I have done couple of IIS reset it starts working. please help me with it. no clue what to do now. |
I think we may need to provide shared: true to be configurable when I create a logger. |
Can we verify that IIS application pool recycling is the issue? Can you disable overlapped recycling to verify that it is the cause, and not misbehaving anti-virus software or something similar. |
Sure. let me try and will let you know. thanks. |
Hi @esakkiraja-k. Where you able to verify the issue? |
we changed iis changed app pool recycle to 0. but still we are seeing drop |
could you please help me with it. could you please expose an attribute with shared:true. |
I can build you a special version that has set it to true, and you can verify that it works. After that I can build an official version. Which version of the sink are you currently using? |
5.2.0 i am using it now. please build it and share. thanks a lot. I hope it may solve the problem |
I'll see if I can get it built tonight |
I've built a new preview, soon to be public on nuget.org. You can find it here. Can you try it out to see if it solves your issue? |
thanks a lot. give a couple of days I will verify and get back to you.. how to check your changes.. |
You can diff the changes between master and issues/95 |
it works. please release it. I will upgrade to latest version. please move this fix to latest version. thanks a lot. |
I'll release a new version this week. I'll make a new comment here when it's done. |
v6.0.0 is now available on nuget.org. Thanks for providing information regarding the issue. |
thanks for the quick fix. I appreciate your help |
Describe the bug
DurableHttpUsingFileSizeRolledBuffers silently fails when the application doesn't have permission to create or write to the buffer file.
To Reproduce
Create a DurableHttpUsingFileSizeRolledBuffers with just the requestUri
Expected behavior
Thrown an exception.
Additional context
Discovered this issue when deploying applications using "enterprise" Docker containers where the default container user has limited permissions to local file system.
Just a heads up. Thank you for the work in producing this.
The text was updated successfully, but these errors were encountered: