Skip to content

[Bug]: Using New-navcontainer with useNewDatabase=true for BC 27.1 fails #4051

@IonelaSmadu

Description

@IonelaSmadu

BCContainerhelper version

6.1.9

Describe the issue

Using this script to create a local container for BC 27.1

$containerName = 'dev27SaaS'
$password = 'Welkom01!'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'devadmin', $securePassword
$auth = 'UserPassword'
$isolation='hyperv'
#$artifactUrl ='https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.0.38460.41176/nl'
$artifactUrl ='https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.1.41698.42333/nl'
$licenseFile = 'C:\REPOS\ERP AL\licenses\dev.bclicense'
$UseNewDatabase = $True

New-BcContainer -accept_eula
-accept_insiderEula -containerName $containerName
-credential $credential -auth $auth
-artifactUrl $artifactUrl -licenseFile $licenseFile
-isolation process -includeAL
-updateHosts -vsixFile (Get-LatestAlLanguageExtensionUrl)
-WebClientPort 8080 `
-useNewDatabase:$UseNewDatabase

gives the following error:

Image

Command or script used to produce the issue

$containerName = 'dev27SaaS'
$password = 'Welkom01!'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'devadmin', $securePassword
$auth = 'UserPassword'
$isolation='hyperv'
#$artifactUrl ='https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.0.38460.41176/nl'
$artifactUrl ='https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.1.41698.42333/nl'
$licenseFile = 'C:\REPOS\ERP AL\licenses\dev.bclicense'
$UseNewDatabase = $True

New-BcContainer -accept_eula
-accept_insiderEula -containerName $containerName
-credential $credential -auth $auth
-artifactUrl $artifactUrl -licenseFile $licenseFile
-isolation process -includeAL
-updateHosts -vsixFile (Get-LatestAlLanguageExtensionUrl)
-WebClientPort 8080 `
-useNewDatabase:$UseNewDatabase

Full output of the command or script

