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

Build-Agent Issues after installing BCCH 6.0.17 #3527

Open
epernst opened this issue May 1, 2024 · 17 comments
Open

Build-Agent Issues after installing BCCH 6.0.17 #3527

epernst opened this issue May 1, 2024 · 17 comments
Assignees

Comments

@epernst
Copy link
Contributor

epernst commented May 1, 2024

After I have installed Powershell Core (7.4.2) to our build agents I have started to see different errors when running our pipelines.

First our function to add new SQL users failed with:
Exception calling "Load" with "1" argument(s): "Could not load file or assembly 'Microsoft.SqlServer.SMO, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified."
This I could fix by changing the version specific load to:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO")

But after fixing it here, then it failed with the same error when we change the container to run Multi-Tenant, when running Export-NavApplication. I fixed that by adding the same load part you use in Restore-BcDatabaseFromArtifacts.

After fixing this, it failed when I was trying to mount the new tenant. Saying that server was not multitenant. Despite I had been running this statement first:
Set-NAVServerConfiguration -ServerInstance $ServerInstance -KeyName 'Multitenant' -KeyValue 'true' -ApplyTo ConfigFile -WarningAction SilentlyContinue
Changing this to:
Set-NAVServerConfiguration -ServerInstance $ServerInstance -KeyName 'Multitenant' -KeyValue 'true' -ApplyTo ConfigFile -Force -WarningAction Continue
This gave a new error: Processing data for a remote command failed with the following error message: The WSMan provider host process did not return a proper response. A provider in the host process may have behaved improperly.

I have no idea, how installing Powershell 7.4 can cause this effect, or if there has been any other updates to how the BC images are created, that could cause this. But I hope someone has experienced something similar, or have another input to what could be wrong.

Selected Logs from create new container:
BcContainerHelper is version 6.0.17
BcContainerHelper is running as administrator
HyperV is Disabled
Host is Microsoft Windows Server 2019 Datacenter - 10.0.17763.5696
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is allow
UseSslForWinRmSession is True
Docker Client Version is 26.1.1
Docker Server Version is 26.1.1
Style: onprem
Multitenant: No
Version: 14.44.49619.0
Platform: 14.0.49616.0
Generic Tag: 1.0.2.20
Container OS Version: 10.0.17763.5696 (ltsc2019)
Host OS Version: 10.0.17763.5696 (ltsc2019)

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

Why are you installing PS Core on the build agents?
Are you running your scripts in PS7 as well?

Are you running Set-NAVServerConfiguration in the container or on the host?

@epernst
Copy link
Contributor Author

epernst commented May 1, 2024

Well I'm installing PowerShell 7.4.2 (https://github.com/PowerShell/PowerShell/releases) - assumed that was the same as Powershell Core?
But I'm not specifying pwsh=true and not using it. Just installing it because ALOps requires it to work, but not using it here.

The Set-NAVServerConfiguration is running inside the host with Invoke-ScriptInBcContainer.

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

The Set-NAVServerConfiguration is running inside the host with Invoke-ScriptInBcContainer.

You mean it is running inside the container - right?
The host is the machine on which the container is running.

Inside the container - PS7 is installed and configured - and for containers - PS7 is not needed on the host.

Are you running any invoke-sqlcmd's on the host or are they running in the container as well?

@epernst
Copy link
Contributor Author

epernst commented May 1, 2024

Yes, you are right - it's running inside the container.
I also have a Invoke-SQLCmd statement that runs inside the container.

But you're saying that we don't need to install PS7 on the host/agent?
And how about DotNet 8? Is that also not required on the host/agent?

PS: I'm right now waiting for an updated version of our agents, without PS7 installed - just to see if the problems goes away again by doing so, of if there is another issue.

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

That is ALOps - I cannot say what requirements they have.
I can only say that for AL-Go for GitHub, BcContainerHelper - PS7 and DotNet 8 is NOT required on the host.
ALOps might have other reasons for requiring these things.

But... - when using BcContainerHelper alone, PS5 and PS7 on the host are both fine.

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

And... - since you are using BC 14 (I see in your log) - you really shouldn't need PS7 at all and you definitely shouldn't create a pwsh session in the container - that ONLY works with BC24.

@epernst
Copy link
Contributor Author

epernst commented May 1, 2024

