Skip to content

fix: wsman explorer calls for CIRA enabled device#1138

Open
DevipriyaS17 wants to merge 3 commits into
mainfrom
wsman_fix
Open

fix: wsman explorer calls for CIRA enabled device#1138
DevipriyaS17 wants to merge 3 commits into
mainfrom
wsman_fix

Conversation

@DevipriyaS17

@DevipriyaS17 DevipriyaS17 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Problem
WSMAN Explorer returns a 500 Internal Server Error for CIRA-enrolled devices when attempting to execute Explorer operations. The issue occurs because Explorer requests cannot reach devices connected through CIRA, while the same operations continue to work for non-CIRA devices.

Root Cause
The Explorer's WSMAN client always attempted to connect directly to the device hostname and did not use the existing CIRA APF tunnel. Since CIRA devices are only reachable through the APF tunnel, Explorer requests failed and resulted in 500 errors.

Fix
Updated the WSMAN Explorer to route WSMAN calls through the existing CIRA APF tunnel when the target device is CIRA-enrolled, matching the behavior already used by other WSMAN calls in the codebase. Direct hostname connections continue to be used for non-CIRA devices, so their behavior remains unchanged.

Output:

wsman_console wsman_ui

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.21%. Comparing base (9206957) to head (87a0166).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1138      +/-   ##
==========================================
+ Coverage   43.80%   44.21%   +0.40%     
==========================================
  Files         144      144              
  Lines       13666    13695      +29     
==========================================
+ Hits         5987     6055      +68     
+ Misses       7112     7072      -40     
- Partials      567      568       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes AMT Explorer WSMAN failures for CIRA-enrolled devices by routing explorer WSMAN traffic through the existing CIRA/APF tunnel (consistent with the main WSMAN usecase), instead of always attempting a direct hostname connection.

Changes:

  • Decrypt device password once up-front and reuse it for both CIRA and non-CIRA explorer connections.
  • For CIRA-enrolled devices, fetch the APF tunnel connection entry and build WSMAN messages using the CIRA channel manager rather than device.Hostname.

Comment thread internal/usecase/amtexplorer/wsman.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread internal/usecase/amtexplorer/wsman.go
Comment thread internal/usecase/amtexplorer/wsman.go Outdated
Comment thread internal/controller/httpapi/v1/error_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread internal/usecase/amtexplorer/wsman.go
Comment thread internal/usecase/amtexplorer/wsman_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread internal/usecase/amtexplorer/wsman_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread internal/controller/httpapi/v1/error_test.go Outdated
Comment thread internal/controller/httpapi/v1/error_test.go Outdated
Comment thread internal/controller/httpapi/v1/error_test.go Outdated
Comment thread internal/usecase/amtexplorer/wsman_test.go
Comment thread internal/usecase/amtexplorer/wsman_test.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@sudhir-intc sudhir-intc changed the title fix: fix wsman explorer calls for CIRA enabled device fix: wsman explorer calls for CIRA enabled device Jul 16, 2026
@DevipriyaS17
DevipriyaS17 requested a review from sudhir-intc July 16, 2026 09:15

@sudhir-intc sudhir-intc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Verified the changes with a CIRA Device and non-CIRA device connected to Console

@sudhir-intc

Copy link
Copy Markdown
Contributor

@DevipriyaS17 : Please update the description with the issue which is being fixed

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.

Console : For CIRA Enabled Devices commands in WSMAN Explorer fail

3 participants