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

Shadow copies fails to gracefully handle deleted folders between publishes #52433

Closed
1 task done
kiwiant opened this issue Nov 28, 2023 · 3 comments
Closed
1 task done
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM

Comments

@kiwiant
Copy link

kiwiant commented Nov 28, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Shadow copies (enableShadowCopy) are great but if removing a folder in the published site this causes the site not to load with the following in the Windows event log:

EventID: 1007
Source:  IIS AspNetCore Module V2 
Message: Application '/LM/W3SVC/2/ROOT' with physical root '_(path to site)_' failed to load coreclr. Exception message:
Unexpected exception: directory_iterator::directory_iterator: The system cannot find the path specified.: "_(path to site)_\wwwroot\.well-known"

Expected Behavior

I like many others would expect this scenario to be handled gracefully either cleaning up the shadow copy or ignoring the deleted folders in the published site.

Steps To Reproduce

  1. Create a new ASP.NET Core App (.NET 8) in Visual Studio with a dummy folder in wwwroot.
  2. Enable shadow copies in the web.Release.config:
<handlerSettings>
    <handlerSetting name="enableShadowCopy" value="true" />
    <handlerSetting name="shadowCopyDirectory" value="..\..\ShadowCopy\_(site name)_" />
</handlerSettings>
  1. Publish the site to IIS on Windows Server 2022 with the ASP.NET Core 8 Hosting bundle.
  2. Validate the site works correctly.
  3. Remove the dummy folder from the wwwroot folder and republish the site.
  4. Confirm the site doesn't load and the event log contains the message as described above.

Exceptions (if any)

Unexpected exception: directory_iterator::directory_iterator: The system cannot find the path specified.: "(path to site)\wwwroot.well-known"

.NET Version

8.0.0

Anything else?

IIS runtime support (ASP.NET Core Module v2): 18.0.23305.0
Issue also present in .NET 7.x.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Nov 28, 2023
@amcasey amcasey added the feature-iis Includes: IIS, ANCM label Nov 28, 2023
@amcasey
Copy link
Member

amcasey commented Nov 28, 2023

Is this #48233?

@kiwiant
Copy link
Author

kiwiant commented Nov 28, 2023

Is this #48233?

Thanks, and yes indeed, I must have been using different keywords when searching.

Pretty undocumented cleanShadowCopyDirectory is right. In my test it appears to recreate everything in the shadow copy folder so might need some performance testing around this if used in production.

Regardless of this setting I believe there's still a bug as this is unexpected behaviour. Happy to this marked as duplicate of #48233 although it's fallen on deaf ears.

@amcasey
Copy link
Member

amcasey commented Dec 1, 2023

Yeah, I'm sorry that we can't always turn around fixes as quickly as we like. I think the best way forward is to mark this as a duplicate and upvote the original to make it easier to see the level of customer impact in a single issue.

@amcasey amcasey closed this as completed Dec 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-iis Includes: IIS, ANCM
Projects
None yet
Development

No branches or pull requests

2 participants