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

Run-ALValidation: error The specified file is not an extension file. #1690

Closed ti-jalopez closed 3 years ago

ti-jalopez commented 3 years ago

Describe the issue Run-ALValidation ussing URL from app trhows error The specified file is not an extension file. Parameter name: stream. I think when URL is used for download app, you need to rename with .app extension the temporary file created.

Scripts used to create container and cause the issue

$myLicense = 'C:\myLicense.flf'
$previousApps = @()
$apps = @(''https://dev.azure.com/..../myApp_1.0.0.30.app');
$affixes = 'MYPREFIX'

#Current Version
$validationResults = Run-AlValidation `
    -licenseFile $myLicense `
    -previousApps $previousApps `
    -apps $apps `
    -validateCurrent `
    -countries 'ES' `
    -affixes $affixes `
    -supportedCountries 'ES' `
    -verbose

Full output of scripts

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

Container name               bcserver
Image name                   
Credential                   admin/Weha2458
License file                 Specified
MemoryLimit                  8G
validateVersion              
validateCurrent              True
validateNextMinor            False
validateNextMajor            False
SasToken                     Not Specified
countries                    es
validateCountries            es
affixes                      MYPREFIX
supportedCountries           es
vsixFile                     
Install Apps
- None
Previous Apps
- None
Apps
- https://dev.azure.com/..../myApp_1.0.0.30.app

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

Pulling mcr.microsoft.com/businesscentral:10.0.19042.746

Pulling generic image took 1 seconds
  _____       _                      _                         _   _  __           _       
 |  __ \     | |                    (_)                       | | (_)/ _|         | |      
 | |  | | ___| |_ ___ _ __ _ __ ___  _ _ __   ___    __ _ _ __| |_ _| |_ __ _  ___| |_ ___ 
 | |  | |/ _ \ __/ _ \ '__| '_ ` _ \| | '_ \ / _ \  / _` | '__| __| |  _/ _` |/ __| __/ __|
 | |__| |  __/ |_  __/ |  | | | | | | | | | |  __/ | (_| | |  | |_| | || (_| | (__| |_\__ \
 |_____/ \___|\__\___|_|  |_| |_| |_|_|_| |_|\___|  \__,_|_|   \__|_|_| \__,_|\___|\__|___/

DETALLADO: Invoke-RestMethod -Method Get -Uri https://bcartifacts.azureedge.net/sandbox/?comp=list&restype=container
DETALLADO: GET https://bcartifacts.azureedge.net/sandbox/?comp=list&restype=container with 0-byte payload
DETALLADO: received -1-byte response of content type application/xml
...
Using https://bcartifacts.azureedge.net/sandbox/17.4.21491.21867/es

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

Creating container for country es
DETALLADO: Realice la operación 'Enumerar instancias de CIM' con los parámetros siguientes, ''namespaceName' = root\cimv2,'className' = Win32_OperatingSystem'.
DETALLADO: La operación 'Enumerar instancias de CIM' se completó.
DETALLADO: Realice la operación 'Enumerar instancias de CIM' con los parámetros siguientes, ''namespaceName' = root\cimv2,'className' = Win32_OperatingSystem'.
DETALLADO: La operación 'Enumerar instancias de CIM' se completó.
BcContainerHelper is version 2.0.4
BcContainerHelper is running as administrator
Host is Microsoft Windows 10 Pro - 20H2
Docker Client Version is 20.10.2
Docker Server Version is 20.10.2
Fetching all docker images
Using image mcr.microsoft.com/businesscentral:10.0.19042.746
Creating Container bcserver
Version: 17.4.21491.21867-ES
Style: sandbox
Multitenant: No
Platform: 17.0.21485.21847
Generic Tag: 1.0.1.3
Container OS Version: 10.0.19042.746 (20H2)
Host OS Version: 10.0.19042.789 (20H2)
Using hyperv isolation
Using locale es-ES
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\myLicense.flf
Additional Parameters:
--env customNavSettings=EnableTaskScheduler=True
Files in C:\ContainerHelper\Extensions\bcserver\my:
- AdditionalOutput.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container bcserver from image mcr.microsoft.com/businesscentral:10.0.19042.746
57bf075aed3a776fc5215646592e68983fe2f70ab287eb7418b453ada80a2d58
Waiting for container bcserver to be ready
Using artifactUrl https://bcartifacts.azureedge.net/sandbox/17.4.21491.21867/es
Using installer from C:\Run\150-new
Installing Business Central
Installing from artifacts
Starting Local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
start...
Starting Internet Information Server
Copying Service Tier Files
Copying PowerShell Scripts
Copying dependencies
Copying ReportBuilder
Importing PowerShell Modules
Determining Database Collation from c:\dl\sandbox\17.4.21491.21867\es\BusinessCentral-ES.bak
Changing Database Server Collation to Modern_Spanish_100_CS_AS
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'
Copying Web Client Files
Copying Client Files
Copying ModernDev Files
Copying additional files
Copying ConfigurationPackages
Copying Test Assemblies
Copying Extensions
Copying Applications
Copying Applications.ES
Starting Business Central Service Tier
Importing license file
Stopping Business Central Service Tier
Installation took 403 seconds
Installation complete
Initializing...
Setting host.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting gateway.docker.internal to 192.168.0.24 in container hosts file (copy from host hosts file)
Setting kubernetes.docker.internal to 127.0.0.1 in container hosts file (copy from host hosts file)
Setting host.containerhelper.internal to 172.23.16.1 in container hosts file
Starting Container
Hostname is bcserver
PublicDnsName is bcserver
WARNING: Container starts with TimeZone = Hora estándar Europa Occidental, which is not recognized in the list of TimeZones.
Using NavUserPassword Authentication
Creating Self Signed Certificate
Self Signed Certificate Thumbprint C0F3B2E611138B2E731C2994C76104E44AD71C5C
Modifying Service Tier Config File with Instance Specific Settings
Modifying Service Tier Config File with settings from environment variable
Setting EnableTaskScheduler to True
Starting Service Tier
Registering event sources
Creating DotNetCore Web Server Instance
Enabling Financials User Experience
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Setting SA Password and enabling SA
Creating admin as SQL User and add to sysadmin
Creating SUPER user
Container IP Address: 172.23.20.213
Container Hostname  : bcserver
Container Dns Name  : bcserver
Web Client          : http://bcserver/BC/
Dev. Server         : http://bcserver
Dev. ServerInstance : BC
Setting bcserver to 172.23.20.213 in host hosts file

Files:
http://bcserver:8080/ALLanguage.vsix

Container Total Physical Memory is 8.5Gb
Container Free Physical Memory is 6.1Gb

Initialization took 54 seconds
Ready for connections!
Reading CustomSettings.config from bcserver
Creating Desktop Shortcuts for bcserver
Container bcserver successfully created

Use:
Get-BcContainerEventLog -containerName bcserver to retrieve a snapshot of the event log from the container
Get-BcContainerDebugInfo -containerName bcserver to get debug information about the container
Enter-BcContainer -containerName bcserver to open a PowerShell prompt inside the container
Remove-BcContainer -containerName bcserver to remove the container again
docker logs bcserver to retrieve information about URL's again

Creating container took 484 seconds
  _____                   _                                    _____                           _____            
 |  __ \                 (_)                 /\               / ____|                         / ____|           
 | |__) |   _ _ __  _ __  _ _ __   __ _     /  \   _ __  _ __| (___   ___  _   _ _ __ ___ ___| |     ___  _ __  
 |  _  / | | | '_ \| '_ \| | '_ \ / _` |   / /\ \ | '_ \| '_ \\___ \ / _ \| | | | '__/ __/ _ \ |    / _ \| '_ \ 
 | | \ \ |_| | | | | | | | | | | | (_| |  / ____ \| |_) | |_) |___) | (_) | |_| | | | (__  __/ |____ (_) | |_) |
 |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | /_/    \_\ .__/| .__/_____/ \___/ \__,_|_|  \___\___|\_____\___/| .__/ 
                                   __/ |          | |   | |                                              | |    
                                  |___/           |_|   |_|                                              |_|    
Downloading C:\Users\jalopez\AppData\Local\Temp\740fd13b-f7c4-4721-b8c0-c1cefb75da51
The specified file is not an extension file.
Parameter name: stream
en Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1: línea 39
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 41
en Sort-AppFilesByDependencies, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 36
en Run-AlCops, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlCops.ps1: línea 77
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 495
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 478
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 393
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 367
en Run-AlValidation, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 365
en <ScriptBlock>, <sin archivo>: línea 7
en Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1: línea 44
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 41
en Sort-AppFilesByDependencies, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 36
en Run-AlCops, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlCops.ps1: línea 77
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 495
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 478
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 393
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 367
en Run-AlValidation, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 365
en <ScriptBlock>, <sin archivo>: línea 7
Unexpected error while validating app. Error is: The specified file is not an extension file.
Parameter name: stream
en Invoke-ScriptInBcContainer, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\ContainerHandling\Invoke-ScriptInNavContainer.ps1: línea 45
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 41
en Sort-AppFilesByDependencies, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Sort-AppFilesByDependencies.ps1: línea 36
en Run-AlCops, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlCops.ps1: línea 77
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 495
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 478
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 393
en <ScriptBlock>, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 367
en Run-AlValidation, C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\2.0.4\AppHandling\Run-AlValidation.ps1: línea 365
en <ScriptBlock>, <sin archivo>: línea 7

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

Removing container bcserver
Removing bcserver from host hosts file
Removing bcserver-* from host hosts file
Removing C:\ContainerHelper\Extensions\bcserver

Removing container took 35 seconds

AL Validation finished in 532 seconds
 __      __   _ _     _       _   _               _____                _ _       
 \ \    / /  | (_)   | |     | | (_)             |  __ \              | | |      
  \ \  / /_ _| |_  __| | __ _| |_ _  ___  _ __   | |__) |___ ___ _   _| | |_ ___ 
   \ \/ / _` | | |/ _` |/ _` | __| |/ _ \| '_ \  |  _  // _ \ __| | | | | __/ __|
    \  / (_| | | | (_| | (_| | |_| | (_) | | | | | | \ \  __\__ \ |_| | | |_\__ \
     \/ \__,_|_|_|\__,_|\__,_|\__|_|\___/|_| |_| |_|  \_\___|___/\__,_|_|\__|___/

Unexpected error while validating app. Error is: The specified file is not an extension file.
Parameter name: stream
  _____                          ___      __   _ _     _       _   _               ______    _ _                
 |  __ \                   /\   | \ \    / /  | (_)   | |     | | (_)             |  ____|  (_) |               
 | |__) |   _ _ __ ______ /  \  | |\ \  / /_ _| |_  __| | __ _| |_ _  ___  _ __   | |__ __ _ _| |_   _ _ __ ___ 
 |  _  / | | | '_ \______/ /\ \ | | \ \/ / _` | | |/ _` |/ _` | __| |/ _ \| '_ \  |  __/ _` | | | | | | '__/ _ \
 | | \ \ |_| | | | |    / ____ \| |  \  / (_| | | | (_| | (_| | |_| | (_) | | | | | | | (_| | | | |_| | | |  __/
 |_|  \_\__,_|_| |_|   /_/    \_\_|   \/ \__,_|_|_|\__,_|\__,_|\__|_|\___/|_| |_| |_|  \__,_|_|_|\__,_|_|  \___|
...

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

Additional context

freddydk commented 3 years ago

Could you provide me with a failing URL (either here or on email) - it works fine with a direct download URL here:

  _____                   _                                    _____                           _____            
 |  __ \                 (_)                 /\               / ____|                         / ____|           
 | |__) |   _ _ __  _ __  _ _ __   __ _     /  \   _ __  _ __| (___   ___  _   _ _ __ ___ ___| |     ___  _ __  
 |  _  / | | | '_ \| '_ \| | '_ \ / _` |   / /\ \ | '_ \| '_ \\___ \ / _ \| | | | '__/ __/ _ \ |    / _ \| '_ \ 
 | | \ \ |_| | | | | | | | | | | | (_| |  / ____ \| |_) | |_) |___) | (_) | |_| | | | (__  __/ |____ (_) | |_) |
 |_|  \_\__,_|_| |_|_| |_|_|_| |_|\__, | /_/    \_\ .__/| .__/_____/ \___/ \__,_|_|  \___\___|\_____\___/| .__/ 
                                   __/ |          | |   | |                                              | |    
                                  |___/           |_|   |_|                                              |_|    
Downloading C:\Users\freddyk\AppData\Local\Temp\0dd28a2c-830f-439e-8e35-ddbd7c67977b
Extracting C:\BcContainerHelper\b5556d29-80d3-41ec-a773-6fe12ecef30d\0dd28a2c-830f-439e-8e35-ddbd7c67977b.app
Analyzing: 0dd28a2c-830f-439e-8e35-ddbd7c67977b.app
Using affixes: bingmaps
ti-jalopez commented 3 years ago

Sorry, the URL is from our devopsv tenant, so can only access from our domain. It's de outside artifact created on pipeline. I'll try to move de app to other server to test if the problem is the source server.

freddydk commented 3 years ago

Yeah, you can download and provide the filename

ti-jalopez commented 3 years ago

I've sent the filename by email.

ti-jalopez commented 3 years ago

Finally the problem is on the URL I've used, that needs credentials. @freddydk confirms that only are allowed URL's without credentials, so I need to use only files in this case. Thanks!

freddydk commented 3 years ago

That or SAS URL where the token is part of the URL. It needs to be a URL that can be used on any computer.