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

fix(agent): Don't bail out if we cannot find a WSL adapter #840

Closed
wants to merge 1 commit into from

Conversation

CarlosNihelton
Copy link
Contributor

@CarlosNihelton CarlosNihelton commented Jul 16, 2024

The UP4W background agent relies on the existence of the WSL net adapter and the distro instance to properly detect on which address it should serve.

Clean installs of Windows with recent versions of WSL won’t have any of those until the user creates the first WSL instance.

The daemon reports the error to find the address and the agent quickly exits.

We need to detect that situation and listen on localhost, so we have time to read Landscape information from registry (or talk to the GUI), so that we may end up creating WSL instances for the current user.
The current implementation won't never allow that, because the agent exits early if the WSL adapter address is not found.

There is a secondary issue to this: once an instance is created it won’t be able to talk to the agent if the networking mode is NAT (the current default), because wsl-pro-service expects the agent listening on the WSL adapter. At least the provisioning tasks are delivered via cloud-init, thus independently of the communication to the agent, so that lack of communication won’t be an apparent issue and it solves itself when the agent restarts.

No user instance means no system distro and no WSL net adapter. Without this the agent will exit quickly and never have a chance to talk to Landscape to receive an install command.


Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.37%. Comparing base (524a934) to head (734d08c).
Report is 184 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #840      +/-   ##
==========================================
+ Coverage   88.26%   88.37%   +0.10%     
==========================================
  Files         105      105              
  Lines        6758     6759       +1     
==========================================
+ Hits         5965     5973       +8     
+ Misses        616      612       -4     
+ Partials      177      174       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CarlosNihelton CarlosNihelton self-assigned this Jul 17, 2024
It could be the case that there is no instance
No instance means no system distro and no WSL net adapter.
Without this the agent will exit quickly and never have a chance to talk to Landscape to receive an install command.
@CarlosNihelton
Copy link
Contributor Author

This patch is only for unblocking tests, not a definitive solution yet, hence the reason for being kept in draft.

@CarlosNihelton
Copy link
Contributor Author

Closed by #896

@CarlosNihelton CarlosNihelton deleted the 0-instances-net branch September 6, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant