microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
379 stars 243 forks source link

BCContainerWizard Error Using NAV 2016 CU 45 #1571

Closed GreatScott000 closed 3 years ago

GreatScott000 commented 3 years ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue I am trying to create a new container for NAV 2016 CU45 and I keep getting this error:

Invoke-Expression : The variable cannot be validated because the value 9.0.51476.0 is not a valid value for the Version variable.

There is a CU45 (I have been using it for weeks) and I can get the URL for it.

$url = Get-NavArtifactUrl -nav 2016 -cu 45 -country gb
Download-Artifacts $url -includePlatform -force

Gives me

Downloading application artifact /onprem/9.0.51476.0/gb Downloading C:\Users\micro\AppData\Local\Temp\9a2c6a8b-e214-4e5a-854e-c457541f5fb1.zip Unpacking application artifact to tmp folder using 7zip d:\bcartifacts.cache\onprem\9.0.51476.0\gb Downloading platform artifact /onprem/9.0.51476.0/platform Downloading C:\Users\micro\AppData\Local\Temp\4b30a3fc-0787-4ca5-8fc6-26c175eefa22.zip Unpacking platform artifact to tmp folder using 7zip Downloading Prerequisite Components Downloading d:\bcartifacts.cache\onprem\9.0.51476.0\platform\Prerequisite Components\Open XML SDK 2.5 for Microsoft Office\OpenXMLSDKv25.msi Downloading d:\bcartifacts.cache\onprem\9.0.51476.0\platform\Prerequisite Components\Microsoft Report Viewer 2015\ReportViewer.msi Downloading d:\bcartifacts.cache\onprem\9.0.51476.0\platform\Prerequisite Components\IIS URL Rewrite Module\rewrite_2.0_rtw_x64.msi Downloading d:\bcartifacts.cache\onprem\9.0.51476.0\platform\Prerequisite Components\Microsoft Report Viewer 2015\SQLSysClrTypes.msi Downloading d:\bcartifacts.cache\onprem\9.0.51476.0\platform\Prerequisite Components\DotNetCore\DotNetCore.1.0.4_1.1.1-WindowsHosting.exe d:\bcartifacts.cache\onprem\9.0.51476.0\platform

Scripts used to create container and cause the issue

Invoke-Expression (New-Object System.Net.WebClient).DownloadString("http://aka.ms/bcdockerscript")

Full output of scripts

You are running BcContainerHelper 1.0.17 (which is the latest version)

                             _     ______      _       
     /\                     | |   |  ____|    | |      
    /  \   ___ ___ ___ _ __ | |_  | |__  _   _| | __ _ 
   / /\ \ / __/ __/ _ \ '_ \| __| |  __|| | | | |/ _` |
  / ____ \ (__ (__  __/ |_) | |_  | |____ |_| | | (_| |
 /_/    \_\___\___\___| .__/ \__| |______\__,_|_|\__,_|
                      | |                              
                      |_|                              

This script will generate a script, which can be used to run Business Central in Docker on your computer.
You will be asked a number of questions and the generated script should create a container, which matches your needs.

In order to run Business Central in Docker, you will need to accept the eula.
The supplemental license terms for running Business Central and NAV on Docker can be found here: https://go.microsoft.com/fwlink/?linkid=861843

Please enter Y if you accept the eula (Y, N) y

Y selected

  _                     _    _____            _        _                                                             __      ____  __ 
 | |                   | |  / ____|          | |      (_)                                  /\                        \ \    / /  \/  |
 | |     ___   ___ __ _| | | |     ___  _ __ | |_ __ _ _ _ __   ___ _ __    ___  _ __     /  \   _____   _ _ __ ___   \ \  / /| \  / |
 | |    / _ \ / __/ _` | | | |    / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|  / _ \| '__|   / /\ \ |_  / | | | '__/ _ \   \ \/ / | |\/| |
 | |____ (_) | (__ (_| | | | |____ (_) | | | | |_ (_| | | | | |  __/ |    | (_) | |     / ____ \ / /| |_| | | |  __/    \  /  | |  | |
 |______\___/ \___\__,_|_|  \_____\___/|_| |_|\__\__,_|_|_| |_|\___|_|     \___/|_|    /_/    \_\___|\__,_|_|  \___|     \/   |_|  |_|

Specify where you want to host your Business Central container?

Selecting Local will create a script that needs to run on a computer, which have Docker installed.
Selecting Azure VM shows a Url with which you can create a VM. This requires an Azure Subscription.

a Local docker container
b Docker container in an Azure VM

! accept default answers for the remaining questions
x start over
z go back

Hosting (default a) 

Local docker container selected

                _   _                _   _           _   _             
     /\        | | | |              | | (_)         | | (_)            
    /  \  _   _| |_| |__   ___ _ __ | |_ _  ___ __ _| |_ _  ___  _ __  
   / /\ \| | | | __| '_ \ / _ \ '_ \| __| |/ __/ _` | __| |/ _ \| '_ \ 
  / ____ \ |_| | |_| | | |  __/ | | | |_| | (__ (_| | |_| | (_) | | | |
 /_/    \_\__,_|\__|_| |_|\___|_| |_|\__|_|\___\__,_|\__|_|\___/|_| |_|

Select desired authentication mechanism.
Selecting predefined credentials means that the script will use hardcoded credentials.

Note: When using Windows authentication, you need to use your Windows Credentials from the host computer and if the computer is domain joined, you will need to be connected to the dom
ain while running the container. You cannot use containers with Windows authentication when offline.

a Username/Password authentication
b Username/Password authentication (admin with predefined password - P@ssw0rd)
c Username/Password authentication (admin with random password - Rihy8775)
d Windows authentication

! accept default answers for the remaining questions
x start over
z go back

Authentication (default b) 

Username/Password authentication (admin with predefined password - P@ssw0rd) selected

   _____            _        _                   _   _                      
  / ____|          | |      (_)                 | \ | |                     
 | |     ___  _ __ | |_ __ _ _ _ __   ___ _ __  |  \| | __ _ _ __ ___   ___ 
 | |    / _ \| '_ \| __/ _` | | '_ \ / _ \ '__| | . ` |/ _` | '_ ` _ \ / _ \
 | |____ (_) | | | | |_ (_| | | | | |  __/ |    | |\  | (_| | | | | | |  __/
  \_____\___/|_| |_|\__\__,_|_|_| |_|\___|_|    |_| \_|\__,_|_| |_| |_|\___|

Enter the name of the container.
Container names are case sensitive and must start with a letter.

Note: We recommend short lower case names as container names.

! accept default answers for the remaining questions
Enter x to start over
Enter z to go back

Container name (default bcserver) test2

test2 selected

 __      __           _             
 \ \    / /          (_)            
  \ \  / /__ _ __ ___ _  ___  _ __  
   \ \/ / _ \ '__/ __| |/ _ \| '_ \ 
    \  /  __/ |  \__ \ | (_) | | | |
     \/ \___|_|  |___/_|\___/|_| |_|

What version of Business Central do you need?
If you are developing a Per Tenant Extension for a Business Central Saas tenant, you need a Business Central Sandbox environment

a Latest Business Central Sandbox
b Latest Business Central OnPrem
c Insider Business Central Sandbox for Next Major release (requires insider SAS token from http://aka.ms/collaborate)
d InsiderBusiness Central Sandbox for Next Minor release (requires insider SAS token from http://aka.ms/collaborate)
e Specific Business Central Sandbox build (requires version number)
f Specific Business Central OnPrem build (requires version number)
g Specific NAV 2018 version
h Specific NAV 2017 version
i Specific NAV 2016 version

! accept default answers for the remaining questions
x start over
z go back

Version (default a) i

Specific NAV 2016 version selected

NAV 2016 has 62 released cumulative updates.

! accept default answers for the remaining questions
Enter x to start over
Enter z to go back

Enter CU number (0 is rtm or leave blank for latest) (default latest) 45

45 selected

Invoke-Expression : The variable cannot be validated because the value 9.0.51476.0 is not a valid value for the Version variable.
At D:\PS\CreateContainer.ps1:1 char:1
+ Invoke-Expression (New-Object System.Net.WebClient).DownloadString("h ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [Invoke-Expression], ValidationMetadataException
    + FullyQualifiedErrorId : ValidateSetFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

GreatScott000 commented 3 years ago

Same sort of error if I leave the CU number blank for "latest".

Specific NAV 2016 version selected

NAV 2016 has 62 released cumulative updates.

! accept default answers for the remaining questions Enter x to start over Enter z to go back

Enter CU number (0 is rtm or leave blank for latest) (default latest)

latest selected

Invoke-Expression : The variable cannot be validated because the value 9.0.52001.0 is not a valid value for the Version variable. At D:\PS\CreateContainer.ps1:1 char:1

  • Invoke-Expression (New-Object System.Net.WebClient).DownloadString("h ...
  • 
    + CategoryInfo          : MetadataError: (:) [Invoke-Expression], ValidationMetadataException
    + FullyQualifiedErrorId : ValidateSetFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand
GreatScott000 commented 3 years ago

Seems to happen for any NAV version/CU I try.

GreatScott000 commented 3 years ago

I think it is just "broken". Same error trying to select latest on prem version.


\ \ / / (_)
\ \ / / _ _ _
\ \/ / \ '/ | |/ | ' \ \ / / | \ \ | () | | | | \/ _|| |/_|__/|| |_|

What version of Business Central do you need? If you are developing a Per Tenant Extension for a Business Central Saas tenant, you need a Business Central Sandbox environment

a Latest Business Central Sandbox b Latest Business Central OnPrem c Insider Business Central Sandbox for Next Major release (requires insider SAS token from http://aka.ms/collaborate) d InsiderBusiness Central Sandbox for Next Minor release (requires insider SAS token from http://aka.ms/collaborate) e Specific Business Central Sandbox build (requires version number) f Specific Business Central OnPrem build (requires version number) g Specific NAV 2018 version h Specific NAV 2017 version i Specific NAV 2016 version

! accept default answers for the remaining questions x start over z go back

Version (default a) b

Latest Business Central OnPrem selected

Invoke-Expression : The variable cannot be validated because the value is not a valid value for the Version variable. At D:\PS\CreateContainer.ps1:1 char:1

GreatScott000 commented 3 years ago

Even latest sandbox

What version of Business Central do you need? If you are developing a Per Tenant Extension for a Business Central Saas tenant, you need a Business Central Sandbox environment

a Latest Business Central Sandbox b Latest Business Central OnPrem c Insider Business Central Sandbox for Next Major release (requires insider SAS token from http://aka.ms/collaborate) d InsiderBusiness Central Sandbox for Next Minor release (requires insider SAS token from http://aka.ms/collaborate) e Specific Business Central Sandbox build (requires version number) f Specific Business Central OnPrem build (requires version number) g Specific NAV 2018 version h Specific NAV 2017 version i Specific NAV 2016 version

! accept default answers for the remaining questions x start over z go back

Version (default a)

Latest Business Central Sandbox selected

Invoke-Expression : The variable cannot be validated because the value is not a valid value for the Version variable. At D:\PS\CreateContainer.ps1:1 char:1

  • Invoke-Expression (New-Object System.Net.WebClient).DownloadString("h ...
  • 
    + CategoryInfo          : MetadataError: (:) [Invoke-Expression], ValidationMetadataException
    + FullyQualifiedErrorId : ValidateSetFailure,Microsoft.PowerShell.Commands.InvokeExpressionCommand
GreatScott000 commented 3 years ago

New-BcContainerWizard seems to be me past this issue. I thought using the webclient download model was recommended?

freddydk commented 3 years ago

You are saying that you get the error when using invoke-expression, but not when using new-bccontainerwizard?

freddydk commented 3 years ago

The only reason for using the webclient model really is that you always get the latest version and it will check your containerhelper version. In your case - you are using the latest and the two things should be identical. The strange thing here is that the message you get is something PowerShell gives when validating parameters with parameter validators and I do not have any parameter validators setup for any version parameter in containerhelper.

What version of the host OS are you running?

GreatScott000 commented 3 years ago

To answer the question Windows 10 Pro (2004). Here are the details from a script that uses NAV2016 CU45 from outside the wizard.

However: Today it works just fine. So I think we can close this. Just a glitch in the Matrix before Christmas.

BcContainerHelper is version 1.0.17 BcContainerHelper is running as administrator Host is Microsoft Windows 10 Pro - 2004 Docker Client Version is 20.10.0 Docker Server Version is 20.10.0 Removing container bcserver Removing bcserver from host hosts file Removing bcserver-* from host hosts file Removing d:\bccontainerhelper\Extensions\bcserver Fetching all docker images Using image mcr.microsoft.com/businesscentral:10.0.19041.685 Creating Container bcserver Version: 9.0.51476.0-gb Style: onprem Multitenant: No Platform: 9.0.51476.0 Generic Tag: 1.0.1.2 Container OS Version: 10.0.19041.685 (2004) Host OS Version: 10.0.19041.685 (2004)