Azure / Azure/AKS-Edge

[BUG] Write-Error: Cannot add a member with the name "ControlPlane" even though its the first installation

Open
#225 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
PowerShell
Stars
66
Forks
50
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When we have the .msi installed and call the "New-AksEdgeDeployment" for the first time, we receive the following Error Message:
```Add-Member : Cannot add a member With the name "ControlPlane" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.
At C:\Program Files\WindowsPowerShell\Modules\AksEdge\1.9.262\AksEdge.psm1:12222 char:37
+ ... LinuxNode | Add-Member -MemberType NoteProperty -Name "ControlPlane" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (@{ControlPlant=...ssthough=True}:PSObject) [Add-Member], InvalidOperationException
+ FullyQualifiedErrorld: MemberAlreadyExists,Microsoft.PowerShell.Commands.AddMemberCommand
```

**To Reproduce**
Steps to reproduce the behavior:
1. Fresh Windows Installation
2. Installed AksEdge-K3s-1.29.6-1.9.262.0.msi as well as the Powershell Modules
3. Run command "New-AksEdgeDeployment" for an offline cluster deployment

**Expected behavior**
The execution of the command is successful and the offline cluster gets deployed as expected. However, an error is thrown indicating that a control plane already exists, which should not be the case on a fresh installation.

**Screenshots**
![Image](https://github.com/user-attachments/assets/27cfee46-7ad7-468c-8908-9aa210808a72)

**Environment (please complete the following information):**
- AKS Edge Essentials Version 1.9.262.0
- Kubernetes version K3s 1.29.6
- Windows Host OS (please complete the following information):
- Edition: Windows 10 IoT Enterprise LTSC
- Version: 21H2 19044.1288
- Virtual Machine: None

Contributor guide

Open the contributing guide

Research direction

Start with AksEdge.psm1 at line 12222 and trace the New-AksEdgeDeployment path that pipes LinuxNode to Add-Member. Reproduce the first offline deployment on the stated Windows environment, then determine why ControlPlane is already present and verify that a fresh installation completes without the MemberAlreadyExists error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, powershell
Domain
devops, infrastructure, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.