You need to run as administrator or you can run Check-BcContainerHelperPermissions -Fix to fix permissions
BcContainerHelper is version 6.1.9
BcContainerHelper is not running as administrator
Host is Microsoft Windows 11 Enterprise - 10.0.22631.6060
UsePsSession is True
UsePwshForBc24 is True
UseWinRmSession is allow
UseSslForWinRmSession is True
Docker Client Version is 27.4.1
Docker Server Version is 27.4.1
Removing Desktop shortcuts
Downloading artifact /sandbox/27.1.41698.42333/nl
Downloading C:\Users\IonelaDanielaSmadu\AppData\Local\Temp\55e5410e-986c-4ab9-8a5c-118887271433.zip
Unpacking artifact to tmp folder using Expand-Archive
Downloading platform artifact /sandbox/27.1.41698.42333/platform
Downloading C:\Users\IonelaDanielaSmadu\AppData\Local\Temp\88c74cfa-fc19-49e3-a40d-b4f646ac79c2.zip
Unpacking artifact to tmp folder using Expand-Archive
Downloading Prerequisite Components
Downloading c:\bcartifacts.cache\sandbox\27.1.41698.42333\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi
Downloading c:\bcartifacts.cache\sandbox\27.1.41698.42333\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:ltsc2022
Creating Container dev27SaaS
Style: sandbox
Multitenant: Yes
Version: 27.1.41698.42333
Platform: 27.0.42316.0
Generic Tag: 1.0.2.83
Container OS Version: 10.0.20348.4297 (ltsc2022)
Host OS Version: 10.0.22631.6060 (23H2)
Using process isolation
Using locale nl-NL
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Downloading C:\ProgramData\BcContainerHelper\Extensions\dev27SaaS\Microsoft.VisualStudio.Services.VSIXPackage.vsix
Using license file C:\REPOS\ERP AL\licenses\dev.bclicense
Additional Parameters:
--expose 5986
Files in C:\ProgramData\BcContainerHelper\Extensions\dev27SaaS\my:

  • AdditionalOutput.ps1
  • AdditionalSetup.ps1
  • HelperFunctions.ps1
  • license.bclicense
  • MainLoop.ps1
  • SetupVariables.ps1
  • updatehosts.ps1
    Creating container dev27SaaS from image mcr.microsoft.com/businesscentral:ltsc2022
    1ea237e92f861b8e48b07f542efbaffc38436f897895ef055d3d7db77ed4fcbe
    Waiting for container dev27SaaS to be ready
    Using artifactUrl https://bcartifacts-exdbf9fwegejdqak.b02.azurefd.net/sandbox/27.1.41698.42333/nl
    Using installer from C:\Run\270
    Installing Business Central: multitenant=False, installOnly=False, filesOnly=False, includeTestToolkit=False, includeTestLibrariesOnly=False, includeTestFrameworkOnly=False, includePerformanceToolkit=False, appArtifactPath=c:\dl\sandbox\27.1.41698.42333\nl, platformArtifactPa
    th=c:\dl\sandbox\27.1.41698.42333\platform, databasePath=c:\dl\sandbox\27.1.41698.42333\nl\BusinessCentral-NL.bak, licenseFilePath=c:\dl\sandbox\27.1.41698.42333\nl\Cronus.bclicense, rebootContainer=True
    Installing from artifacts
    Starting Local SQL Server
    Starting Internet Information Server
    Copying Service Tier Files
    c:\dl\sandbox\27.1.41698.42333\platform\ServiceTier\pfiles64
    c:\dl\sandbox\27.1.41698.42333\platform\ServiceTier\System64
    Copying Web Client Files
    c:\dl\sandbox\27.1.41698.42333\platform\WebClient\pfiles\Microsoft Dynamics NAV
    Copying ModernDev Files
    c:\dl\sandbox\27.1.41698.42333\platform
    c:\dl\sandbox\27.1.41698.42333\platform\ModernDev\pfiles\Microsoft Dynamics NAV
    Copying additional files
    Copying ConfigurationPackages
    C:\dl\sandbox\27.1.41698.42333\nl\ConfigurationPackages
    Copying Test Assemblies
    C:\dl\sandbox\27.1.41698.42333\platform\Test Assemblies
    Copying Extensions
    C:\dl\sandbox\27.1.41698.42333\nl\Extensions
    Copying Applications
    C:\dl\sandbox\27.1.41698.42333\platform\Applications
    Copying Applications.NL
    C:\dl\sandbox\27.1.41698.42333\nl\Applications.NL
    Copying dependencies
    Importing PowerShell Modules
    Restoring CRONUS Demo Database
    Setting CompatibilityLevel for CRONUS on localhost\SQLEXPRESS
    Modifying Business Central Service Tier Config File for Docker
    Creating Business Central Service Tier
    Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
    Starting Business Central Service Tier
    Importing license file
    Stopping Business Central Service Tier
    Installation took 594 seconds
    Installation complete
    Initializing...
    Setting host.containerhelper.internal to 172.29.240.1 in container hosts file
    Starting Container
    Hostname is dev27SaaS
    PublicDnsName is dev27SaaS
    Using NavUserPassword Authentication
    Creating Self Signed Certificate
    Self Signed Certificate Thumbprint 204A65A990598C33C42186D574552D9E75ABC1E2
    DNS identity dev27SaaS
    Modifying Service Tier Config File with Instance Specific Settings
    Starting Service Tier
    Registering event sources
    Creating DotNetCore Web Server Instance
    Using application pool name: BC
    Using default container name: NavWebApplicationContainer
    Copy files to WWW root C:\inetpub\wwwroot\BC
    Create the application pool BC
    Create website: NavWebApplicationContainer without SSL
    Update configuration: navsettings.json
    Done Configuring Web Client
    Enabling Financials User Experience
    Using license file 'c:\run\my\license.bclicense'
    Import License
    Setting SA Password and enabling SA
    Creating devadmin as SQL User and add to sysadmin
    Creating SUPER user
    Enable PSRemoting and setup user for winrm
    Creating self-signed certificate for winrm
    Container IP Address: 172.29.245.38
    Container Hostname : dev27SaaS
    Container Dns Name : dev27SaaS
    Web Client : http://dev27SaaS:8080/BC/
    Setting dev27SaaS to 172.29.245.38 in host hosts file

Container Total Physical Memory is 63.4Gb
Container Free Physical Memory is 25.2Gb

Initialization took 112 seconds
Ready for connections!
Reading CustomSettings.config from dev27SaaS
Creating Desktop Shortcuts for dev27SaaS
Extracting C:\Applications.NL\Base Application.Source.zip
Cleanup old dotnet core assemblies
Cleanup old dotnet core assemblies
Creating .net Assembly Reference Folder
Copying DLLs from C:\Program Files\dotnet\Shared to assemblyProbingPath
Copying DLLs from C:\Program Files\Microsoft Dynamics NAV\270\Service to assemblyProbingPath
Copying DLLs from C:\Test Assemblies\Mock Assemblies to assemblyProbingPath
Removing dotnet Framework Assemblies
Stopping ServiceTier in order to replace database
Copying Database on localhost\SQLEXPRESS from CRONUS to mytempdb
Taking database CRONUS offline
Copying database files
Attaching files as new Database mytempdb
Putting database CRONUS back online
Removing Database CRONUS from localhost\SQLEXPRESS
Creating new database CRONUS on localhost\SQLEXPRESS with default Collation
Copying table [Entitlement] from original database
Copying table [Entitlement Set] from original database
Copying table [Membership Entitlement] from original database
Removing Database mytempdb from localhost\SQLEXPRESS
Starting Service Tier
Synchronizing
Importing license file
Importing License C:\ProgramData\BcContainerHelper\Extensions\dev27SaaS\my\license.bclicense
Creating Company
Creating company My Company in default
Company successfully created
Publishing System Application
Publishing C:\ProgramData\BcContainerHelper\Extensions\dev27SaaS\a237cbe8-9098-4c89-bd97-8981836ee040\Microsoft_System Application.app
Synchronizing System Application on tenant default
Installing System Application on tenant default
App Microsoft_System Application.app successfully published
Creating user devadmin
Creating User devadmin
Assigning Permission Set SUPER to devadmin
Switching to multitenant
Copying Database on localhost\SQLEXPRESS from CRONUS to tenant
Taking database CRONUS offline
Copying database files
Attaching files as new Database tenant
Putting database CRONUS back online
Removing Database CRONUS from localhost\SQLEXPRESS
Exporting Application to CRONUS
Could not load type 'Microsoft.SqlServer.Management.Common.TransferException' from assembly 'Microsoft.SqlServer.SmoExtended, Version=17.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.

Container Free Physical Memory: 28.1Gb
Disk C: Free 124Gb from 127Gb

Services in container dev27SaaS:
New-BcContainer Telemetry Correlation Id: 89ff272c-be30-4a7f-b408-15229fcf245f
Could not load type 'Microsoft.SqlServer.Management.Common.TransferException' from assembly 'Microsoft.SqlServer.SmoExtended, Version=17.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.
At C:\Users\IonelaDanielaSmadu\OneDrive - Zig Websoftware b.v\Documents\WindowsPowerShell\Modules\BcContainerHelper\6.1.9\ContainerHandling\Invoke-ScriptInNavContainer.ps1:307 char:25

  •                     throw $errorMessage
    
  •                     ~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Could not load ...45dcd8080cc91'.:String) [], RuntimeException
    • FullyQualifiedErrorId : Could not load type 'Microsoft.SqlServer.Management.Common.TransferException' from assembly 'Microsoft.SqlServer.SmoExtended, Version=17.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.

Additional information

No response

Does this happen every time?

No

Did this used to work?

No
Internal work item: AB#613846

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThe issue has been accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions