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

Run-TestsInBcContainer on NextMajor containers results in a SSL connection error #3812

Open
lbev7 opened this issue Jan 23, 2025 · 8 comments
Assignees

Comments

@lbev7
Copy link

lbev7 commented Jan 23, 2025

Describe the issue
Since November 2024, we've been encountering issues with running tests in containers based on NextMajor artifacts. Last successful run was on versions 26.0.25383.0/26.0.25330.0 (BC version/platform version). Currently, we're receiving CommunicationError: The SSL connection could not be established. App publishing and compilation runs fine (these steps are run prior to testing).
Please note that we haven't made any changes in our build scripts in the last year.

Scripts used to create container and cause the issue

## command for creating container
$parameters = @{
    "Accept_Eula" = $true
    "Accept_Outdated" = $true
}
...
    New-BCContainer @Parameters `
    -doNotCheckHealth `
    -updateHosts `
    -containerName $containerName `
    -artifactUrl $ENV:artifactUrl `
    -alwaysPull:$alwaysPull `
    -auth "NavUserPassword" `
    -Credential $credential `
    -additionalParameters $additionalParameters `
    -doNotUseRuntimePackages `
    -PublicDnsName <redacted> `
    -TimeZoneId "Central European Standard Time" `
    -useTraefik `
    -includeTestToolkit `
    -includeTestLibrariesOnly `
    -enableTaskScheduler:$false `
    -accept_insiderEula

## run-tests CI script ################
if (-not ($credential)) {
    $securePassword = try { $ENV:PASSWORD | ConvertTo-SecureString } catch { ConvertTo-SecureString -String $ENV:PASSWORD -AsPlainText -Force }
    $credential = New-Object PSCredential -ArgumentList $ENV:USERNAME, $SecurePassword
}

[string] $JUnitresultFileName = Join-Path $ENV:COMMON_TESTRESULTSDIRECTORY "/TEST-Junitresults.xml"
$disabledTests = (Get-Content (Join-Path $ENV:CiRoot "disabledTests.json") | ConvertFrom-Json)

Run-TestsInBcContainer -containerName $containerName `
    -detailed `
    -extensionId $testAppId `
    -credential $credential `
    -ReRun `
    -JUnitResultFileName $JUnitresultFileName `
    -disabledTests $disabledTests `
    -returnTrueIfAllPassed `
    -AzureDevOps error

Full output of scripts