I tried to revert my agent build repo to how they were when the last time it ran successful. Which was last Friday. Running it without installing DotNet8 and PS7, same but same OS version etc. This failed with the same "The WSMan provider host process" error as mentioned above.
The only other difference was the BCCH was now 6.0.17. Reverting my script installed with requiredversion=6.0.15 worked as a charm.
To me that seems related to BcContainerHelper version 6.0.17.

As for BC 14, this is from my BC 14 test pipeline. We have other Pipelines running both v23 and v24 using the same build agents.

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

I would need full logs (and if possible a script with a repro) if I am to look at anything.
There are so many differences in how things are running inside the container.

@freddydk
Copy link
Contributor

freddydk commented May 1, 2024

Also, I would always ask people to try using a Hosted agent from ADO or GitHub to see whether this is your agents or it ia indeed ContainerHelper or like.

@epernst epernst changed the title Build-Agent Issues after installing Powershell Core Build-Agent Issues after installing BCCH 6.0.17 May 2, 2024
@epernst
Copy link
Contributor Author

epernst commented May 2, 2024

I decided to spend a bit more time on trying to fix the issues, instead of the same amount on collecting the logs and scripts we use. Because I could see that the error only occurred in connection to specific scenarios where I either change to/from multitenancy (using Export-NAVApplication and Remove-NAVApplication etc and creating a user via Invoke-SQLCmd) and places where I had previously been using version specific "12.0.0.0".
Changing the version specific load to a load with LoadWithPartialName and no version worked for Invoke-SQLCmd, but not for the cases with xxx-NavApplication. Here I had to use the more complex way, that you also use in Restore-BcDatabaseFromArtifacts.

In regards to the second error, then I just moved changing the call to Set-NAVServerConfiguration to change the Multitenant setting into its own call to Invoke-ScriptInBcContainer call. I remembered that I had experienced something similar in a different script 4-5 years ago, and moved other calls to Set-NAVServerConfiguration into they own Invoke.

I'm not quite sure what in 6.0.17 broke this, but if anyone runs into the same issues and don't know how to solve it, then reply here or contact me for more information.

@freddydk
Copy link
Contributor

freddydk commented May 2, 2024

Invoke-SqlCmd should be available for use in Invoke-ScriptInBcContainer automatically - you shouldn't have to load any special stuff????
What module are you loading?

@epernst
Copy link
Contributor Author

epernst commented May 2, 2024

Do you mean besides Microsoft.SqlServer.Smo?
To be able to call
Invoke-Sqlcmd -serverinstance "$($Config.DatabaseServer)$($Config.DatabaseInstance)" -Database $tenant.DatabaseName -query 'CREATE USER "NT AUTHORITY\SYSTEM" FOR LOGIN "NT AUTHORITY\SYSTEM";'
I also have to load Microsoft.SqlServer.SmoExtended and Microsoft.SqlServer.ConnectionInfo.

@freddydk
Copy link
Contributor

freddydk commented May 3, 2024

If I run this script:

$auth = "UserPassword"
$containerName = "bc24"
$credential = New-Object pscredential -ArgumentList 'admin', $PasswordSecret.SecretValue
$artifactUrl = Get-BcArtifactUrl -country us -select Latest

New-BCContainer -containerName $containerName `
                -accept_eula `
                -Auth $auth `
                -artifactUrl $artifactUrl `
                -Credential $credential

Invoke-ScriptInBcContainer -containerName $containerName -scriptblock {
    Write-Host "Running $($PSVersionTable.PSVersion)"
    Invoke-Sqlcmd -serverinstance localhost\SQLEXPRESS -Database CRONUS -query 'CREATE USER "NT AUTHORITY\SYSTEM" FOR LOGIN "NT AUTHORITY\SYSTEM";'
}

It works just fine (except for failing with User, group, or role 'NT AUTHORITY\SYSTEM' already exists in the current database.)
But Invoke-SqlCmd is available when invoking scripts in the container.

This works for BC24 (running PowerShell 7 with SqlServer PowerShell module version 22.2 installed in the generic image with overrides in psoverrides.ps1 because the latest Invoke-SqlCmd added a new parameter)
And it works for BC23 (running in PowerShell 5.1, using SQLPS, which is autoloaded)

@epernst
Copy link
Contributor Author

epernst commented May 3, 2024

