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

LinkSpeed Detection on Windows includes all PowerShell profile output for each interface #11171

Closed
randomchance opened this issue Sep 10, 2021 · 2 comments · Fixed by #11183
Closed
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/fingerprint theme/platform-windows type/bug

Comments

@randomchance
Copy link

Nomad version

Nomad v1.1.4 (acd3d78)

Operating system and Environment details

WindowsProductName : Windows 10 Enterprise
WindowsCurrentVersion : 6.3
WindowsVersion : 1909

Issue

During agent startup (tested using the -dev option) any powershell profile output is included in the string parsed to determine link speed.
This causes the following:

  1. LinkSpeed detection fails. This may be impacting link detection in general, I'm not sure.
  2. The startup logs are very cluttered.
  3. Startup is delayed by an additional 8-20 seconds
  4. It's a complicating factor if you are new to Nomad and trying to ensure you have everthing setup correctly.

Reproduction steps

Add something to your powershell profile that outputs to the host, such as "User: $env:USERNAME"

Start Nomad:

nomad agent -dev -bind 0.0.0.0 -log-level INFO -network-interface="vEthernet (WiredNetwork)" 

Note that specifiing the network speed has no impact on the result:

nomad agent -dev -bind 0.0.0.0 -log-level INFO -network-interface="vEthernet (WiredNetwork)" -network-speed=1024

Expected Result

Network link speed / interface fingerprint detection works, and doesn't load the powershell profile for each interface.

Actual Result

This is logged for each interface - obviously if I didnot have any text output in my Powershell profile this would not be a problem, but you should probably be using the -NoProfile option for powershell anyway to cut down on execution time, resources, and environment contamination.

Note that the verbose ouput is from me forcing it via Write-Verbose -Verbose $Text

2021-09-10T17:38:42.654-0400 [WARN] client.fingerprint_mgr.network: couldn't split LinkSpeed output: output="VERBOSE: Importing functions from: ***********.ps1
VERBOSE: Importing functions from: *************.ps1
VERBOSE: Importing functions from: ********.ps1
VERBOSE: Importing functions from: **************.ps1
VERBOSE: Importing functions from: ****************.ps1
VERBOSE: Importing functions from: **************.ps1


User: *******
Computer: *******


1 Gbps"

<Repeat for all 7 interfaces (docker+Hyper-V)>

    2021-09-10T17:38:42.654-0400 [DEBUG] client.fingerprint_mgr.network: link speed could not be detected, falling back to default speed: mbits=1000
    2021-09-10T17:38:46.670-0400 [DEBUG] client.fingerprint_mgr: fingerprinting periodically: fingerprinter=vault period=15s

Job file (if appropriate)

Nomad Server logs

I can produce the full logs if needed, but I'll need to actually read and possibly sanitize them before hand so I wanted to be sure it was required first.

@lgfa29
Copy link
Contributor

lgfa29 commented Sep 14, 2021

Thank you for the report and for the tip about -NoProfile @randomchance 🙂 .

I have a fix for this in #11183.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/fingerprint theme/platform-windows type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants