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

Error Downloading Url Rewrite #3456

Closed
brunomenezes66 opened this issue Apr 2, 2024 · 13 comments
Closed

Error Downloading Url Rewrite #3456

brunomenezes66 opened this issue Apr 2, 2024 · 13 comments

Comments

@brunomenezes66
Copy link

Describe the issue
When trying to create a container for a specific version of NAV 2016 I get the error after Downloading Url Rewrite.

Scripts used to create container and cause the issue

$containerName = 'ASDF'
$password = 'ASDF'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-NavArtifactUrl -nav '2016' -cu '67' -country 'w1'
$databaseServer = 'host.containerhelper.internal'
$databaseInstance = ''
$databaseName = 'ASDF'
$databaseUsername = 'ASDF'
$databasePassword = 'ASDF'
$databaseSecurePassword = ConvertTo-SecureString -String $databasePassword -AsPlainText -Force
$databaseCredential = New-Object pscredential $databaseUsername, $databaseSecurePassword
$licenseFile = 'C:\Users\bruno.seara\Documents\ASDF.flf'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -imageName 'ASDF' `
    -databaseServer $databaseServer -databaseInstance $databaseInstance -databaseName $databaseName `
    -databaseCredential $databaseCredential `
    -licenseFile $licenseFile `
    -includeCSIDE -doNotExportObjectsToText `
    -isolation 'process' `
    -updateHosts 

Full output of scripts

BcContainerHelper is version 6.0.12
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
UsePwshForBc24 is True
Host is Microsoft Windows 11 Enterprise - 10.0.22631.3296
Docker Client Version is 25.0.3
Docker Server Version is 25.0.3
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
ArtifactUrl and ImageName specified
Building image ASDF:onprem-9.0.52168.0-w1-nodb based on mcr.microsoft.com/businesscentral:ltsc2022 with https://bcartifacts.azureedge.net/onpre
m/9.0.52168.0/w1 without database
Pulling latest image mcr.microsoft.com/businesscentral:ltsc2022
ltsc2022: Pulling from businesscentral
Digest: sha256:7473a1ca0616569f43a7b5e14add41f0a5fa8b4b5077abe86c5e4ade1af40d51
Status: Image is up to date for mcr.microsoft.com/businesscentral:ltsc2022
mcr.microsoft.com/businesscentral:ltsc2022
Generic Tag: 1.0.2.17
Container OS Version: 10.0.20348.2340 (ltsc2022)
Host OS Version: 10.0.22631.3296 (23H2)
Using process isolation
Using license file C:\Users\bruno.seara\Documents\ASDF.flf
Files in c:\bcartifacts.cache\utsvlhjb.lge\my:
Copying Platform Artifacts
c:\bcartifacts.cache\onprem\9.0.52168.0\platform
c:\bcartifacts.cache\utsvlhjb.lge
Sending build context to Docker daemon  269.1MB

Step 1/6 : FROM mcr.microsoft.com/businesscentral:ltsc2022
 ---> c4cd601a3c1b
Step 2/6 : ENV DatabaseServer=localhost DatabaseInstance=SQLEXPRESS DatabaseName=CRONUS IsBcSandbox=N artifactUrl=https://bcartifacts.azureedge.net/onpr
em/9.0.52168.0/w1 filesOnly=False
 ---> Running in 9b74283f3fd5
 ---> Removed intermediate container 9b74283f3fd5
 ---> 919ca04d049a
Step 3/6 : COPY my /run/
 ---> 3732f32ed213
Step 4/6 : COPY NAVDVD /NAVDVD/
 ---> b290b329626f
Step 5/6 : RUN \Run\start.ps1 -installOnly
 ---> Running in 94e6b2a3ed46
c:\run\my folder doesn't exist, creating it
Using DVD installer from C:\Run\90
Installing NAV: InstallOnly=True
Starting Local SQL Server
Downloading Url Rewrite
Exception calling "DownloadFile" with "2" argument(s): "The remote name could not be resolved: 'bcartifacts.azureedge.net'"
�[91mInstallation failed
�[0m�[91mAt C:\Run\start.ps1:399 char:9
+         throw "Installation failed"
�[0m�[91m+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[0m�[91m    + CategoryInfo          : OperationStopped: (Installation failed:String) [ 
�[0m�[91m   ], RuntimeException
�[0m�[91m    + FullyQualifiedErrorId : Installation failed
�[0m�[91m 
�[0m
New-Bcimage Telemetry Correlation Id: 982673f3-1b31-4ccc-8247-8b5a38610aa0
New-BcContainer Telemetry Correlation Id: 8ff5f0f6-20c8-49e7-9d5e-158759e59595
DockerDo : The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; \Run\start.ps1 -installOnly' 
returned a non-zero code: 1
ExitCode: 1
Commandline: docker build --isolation=process --memory 8G --no-cache --tag ASDF:onprem-9.0.52168.0-w1-nodb c:\bcartifacts.cache\utsvlhjb.lge
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.12\ContainerHandling\New-NavImage.ps1:711 char:27
+ ...       if (!(DockerDo -command build -parameters @("--isolation=$isola ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DockerDo
...

Additional context

  • does it happen all the time?
    Yes, even after reinstaling docker and clearing any cache/images.
  • did it use to work?
    Yes, up to a couple of weeks ago. In the meantime I have updated from Windows 10 to 11 and BcContainerHelper from version 6.0.5 to 6.0.12.
    I have not done any further testing, but I am able to build BC containers, might be related to beeing an old NAV version.
@freddydk
Copy link
Contributor

freddydk commented Apr 2, 2024

Please try to remove the

    -imageName 'ASDF' `

and retry (to see if this is caused by building the image)

@brunomenezes66
Copy link
Author

Same error without -imageName

@freddydk
Copy link
Contributor

freddydk commented Apr 2, 2024

Could you share the output?

@brunomenezes66
Copy link
Author

BcContainerHelper is version 6.0.12
BcContainerHelper is running as administrator
HyperV is Enabled
UsePsSession is True
UsePwshForBc24 is True
Host is Microsoft Windows 11 Enterprise - 10.0.22631.3296
Docker Client Version is 25.0.3
Docker Server Version is 25.0.3
Removing Desktop shortcuts
Fetching all docker images
Fetching all docker volumes
Using image mcr.microsoft.com/businesscentral:ltsc2022
Creating Container ASDF
Style: onprem
Multitenant: No
Version: 9.0.52168.0
Platform: 9.0.52168.0
Generic Tag: 1.0.2.17
Container OS Version: 10.0.20348.2340 (ltsc2022)
Host OS Version: 10.0.22631.3296 (23H2)
Using process isolation
Using locale en-US
Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable)
Using license file C:\Users\bruno.seara\Documents\ASDF.flf
Files in C:\ProgramData\BcContainerHelper\Extensions\ASDF\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- HelperFunctions.ps1
- license.flf
- MainLoop.ps1
- SetupVariables.ps1
- updatehosts.ps1
Creating container ASDF from image mcr.microsoft.com/businesscentral:ltsc2022
Using Shared Encryption Key file
880fbb1568090b27f8fbaf225220e591bef3c83d16f059348e9cf02004735f4e
Waiting for container ASDF to be ready
Using artifactUrl https://bcartifacts.azureedge.net/onprem/9.0.52168.0/w1
Using installer from C:\Run\90
Copying Platform Artifacts
c:\dl\onprem\9.0.52168.0\platform
Copying Application Artifacts
Installing NAV: InstallOnly=False
Starting Local SQL Server
Downloading Url Rewrite
Exception calling "DownloadFile" with "2" argument(s): "The remote name could not be resolved: 'bcartifacts.azureedge.net'"
at InstallPrerequisite, C:\Run\HelperFunctions.ps1: line 614
at <ScriptBlock>, C:\Run\navinstall.ps1: line 37
at <ScriptBlock>, C:\Run\start.ps1: line 319
at <ScriptBlock>, <No file>: line 1
remove C:\NAVDVDError
Using artifactUrl https://bcartifacts.azureedge.net/onprem/9.0.52168.0/w1
Using installer from C:\Run\90
Copying Platform Artifacts
c:\dl\onprem\9.0.52168.0\platform
Copying Application Artifacts
Installing NAV: InstallOnly=False
Starting Local SQL Server
Downloading Url Rewrite
Exception calling "DownloadFile" with "2" argument(s): "The remote name could not be resolved: 'bcartifacts.azureedge.net'"
at InstallPrerequisite, C:\Run\HelperFunctions.ps1: line 614
at <ScriptBlock>, C:\Run\navinstall.ps1: line 37
at <ScriptBlock>, C:\Run\start.ps1: line 319
at <ScriptBlock>, <No file>: line 1
remove C:\NAVDVD
New-BcContainer Telemetry Correlation Id: b71c8f96-0ceb-42e6-8ff7-7d426949d65b
Initialization of container ASDF failed
At C:\Program Files\WindowsPowerShell\Modules\BcContainerHelper\6.0.12\ContainerHandling\Wait-NavContainerReady.ps1:42 char:17
+ ...             throw "Initialization of container $containerName failed" ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Initialization ...ASDF failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Initialization of container ASDF failed

@freddydk
Copy link
Contributor

freddydk commented Apr 2, 2024

if you use

docker exec -it ASDF powershell

from an elevated commandprompt, you will get a powershell prompt inside the container.
Inside the container - what happens if you write:

ping www.microsoft.com

or

ping bcartifacts.azureedge.net

?

@brunomenezes66
Copy link
Author

Tested it without the -image parameter on the final container, can confirm that it does not have any networking to the outside of my computer. It is using the nat switch, which does not allow it to connect outside of my computer, after switching the container network to the "Default Switch" which is ics it has connectivity to the outside (including bcartifacts.azureedge.net).
It might be a me problem, but I find it weird that BC containers do not have this problem and only this specific case of a NAV 2016 container seems to not have connectivity when being created.

@freddydk
Copy link
Contributor

freddydk commented Apr 4, 2024

nat doesn't prevent connections outside - typically the problem is just dns.
You might be able to insert 8.8.8.8 as dns in the docker daemon for this to work.

@brunomenezes66
Copy link
Author

Already tried using the 8.8.8.8 dns, before creating the issue. NAT networking has never allowed for outside connection in my experience, already tried on more than one computer, saw a bunch of people complaining about the same online and saying that ICS was the only way for that to work, that is why I say it might be a me issue. If it´s a docker issue on my end I´d say it´s best to close the issue, the only reason I created it is because I was able to build NAV images a couple of weeks earlier.

@freddydk
Copy link
Contributor

freddydk commented Apr 4, 2024

NAT network (default for docker) disallows for people to connect from the outside to the container, but connecting from the container to the outside world is not blocked by NAT.
Could you tell me what you do in order to use the default switch? What is ICS?
Thanks

@brunomenezes66
Copy link
Author

By ICS I meant the driver type. I currently have the follwing:

NETWORK ID     NAME             DRIVER    SCOPE
a707ccb43a5c   Default Switch   ics       local
eae8b53b85b9   nat              nat       local
9071b8afd1e3   none             null      local

Strangely, docker uses the nat network by default (weirdly, since they have a "Default Switch" which is not used by default), however using nat in my containers does not give them outside conectivity (in my experience), so I have to manually stop the containers and connect them to the "Default Switch" network with docker network connect "Default Switch" asdf and voila, they can now access the outside of my computer.

@freddydk
Copy link
Contributor

freddydk commented Apr 4, 2024

I don't have the default switch in my installation:

image

I can see other people having problems that sounds similar... docker/for-win#1166 - might need to do some digging to see what this is and whether we can do anything about it.

@brunomenezes66
Copy link
Author

Hey @freddydk, is there any chance to include some kind of flag to skip installing the web client in older NAV versions which still use CSIDE? It might be a workaround for those like me who just need the RTC and CSIDE, and since this problems seems to come from the installation of IIS.

@freddydk
Copy link
Contributor

Looking at the output, it says:

Using installer from C:\Run\90

meaning that it uses this file:

https://github.com/microsoft/nav-docker/blob/master/generic/Run/90/navinstall.ps1

for installing.
You can grab this file and make any changes you want (keep the name = navinstall.ps1) and then include your changed script in -myscripts @('c:\myfiles\navinstall.ps1') - then your file is used for the installation.

Now you can just remove the lines which you don't need.

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