2025-01-23T08:25:16.7989198Z BcContainerHelper version 6.0.30
2025-01-23T08:25:17.1224316Z Setting containerHelperFolder = c:\programdata\navcontainerhelper
2025-01-23T08:25:17.1389088Z Setting PartnerTelemetryConnectionString = InstrumentationKey=<redacted>
2025-01-23T08:25:17.1450910Z Setting hostHelperFolder = c:\programdata\navcontainerhelper
2025-01-23T08:25:17.1700848Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2025-01-23T08:25:17.2518039Z Running on Windows, PowerShell 5.1.17763.5576
2025-01-23T08:25:19.2856389Z Using Container
2025-01-23T08:25:25.0534478Z Connecting to https://<redacted>/ContainerName/cs?tenant=default
2025-01-23T08:25:28.3441195Z CommunicationError : The SSL connection could not be established, see inner exception.
2025-01-23T08:25:28.3454972Z at <ScriptBlock>, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 93
2025-01-23T08:25:28.3466393Z at AwaitState, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 222
2025-01-23T08:25:28.3484469Z at OpenSession, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 200
2025-01-23T08:25:28.3493661Z at Initialize, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 61
2025-01-23T08:25:28.3501060Z at ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 28
2025-01-23T08:25:28.3508720Z at New-ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\PsTestFunctions.ps1: line 45
2025-01-23T08:25:28.3519457Z at <ScriptBlock>, <No file>: line 58
2025-01-23T08:25:37.8241018Z at AwaitState, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 234
2025-01-23T08:25:37.8259464Z at OpenSession, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 200
2025-01-23T08:25:37.8282429Z at Initialize, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 61
2025-01-23T08:25:37.8298891Z at ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 28
2025-01-23T08:25:37.8309455Z at New-ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\PsTestFunctions.ps1: line 45
2025-01-23T08:25:37.8319249Z at <ScriptBlock>, <No file>: line 58
2025-01-23T08:25:37.8455694Z ClientSession State is Uninitialized (Wait time 10 seconds)
2025-01-23T08:25:37.8465864Z 
2025-01-23T08:25:37.8480853Z Exception Script Stack Trace:
2025-01-23T08:25:37.8496506Z at AwaitState, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 234
2025-01-23T08:25:37.8506830Z at OpenSession, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 200
2025-01-23T08:25:37.8517002Z at Initialize, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 61
2025-01-23T08:25:37.8527059Z at ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\ClientContext.ps1: line 28
2025-01-23T08:25:37.8537567Z at New-ClientContext, C:\programdata\navcontainerhelper\Extensions\ContainerName\PsTestTool\PsTestFunctions.ps1: line 45
2025-01-23T08:25:37.8547462Z at <ScriptBlock>, <No file>: line 58
2025-01-23T08:25:37.8552992Z 
2025-01-23T08:25:37.8563704Z PowerShell Call Stack:
2025-01-23T08:25:37.8576399Z at Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.30\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 71
2025-01-23T08:25:37.8584310Z at Run-TestsInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.30\AppHandling\Run-TestsInNavContainer.ps1: line 431
2025-01-23T08:25:37.8591459Z at <ScriptBlock>, C:\agent\_work\81\s\<Redacted>\Run-Tests.ps1: line 27
2025-01-23T08:25:37.8599559Z at <ScriptBlock>, C:\agent\_work\_temp\298d12d6-c650-4edf-b334-d8488ae01af3.ps1: line 4
2025-01-23T08:25:37.8609520Z at <ScriptBlock>, <No file>: line 1
2025-01-23T08:25:38.2910693Z 
2025-01-23T08:25:38.2925705Z Container Free Physical Memory: 7.7Gb
2025-01-23T08:25:38.2939049Z Disk C: Free 13Gb from 20Gb
2025-01-23T08:25:38.2947102Z 
2025-01-23T08:25:38.2960548Z Services in container ContainerName:
2025-01-23T08:25:38.2973684Z - MicrosoftDynamicsNavServer$BC is Running
2025-01-23T08:25:38.2986969Z - MSSQL$SQLEXPRESS is Running
2025-01-23T08:25:39.6650294Z Run-TestsInBcContainer Telemetry Correlation Id: 673f95f4-309b-456c-9575-52527707d059
2025-01-23T08:25:40.0487111Z ##[error]ClientSession State is Uninitialized (Wait time 10 seconds)
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.30\AppHandling\Run-TestsInNavContainer.ps1:571 char
:17
+                 throw $_.Exception.Message
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (ClientSession S...ime 10 seconds):String) [], RuntimeException
    + FullyQualifiedErrorId : ClientSession State is Uninitialized (Wait time 10 seconds)
2025-01-23T08:25:40.0517426Z ##[error]PowerShell exited with code '1'.
2025-01-23T08:25:40.1109099Z ##[section]Finishing: Run Tests

Screenshots

Image

Additional context

  • does it happen all the time?
    Yes, ever since November of 2024.
  • did it use to work?
    Yes.
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@ejwoerlee
Copy link

ejwoerlee commented Jan 27, 2025

See also: Run-TestsInBCContainer Running 401 (Unauthorized) [https://github.com//issues/3783]

@freddydk
Copy link
Contributor

Have you tried this without traefik?

@lbev7
Copy link
Author

lbev7 commented Jan 29, 2025

Hi Freddy,
We tested the build with Traefik disabled, and everything seems to be working. However, could you provide more information on why this issue occurred in the first place? What has actually changed since versions 26.0.25383.0/26.0.25330.0?

Is the absence of Traefik in the builds of newer versions planned by design, or is it a temporary technical issue?

@freddydk
Copy link
Contributor

Absence of Traefik??? - not sure what you are referring to.

I was just asking whether this was a traefik problem or it was caused by something else.
Typically traefik has worked just fine.
Have you tested traefik with earlier versions (24 or 25)?

@lbev7
Copy link
Author

lbev7 commented Jan 29, 2025

Seems to be issue with Traefik since NextMajor builds now work fine with Traefik disabled.

All builds prior to 26.0.25383.0/26.0.25330.0 were running with Traefik enabled and there were no issues.

@freddydk
Copy link
Contributor

freddydk commented Jan 29, 2025

I disagree - Traefik hasn't changed - BC has changed.
It seems like something has changed in BC to make it no longer work behind traefik.
Can you login to the Web Client in a browser using Traefik and the latest NextMajor?

@lbev7
Copy link
Author

lbev7 commented Jan 30, 2025

I was able to log via Web Client with Traefik active (NextMajor Version: W1 26.0 - Platform 26.0.29477.0 + Application 26.0.29555.0).

Let me know if you need anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants