-
Notifications
You must be signed in to change notification settings - Fork 763
Fix Windows startup error: AUX reserved device name in socket paths #13688
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
base: main
Are you sure you want to change the base?
Conversation
- Changed socket filename from 'aux.sock.{hash}' to 'auxi.sock.{hash}' to avoid Windows reserved device name
- Added backward compatibility in CLI to support both 'aux.sock.*' and 'auxi.sock.*' patterns
- Added comments explaining Windows < 11 reserved name issue
- Added tests to verify the new socket path format and backward compatibility
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13688Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13688" |
|
@copilot Implement the PR feedback |
- Changed Directory.GetFiles to use "aux*.sock.*" pattern instead of separate patterns - Changed fileProvider.Watch to use "aux*.sock.*" pattern instead of dual watchers - Simplified code while maintaining backward compatibility Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical Windows startup error where the auxiliary backchannel service crashes on Windows < 11 due to "AUX" being a reserved DOS device name. The fix renames socket files from aux.sock.{hash} to auxi.sock.{hash} while maintaining backward compatibility for older CLI versions that may still create aux.sock.* files.
Key changes:
- Renamed socket file prefix from "aux.sock" to "auxi.sock" to avoid Windows reserved device name conflict
- Added backward compatibility in CLI monitoring to detect both old and new socket file formats
- Added comprehensive test coverage for new socket path format and Windows reserved name validation
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelService.cs | Updated socket path generation to use "auxi.sock" prefix with explanatory comment about Windows reserved names |
| src/Aspire.Cli/Utils/AppHostHelper.cs | Updated socket path computation to use "auxi.sock" prefix matching the hosting change |
| src/Aspire.Cli/Backchannel/AuxiliaryBackchannelMonitor.cs | Enhanced to support both "auxi.sock." and "aux.sock." patterns using wildcard matching for backward compatibility |
| tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelTests.cs | Added test verifying new socket path uses "auxi.sock" prefix and file creation succeeds |
| tests/Aspire.Cli.Tests/Utils/AppHostHelperTests.cs | New test file with comprehensive tests for socket path generation, hash consistency, and Windows reserved name avoidance |
Comments suppressed due to low confidence (1)
src/Aspire.Cli/Backchannel/AuxiliaryBackchannelMonitor.cs:361
- The backward compatibility logic in ExtractHashFromSocketPath lacks test coverage. This method now handles both "auxi.sock." and "aux.sock." prefixes, but there are no tests verifying that both formats are correctly parsed. Consider adding tests that verify:
- Hash extraction from "auxi.sock.{hash}" (new format)
- Hash extraction from "aux.sock.{hash}" (old format for backward compatibility)
- Null return for files not matching either pattern
// Support both "auxi.sock." (new) and "aux.sock." (old) for backward compatibility
if (fileName.StartsWith("auxi.sock.", StringComparison.Ordinal))
{
return fileName["auxi.sock.".Length..];
}
if (fileName.StartsWith("aux.sock.", StringComparison.Ordinal))
{
return fileName["aux.sock.".Length..];
}
return null;
- Replaced hardcoded TimeSpan.FromSeconds(60) with TestConstants.DefaultTimeoutTimeSpan - Added using statement for Microsoft.AspNetCore.InternalTesting - Provides better timeout behavior when debugging and clearer error messages Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
|
Tested this on Windows NT 10.0.19045.0, works! |
Description
On Windows < 11, the auxiliary backchannel service fails at startup with
SocketException (10050): A socket operation encountered a dead networkbecause "AUX" is a reserved DOS device name (along with CON, PRN, NUL, COM1-9, LPT1-9). Windows interpretsaux.sock.{hash}as the\\.\auxdevice rather than a file path.Changes:
aux.sock.{hash}toauxi.sock.{hash}in:AuxiliaryBackchannelService.GetAuxiliaryBackchannelSocketPath()AppHostHelper.ComputeAuxiliarySocketPath()AuxiliaryBackchannelMonitor:aux*.sock.*to match bothauxi.sock.*(new) andaux.sock.*(old) formatsTestConstants.DefaultTimeoutTimeSpanfor better debugging experience (disables timeout when debugger attached, provides clearer error messages with line numbers)Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.