The above script worked fine. So I tried with something that looked a bit more like our own code, but still only using "your" code. And here I were able to get the same errors.

      - powershell: |
          $auth = "UserPassword"
          $containerName = "bc14"
          $Credential = New-Object PSCredential 'Admin', (ConvertTo-SecureString -String 'NotSoImportant1!' -AsPlainText -Force)
          $artifactUrl = Get-BcArtifactUrl -country w1 -type onprem -select Latest -version 14.44
          $imageName = 'dbc/onprem:14.44.49619.0-w1'

          $imageParams = @{
              artifactUrl               = $artifactUrl
              imageName                 = $imageName 
              multitenant               = $false
              skipIfImageAlreadyExists  = $true
          }
          $imageName = New-BcImage @imageParams

          New-BCContainer -containerName $containerName `
                          -accept_eula `
                          -Auth $auth `
                          -artifactUrl $artifactUrl `
                          -Credential $credential `
                          -updateHosts `
                          -locale da-DK `
                          -alwaysPull `
                          -imageName $imageName

          $Tenant = Get-BCContainerTenants -containerName $containerName
          $config = Get-BcContainerServerConfiguration -ContainerName $containerName
          Invoke-ScriptInBcContainer -containerName $containerName -scriptblock {
              param( $Tenant, $Config )

              Write-Host "Running $($PSVersionTable.PSVersion)"

              $null = Get-NAVServerInstance -ServerInstance $ServerInstance | Set-NavServerInstance -Stop -Force -Verbose
              Copy-NavDatabase -SourceDatabaseName $config.databaseName -DestinationDatabaseName 'tenant'
              Write-Host "Removing database $config.databaseName"
              Remove-NavDatabase -DatabaseName $config.databaseName
              try {
                  Invoke-Sqlcmd -serverinstance "$($config.DatabaseServer)\$($config.DatabaseInstance)" -Database 'tenant' -query 'CREATE USER "NT AUTHORITY\SYSTEM" FOR LOGIN "NT AUTHORITY\SYSTEM";'
              } catch { }
              $null = Export-NAVApplication -DatabaseServer $config.DatabaseServer -DatabaseInstance $config.DatabaseInstance -DatabaseName 'tenant' -DestinationDatabaseName $config.databaseName -Force -ServiceAccount 'NT AUTHORITY\SYSTEM' 
              $null = Remove-NAVApplication -DatabaseServer $config.DatabaseServer -DatabaseInstance $config.DatabaseInstance -DatabaseName 'tenant' -Force 
          } -argumentList $Tenant, $Config
          Remove-BCContainer -containerName $containerName

        displayName: Test standard build for V14
        errorActionPreference: stop

The log for this task:

2024-05-03T11:30:51.9114880Z BcContainerHelper version 6.0.17
2024-05-03T11:30:52.2397403Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2024-05-03T11:30:52.4210829Z Running on Windows, PowerShell 5.1.17763.5696
2024-05-03T11:30:58.2025885Z Fetching all docker images
2024-05-03T11:30:58.2844758Z Building image dbc/onprem:14.44.49619.0-w1 based on mcr.microsoft.com/businesscentral:ltsc2019 with https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/14.44.49619.0/w1
2024-05-03T11:30:58.2872655Z Pulling latest image mcr.microsoft.com/businesscentral:ltsc2019
2024-05-03T11:30:58.7280912Z ltsc2019: Pulling from businesscentral
2024-05-03T11:30:58.7310453Z Digest: sha256:b25e1506c6b5feb87d37ba07147453f95d74cebb1292d2b514c62173c9bc7130
2024-05-03T11:30:58.8274702Z Generic Tag: 1.0.2.20
2024-05-03T11:30:58.8986840Z Container OS Version: 10.0.17763.5696 (ltsc2019)
2024-05-03T11:30:58.9003213Z Host OS Version: 10.0.17763.5696 (ltsc2019)
2024-05-03T11:30:58.9084379Z Using process isolation
2024-05-03T11:30:58.9239230Z Files in c:\bcartifacts.cache\xvp2f425.540\my:
2024-05-03T11:30:58.9326625Z Copying Platform Artifacts
2024-05-03T11:30:58.9436934Z c:\bcartifacts.cache\onprem\14.44.49619.0\platform
2024-05-03T11:31:13.3465111Z Copying Database
2024-05-03T11:31:18.8647613Z Copying Licensefile
2024-05-03T11:31:18.9641704Z c:\bcartifacts.cache\xvp2f425.540
2024-05-03T11:31:32.6978185Z Sending build context to Docker daemon 1.175GB
2024-05-03T11:31:32.6991337Z
2024-05-03T11:31:32.8477757Z Step 1/6 : FROM mcr.microsoft.com/businesscentral:ltsc2019
2024-05-03T11:31:32.8536538Z ---> aa1f513a4b46
2024-05-03T11:31:32.8558361Z Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=N artifactUrl=https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/onprem/14.44.49619.0/w1 filesOnly=False
2024-05-03T11:31:32.9098225Z ---> Running in c4653d9cd6e3
2024-05-03T11:31:33.8193568Z ---> Removed intermediate container c4653d9cd6e3
2024-05-03T11:31:33.8212968Z ---> 776c1ed1540d
2024-05-03T11:31:33.8233512Z Step 3/6 : COPY my /run/
2024-05-03T11:31:34.4989611Z ---> 33b9eae825f4
2024-05-03T11:31:34.5012344Z Step 4/6 : COPY NAVDVD /NAVDVD/
2024-05-03T11:32:09.4464600Z ---> 9a196e4385f7
2024-05-03T11:32:09.4482174Z Step 5/6 : RUN \Run\start.ps1 -installOnly
2024-05-03T11:32:09.5040376Z ---> Running in 1df34ffbb37f
2024-05-03T11:32:34.8602074Z c:\run\my folder doesn't exist, creating it
2024-05-03T11:32:35.5036040Z Using DVD installer from C:\Run\130
2024-05-03T11:32:35.9240042Z Installing Business Central: InstallOnly=True
2024-05-03T11:32:35.9574686Z Installing Url Rewrite
2024-05-03T11:32:40.0691450Z Installing OpenXML
2024-05-03T11:32:43.2000079Z Installing DotNetCore
2024-05-03T11:33:02.4477340Z Starting Local SQL Server
2024-05-03T11:33:07.7456620Z Starting Internet Information Server
2024-05-03T11:33:08.1659046Z Copying Service Tier Files
2024-05-03T11:33:10.0152613Z Copying Web Client Files
2024-05-03T11:33:13.4992232Z Copying Windows Client Files
2024-05-03T11:33:15.3899048Z Copying PowerShell Scripts
2024-05-03T11:33:15.4982770Z Copying ConfigurationPackages
2024-05-03T11:33:15.5185404Z Copying Test Assemblies
2024-05-03T11:33:15.5327840Z Copying TestToolKit
2024-05-03T11:33:15.6482905Z Copying UpgradeToolKit
2024-05-03T11:33:15.6675668Z Copying Extensions
2024-05-03T11:33:15.7299693Z Copying ClientUserSettings
2024-05-03T11:33:15.8726224Z Copying ReportBuilder
2024-05-03T11:33:43.5643989Z Restoring CRONUS Demo Database
2024-05-03T11:33:43.5846705Z Restoring CRONUS Demo Database
2024-05-03T11:33:46.3796075Z Modifying Business Central Service Tier Config File for Docker
2024-05-03T11:33:46.4091141Z Creating Business Central Service Tier
2024-05-03T11:33:46.5043478Z Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
2024-05-03T11:33:46.9025669Z Starting Business Central Service Tier
2024-05-03T11:34:24.6805997Z Importing CRONUS license file
2024-05-03T11:34:25.3373181Z Generating Symbol Reference
2024-05-03T11:40:01.4863843Z Stopping Business Central Service Tier
2024-05-03T11:40:01.7623131Z Installation took 446 seconds
2024-05-03T11:40:01.7648435Z Installation complete
2024-05-03T11:41:52.9194820Z ---> Removed intermediate container 1df34ffbb37f
2024-05-03T11:41:52.9213608Z ---> dcb19f8e5818
2024-05-03T11:41:52.9232082Z Step 6/6 : LABEL legal="http://go.microsoft.com/fwlink/?LinkId=837447" created="202405031131" nav="" cu="" country="w1" version="14.44.49619.0" platform="14.0.49616.0"
2024-05-03T11:41:52.9758526Z ---> Running in 661c355b29f5
2024-05-03T11:41:53.5434411Z ---> Removed intermediate container 661c355b29f5
2024-05-03T11:41:53.5452503Z ---> 386060b050d2
2024-05-03T11:41:55.1432977Z Successfully built 386060b050d2
2024-05-03T11:41:55.1503758Z Successfully tagged dbc/onprem:14.44.49619.0-w1
2024-05-03T11:41:55.1635674Z Building image took 657 seconds
2024-05-03T11:41:58.0649687Z BcContainerHelper is version 6.0.17
2024-05-03T11:41:58.0663154Z BcContainerHelper is running as administrator
2024-05-03T11:41:59.5595990Z HyperV is Disabled
2024-05-03T11:41:59.5626838Z Host is Microsoft Windows Server 2019 Datacenter - 10.0.17763.5696
2024-05-03T11:41:59.5658866Z UsePsSession is True
2024-05-03T11:41:59.5689831Z UsePwshForBc24 is True
2024-05-03T11:41:59.5703391Z UseWinRmSession is allow
2024-05-03T11:41:59.5734965Z UseSslForWinRmSession is True
2024-05-03T11:41:59.7431198Z Docker Client Version is 26.1.1
2024-05-03T11:41:59.7449058Z Docker Server Version is 26.1.1
2024-05-03T11:42:00.0488538Z Removing Session bc14
2024-05-03T11:42:00.1326735Z Removing container bc14
2024-05-03T11:42:01.8094970Z Removing entries from hosts
2024-05-03T11:42:01.8377590Z Removing bc14 from container hosts file
2024-05-03T11:42:01.9490206Z Removing bc14-* from container hosts file
2024-05-03T11:42:01.9555920Z Removing Desktop shortcuts
2024-05-03T11:42:02.0201968Z Removing C:\ProgramData\BcContainerHelper\Extensions\bc14
2024-05-03T11:42:02.4745515Z Fetching all docker images
2024-05-03T11:42:02.5680939Z Fetching all docker volumes
2024-05-03T11:42:02.6332381Z ArtifactUrl and ImageName specified
2024-05-03T11:42:03.1526496Z Image dbc/onprem:14.44.49619.0-w1 already exists
2024-05-03T11:42:03.7911130Z Using image dbc/onprem:14.44.49619.0-w1
2024-05-03T11:42:03.8696947Z Creating Container bc14
2024-05-03T11:42:03.8741764Z Style: onprem
2024-05-03T11:42:03.8757578Z Multitenant: No
2024-05-03T11:42:03.8771519Z Version: 14.44.49619.0
2024-05-03T11:42:03.8800338Z Platform: 14.0.49616.0
2024-05-03T11:42:03.8822240Z Generic Tag: 1.0.2.20
2024-05-03T11:42:03.8863147Z Container OS Version: 10.0.17763.5696 (ltsc2019)
2024-05-03T11:42:03.8891114Z Host OS Version: 10.0.17763.5696 (ltsc2019)
2024-05-03T11:42:03.8992493Z Using process isolation
2024-05-03T11:42:03.9010747Z Using locale da-DK
2024-05-03T11:42:03.9074533Z Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
2024-05-03T11:42:03.9784045Z Additional Parameters:
2024-05-03T11:42:03.9808198Z --expose 5986
2024-05-03T11:42:03.9820367Z Files in C:\ProgramData\BcContainerHelper\Extensions\bc14\my:
2024-05-03T11:42:03.9877873Z - AdditionalOutput.ps1
2024-05-03T11:42:03.9897088Z - AdditionalSetup.ps1
2024-05-03T11:42:03.9911478Z - HelperFunctions.ps1
2024-05-03T11:42:03.9925615Z - MainLoop.ps1
2024-05-03T11:42:03.9942165Z - SetupVariables.ps1
2024-05-03T11:42:03.9956906Z - updatehosts.ps1
2024-05-03T11:42:03.9974420Z Creating container bc14 from image dbc/onprem:14.44.49619.0-w1
2024-05-03T11:42:04.1266888Z 15819e7e0f186951dbc33eb8349ef009dc03663a485aaee0261d956deb392505
2024-05-03T11:42:06.2141001Z Waiting for container bc14 to be ready
2024-05-03T11:42:28.9610329Z Initializing...
2024-05-03T11:42:28.9610780Z Setting host.containerhelper.internal to 172.29.192.1 in container hosts file
2024-05-03T11:42:28.9611032Z Starting Container
2024-05-03T11:42:28.9611246Z Hostname is bc14
2024-05-03T11:42:30.0475504Z PublicDnsName is bc14
2024-05-03T11:42:30.0476057Z Using NavUserPassword Authentication
2024-05-03T11:42:32.2154877Z Starting Local SQL Server
2024-05-03T11:42:32.2155641Z Starting Internet Information Server
2024-05-03T11:42:33.2923373Z Creating Self Signed Certificate
2024-05-03T11:42:33.2927169Z Self Signed Certificate Thumbprint 785DC3C6C4C0E89C81D6450C2B8D9F774A8AD5CA
2024-05-03T11:42:33.2927442Z DNS identity bc14
2024-05-03T11:42:33.2927644Z Modifying Service Tier Config File with Instance Specific Settings
2024-05-03T11:43:16.9670310Z Starting Service Tier
2024-05-03T11:43:16.9671648Z Registering event sources
2024-05-03T11:43:16.9672144Z Creating DotNetCore Web Server Instance
2024-05-03T11:43:16.9672567Z Using application pool name: NAV
2024-05-03T11:43:18.0844655Z Using default container name: NavWebApplicationContainer
2024-05-03T11:43:20.8468907Z Copy files to WWW root C:\inetpub\wwwroot\NAV
2024-05-03T11:43:21.9305080Z Create the application pool NAV
2024-05-03T11:43:24.3172682Z Create website: NavWebApplicationContainer without SSL
2024-05-03T11:43:24.3173315Z Update configuration: navsettings.json
2024-05-03T11:43:25.4036573Z Done Configuring Web Client
2024-05-03T11:43:25.4037228Z Creating http download site
2024-05-03T11:43:27.2491398Z Setting SA Password and enabling SA
2024-05-03T11:43:28.3157187Z Creating Admin as SQL User and add to sysadmin
2024-05-03T11:43:29.5952402Z Creating SUPER user
2024-05-03T11:43:49.5706303Z Enable PSRemoting and setup user for winrm
2024-05-03T11:44:16.2695544Z �[33;1mWARNING: Waiting for service 'Windows Remote Management (WS-Management) (winrm)' to stop...�[0m
2024-05-03T11:44:17.3527118Z Creating self-signed certificate for winrm
2024-05-03T11:44:17.3527727Z Container IP Address: 172.29.206.216
2024-05-03T11:44:17.3528092Z Container Hostname : bc14
2024-05-03T11:44:17.3528309Z Container Dns Name : bc14
2024-05-03T11:44:17.3528528Z Web Client : http://bc14/NAV/
2024-05-03T11:44:17.3528751Z Dev. Server : http://bc14
2024-05-03T11:44:17.3528962Z Dev. ServerInstance : NAV
2024-05-03T11:44:17.3529206Z Setting bc14 to 172.29.206.216 in host hosts file
2024-05-03T11:44:17.3529331Z
2024-05-03T11:44:17.3529501Z Files:
2024-05-03T11:44:17.3530263Z http://bc14:8080/ALLanguage.vsix
2024-05-03T11:44:17.3530468Z
2024-05-03T11:44:17.3530699Z Container Total Physical Memory is 32.0Gb
2024-05-03T11:44:17.3531300Z Container Free Physical Memory is 25.9Gb
2024-05-03T11:44:17.3531467Z
2024-05-03T11:44:17.3531712Z Initialization took 110 seconds
2024-05-03T11:44:17.3539358Z Ready for connections!
2024-05-03T11:44:20.7916951Z Reading CustomSettings.config from bc14
2024-05-03T11:44:21.3641948Z Creating Desktop Shortcuts for bc14
2024-05-03T11:44:21.5459327Z Container bc14 successfully created
2024-05-03T11:44:21.7688011Z
2024-05-03T11:44:21.7700253Z Use:
2024-05-03T11:44:21.7727181Z Get-BcContainerEventLog -containerName bc14 to retrieve a snapshot of the event log from the container
2024-05-03T11:44:21.7754846Z Get-BcContainerDebugInfo -containerName bc14 to get debug information about the container
2024-05-03T11:44:21.7786477Z Enter-BcContainer -containerName bc14 to open a PowerShell prompt inside the container
2024-05-03T11:44:21.7818323Z Remove-BcContainer -containerName bc14 to remove the container again
2024-05-03T11:44:21.7850471Z docker logs bc14 to retrieve information about URL's again
2024-05-03T11:44:24.2192997Z Running 5.1.17763.5696
2024-05-03T11:44:24.2221268Z VERBOSE: Performing the operation "Set-NAVServerInstance" on target "ServerInstance = MicrosoftDynamicsNavServer$NAV,
2024-05-03T11:44:24.2223085Z Start = False, Stop = True, Restart = False".
2024-05-03T11:44:24.2234515Z VERBOSE: Attempting to stop service MicrosoftDynamicsNavServer$NAV
2024-05-03T11:44:27.2673347Z VERBOSE: Service MicrosoftDynamicsNavServer$NAV is stopped
2024-05-03T11:44:27.2678095Z Copying Database on localhost\SQLEXPRESS from CRONUS to tenant
2024-05-03T11:44:28.0680969Z Taking database CRONUS offline
2024-05-03T11:44:28.0688032Z Copying database files
2024-05-03T11:44:28.7618737Z Attaching files as new Database tenant
2024-05-03T11:44:29.6471526Z Putting database CRONUS back online
2024-05-03T11:44:29.6522298Z Removing Database CRONUS from localhost\SQLEXPRESS
2024-05-03T11:44:29.6702929Z Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
2024-05-03T11:44:29.6711100Z
2024-05-03T11:44:29.6724491Z Exception Script Stack Trace:
2024-05-03T11:44:29.6750926Z at , : line 13
2024-05-03T11:44:29.6758844Z
2024-05-03T11:44:29.6770762Z PowerShell Call Stack:
2024-05-03T11:44:29.6790004Z at Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.17\ContainerHandling\Invoke-ScriptInNavContainer.ps1: line 71
2024-05-03T11:44:29.6800017Z at , C:\a_temp\7e4b0f19-c7fc-48c7-816c-a0bd3644b8cf.ps1: line 30
2024-05-03T11:44:29.6813614Z at , : line 1
2024-05-03T11:44:30.4369952Z
2024-05-03T11:44:30.4405292Z Container Free Physical Memory: 27.8Gb
2024-05-03T11:44:30.4405655Z
2024-05-03T11:44:30.4406054Z Services in container bc14:
2024-05-03T11:44:30.4406483Z - MicrosoftDynamicsNavServer$NAV is Stopped
2024-05-03T11:44:30.4406955Z - MSSQL$SQLEXPRESS is Running
2024-05-03T11:44:30.4407104Z
2024-05-03T11:44:30.5733720Z Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=12.0.0.0, Culture=neutral,
2024-05-03T11:44:30.5734506Z PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
2024-05-03T11:44:30.5734790Z At C:\Program
2024-05-03T11:44:30.5735151Z Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.17\ContainerHandling\Invoke-ScriptInNavContainer.ps1:112 char:13
2024-05-03T11:44:30.5735517Z + throw $errorMessage
2024-05-03T11:44:30.5736498Z + ~~~~~~~~~~~~~~~~~~~
2024-05-03T11:44:30.5736992Z + CategoryInfo : OperationStopped: (Could not load ...file specified.:String) [], RuntimeException
2024-05-03T11:44:30.5738175Z + FullyQualifiedErrorId : Could not load file or assembly 'Microsoft.SqlServer.Smo, Version=12.0.0.0, Culture=neut
2024-05-03T11:44:30.5738831Z ral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
2024-05-03T11:44:30.5739334Z

I'm in the process of running the same test for V23 and V24, and will post the result when I get home.

@epernst
Copy link
Contributor Author

epernst commented May 3, 2024

The same tests with v23 and v24, did not give any errors.
Which is strange, as I also had the "'Microsoft.SqlServer.Smo, Version=12.0.0.0" error with v23 a few days ago.

@freddydk
Copy link
Contributor

freddydk commented May 5, 2024

Tried the script and it looks like Export-NAVApplication in BC14 has a dependency on the smo thingy - not sure which versions has a dependency like this.
I also cannot guarantee that all scripts being executed inside a container will work at all times going forward - there will be changes to the container images causing things to break.

@epernst
Copy link
Contributor Author

epernst commented May 6, 2024

As long as we have a way to fix it, then I'm fine with that.
And hopefully we are out of v14 within the next 12 months!

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

2 participants