microsoft / nav-docker

Official Microsoft repository for Dynamics NAV in Docker resources. It has not been decided yet, to which extend Microsoft will ship Docker images with NAV, so everything in this repo is work in progress and might be subject to deletion.
MIT License
180 stars 90 forks source link

There are no more files. - NAV 2018 CU2 DE #160

Closed dynamicsblog closed 6 years ago

dynamicsblog commented 6 years ago

I got an error when running a new container with this parameter. First I thought it is because the database backup was not already converted to NAV 2018 CU2, but this backup is converted to nav 2018 cu2. It was nav 2016 before. Any idea?

PS C:\Users\vmadmin> docker run -e accept_eula=Y -e username="vmadmin" -e password="Password123" -e databaseusername="sa" -e databasepassword="Password123" -v C:\temp:c:\run\my -e UseSSL=N -h test18cu22 -e licensefile="c:\run\my\fin.flf" --env ExitOnerror=N --name test18cu22 -e bakfile=c:\run\my\test18cu1konv.bak ` microsoft/dynamics-nav:2018-cu2-de

Initializing... Starting Container Hostname is test18cu22 PublicDnsName is test18cu22 Using NavUserPassword Authentication Starting Local SQL Server Starting Internet Information Server Using Database .bak file 'c:\run\my\test18cu1konv.bak' Creating Self Signed Certificate Self Signed Certificate Thumbprint 4BE0D1679B66C3349D608A53F2557EBD06C4292E Modifying NAV Service Tier Config File with Instance Specific Settings Starting NAV Service Tier Using license file 'c:\run\my\fin.flf' Import NAV License No Dynamics NAV application has been mounted. Contact your system administrator. at , C:\Run\SetupLicense.ps1: line 29 at , C:\Run\navstart.ps1: line 125 at , C:\Run\start.ps1: line 102 at , : line 1

TimeGenerated : 2/13/2018 3:38:58 PM EntryType : Warning Message : Type: Microsoft.Dynamics.Nav.Types.NavServerNotFoundException SuppressMessage: False DiagnosticsSuppress: False SuppressExceptionCreatedEvent: False FatalityScope: None Message: No Dynamics NAV application has been mounted. Contact your system administrator. StackTrace: at Microsoft.Dynamics.Nav.Management.ServerInstanceConnect ion.DoOpenAdminConnection(IAdminService adminService) at Microsoft.Dynamics.Nav.Management.ServerInstanceConnect ion.EstablishAdminConnection() at Microsoft.Dynamics.Nav.Management.ServerInstanceConnect ion.InternalValidate() at Microsoft.Dynamics.Nav.Management.NavCommand.ProcessRecord() Source: Microsoft.Dynamics.Nav.Management HResult: -2146233088

            Type: System.ServiceModel.FaultException`1[[Microsoft.Dynamics.
            Nav.Types.ServerFault, Microsoft.Dynamics.Nav.Types, 
            Version=11.0.0.0, Culture=neutral, 
            PublicKeyToken=31bf3856ad364e35]]
            Action: http://www.microsoft.com/Dynamics/NAV/51/ServerFault
            Message: <ii>No Dynamics NAV application has been mounted. 
            Contact your system administrator.</ii>
            StackTrace:

              Server stack trace: 
                 at System.ServiceModel.Channels.ServiceChannel.HandleReply
            (ProxyOperationRuntime operation, ProxyRpc& rpc)
                 at 
            System.ServiceModel.Channels.ServiceChannel.Call(String 
            action, Boolean oneway, ProxyOperationRuntime operation, 
            Object[] ins, Object[] outs, TimeSpan timeout)
                 at System.ServiceModel.Channels.ServiceChannelProxy.Invoke
            Service(IMethodCallMessage methodCall, ProxyOperationRuntime 
            operation)
                 at System.ServiceModel.Channels.ServiceChannelProxy.Invoke
            (IMessage message)

              Exception rethrown at [0]: 
                 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnM
            essage(IMessage reqMsg, IMessage retMsg)
                 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke
            (MessageData& msgData, Int32 type)
                 at Microsoft.Dynamics.Nav.Types.IAdminService.OpenAdminCon
            nection(ConnectionRequest connectionRequest)
                 at Microsoft.Dynamics.Nav.Management.ServerInstanceConnect
            ion.DoOpenAdminConnection(IAdminService adminService)
            Source: mscorlib
            HResult: -2146233087

TimeGenerated : 2/13/2018 3:39:06 PM EntryType : Error Message : Server instance: NAV Tenant ID:

User: Type: System.IO.IOException Message: There are no more files. StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) at Microsoft.Dynamics.Nav.Runtime.TempPathHelper.RemovePat h(String path) Source: mscorlib HResult: -2147024878

TimeGenerated : 2/13/2018 3:39:06 PM EntryType : Error Message : Server instance: NAV Tenant ID:

User: Type: System.IO.IOException Message: There are no more files. StackTrace: at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost) at Microsoft.Dynamics.Nav.Runtime.TempPathHelper.RemovePat h(String path) Source: mscorlib HResult: -2147024878

TimeGenerated : 2/13/2018 3:39:05 PM EntryType : Warning Message : Server instance: NAV Tenant:

The service could not remove service principal names because the service account could not be found in Active Directory. Account: NT AUTHORITY\SYSTEM Service principal names: DynamicsNAV/test18cu22:7045 DynamicsNAV/test18cu22:7045
freddydk commented 6 years ago

Not really - you could try to spin up a SQL container and restore the database manually in that - and then run the NAV container using the SQL container as a database server.

dynamicsblog commented 6 years ago

the backup is working inside the container. The database is there after spinning up this container. Only the nav service tier could not start up. I can access it with the development environment and when I set up a different machine without backup file option and restore it after it, it is working too. Only when I pass it as an option the service tier setup fails. But not problem, I will do more investigation.

Thanks freddy Rene

Outlook for Androidhttps://aka.ms/ghei36 herunterladen


From: Freddy Kristiansen notifications@github.com Sent: Wednesday, February 14, 2018 7:09:58 AM To: Microsoft/nav-docker Cc: Rene Gayer; Author Subject: Re: [Microsoft/nav-docker] There are no more files. - NAV 2018 CU2 DE (#160)

Not really - you could try to spin up a SQL container and restore the database manually in that - and then run the NAV container using the SQL container as a database server.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/nav-docker/issues/160#issuecomment-365506445, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgiBnWzkKpvQHoCcH67zttDY5k2GDamKks5tUni2gaJpZM4SD3bx.

freddydk commented 6 years ago

Strange. In case you have a .bak file with this behavior, which can be shared, I would like to have a look to see what is happening. It might not be the last time we see this.

dynamicsblog commented 6 years ago

Hi, I think this should be possible, thank you! However, let me do some more test today. If these tests are not helpful, I will provide you a link to download today. Do you know if someone already has done successfully runs with custom backup files?

I am not sure if it is the backup. I am also looking into issues with providing too many parameters which don’t make sense for this run. Like, I thought “sqlusername” and password would configure database authentication, but it is only used for external SQL server. Maybe some scripts are running into different sections when they passed, but don’t make sense for the remaining passed options.. ?!

/Rene

Von: Freddy Kristiansen [mailto:notifications@github.com] Gesendet: Mittwoch, 14. Februar 2018 08:12 An: Microsoft/nav-docker nav-docker@noreply.github.com Cc: Rene Gayer r.gayer@mbs-training.com; Author author@noreply.github.com Betreff: Re: [Microsoft/nav-docker] There are no more files. - NAV 2018 CU2 DE (#160)

Strange. In case you have a .bak file with this behavior, which can be shared, I would like to have a look to see what is happening. It might not be the last time we see this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/nav-docker/issues/160#issuecomment-365516037, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgiBnQTyhATVcSA4LJkBXDiyPVKjzJ7eks5tUodFgaJpZM4SD3bx.

tfenster commented 6 years ago

Yes, I have done that. My full run is a bit more complex, but the relevant params are

$name = "nsys17111"
$image = "2017-cu5-de"
$bakfile = "C:\temp\newsystem_170110100_CU05_TFE.bak"

$params = @("run",
    "--name", "$name",
    "--hostname", "$name",
    "-e", "accept_eula=y",
    "-e", "username=admin",
    "-e", "password=***", 
    "-v", "c:\temp:c:\temp",
    "-e", "bakfile=$bakfile" 
    "microsoft/dynamics-nav:$image"
)

Write-Host $params
& 'C:\Program Files\Docker\docker.exe' $params

For your reference the full script looks like this (it downloads the correct dlls from our TFS, creates a gMSA for that container and runs the container)

$name = "nsys17111"
$image = "2017-cu5-de"
$bakfile = "C:\temp\newsystem_170110100_CU05_TFE.bak"
$navrelease = "100"
$nsysrelease = "170110000"

[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null

$CodeServerPath = [System.Web.HttpUtility]::UrlEncode("$/RMT/Dynamics NAV 2017 DLL/$nsysrelease/Kumulativ")
$Url = "http://s00-tfs1.global.fum:8080/tfs/AxiansInfoma/RMT/_api/_versionControl/itemContentZipped?repositoryId=&path=$CodeServerPath"
$filename = "c:\temp\$name.$nsysrelease.zip"
$path = "c:\temp\$name.$nsysrelease"

if (Test-Path $filename) {
    Remove-Item $filename
}
if (Test-Path $path) {
    Remove-Item -Recurse $path
}

wget -Uri $Url -UseDefaultCredentials -OutFile $filename

Expand-Archive -Path $filename -DestinationPath $path

cmd /c C:\scripts\psexec.exe -u ***\*** -p ~ -h powershell "& c:\scripts\Remove-gMSA.ps1 -ContainerName $name" --% 2>&1

cmd /c C:\scripts\psexec.exe -u ***\*** -p ~ -h powershell "& c:\scripts\New-gMSA.ps1 -ContainerName $name" --% 2>&1

$params = @("run",
    "--rm",
    "--security-opt", "`"credentialspec=file://$name.json`"",
    "--name", "$name",
    "--hostname", "$name",
    "-e", "accept_eula=y",
    "-e", "accept_outdated=y",
    "--network", "MyTransparentNetwork",
    "-e", "auth=Windows",
    "-e", "username=admin",
    "-e", "password=***", 
    "-e", "clickonce=y",
    "-e", "folders=`"c:\run\my=https://github.com/tfenster/nav-docker-samples/archive/grant-user-access.zip\nav-docker-samples-grant-user-access`"",
    "-e", "DevDomain=FUM-GLOBAL",
    "-e", "DevGroup=GRP_INFOMA_DEV_ALL",
    "-v", "c:\temp:c:\temp",
    "-v", "`"$path\kumulativ:C:\Program Files\Microsoft Dynamics NAV\$navrelease\Service\Add-ins\Infoma`"",
    "-e", "customWebSettings=`"Productname=newsystem`""
    "-e", "bakfile=$bakfile" 
    "microsoft/dynamics-nav:$image"
)

Write-Host $params
& 'C:\Program Files\Docker\docker.exe' $params
dynamicsblog commented 6 years ago

Hi, „dmaster“ :D

Thank you for your reply.

Our bak file history is

. The database was nav 2016 before . we made a backup . tried to run a Docker container with it -> error, sure – server and database version did not match (feature request: [I know I can modify the scripts;] – option to run database conversion during spinning up a container) . did database conversion and a new backup . tried to run a Docker container with it again -> error, “…no more files”

I am not sure if it is the backup because it successfully restored. I deliberately used an easy combination of options. This scenario was the only reason why I posted it. Maybe it is some combination which doesn’t work, and I thought maybe someone already had this issue.

I am still looking for it, and I will try your script as well.

/Rene

Von: Tobias Fenster [mailto:notifications@github.com] Gesendet: Mittwoch, 14. Februar 2018 10:46 An: Microsoft/nav-docker nav-docker@noreply.github.com Cc: Rene Gayer r.gayer@mbs-training.com; Author author@noreply.github.com Betreff: Re: [Microsoft/nav-docker] There are no more files. - NAV 2018 CU2 DE (#160)

Yes, I have done that. My full run is a bit more complex, but the relevant params are

$name = "nsys17111"

$image = "2017-cu5-de"

$bakfile = "C:\temp\newsystem_170110100_CU05_TFE.bak"

$params = @("run",

"--name", "$name",

"--hostname", "$name",

"-e", "accept_eula=y",

"-e", "username=admin",

"-e", "password=***",

"-v", "c:\temp:c:\temp",

"-e", "bakfile=$bakfile"

"microsoft/dynamics-nav:$image"

)

Write-Host $params

& 'C:\Program Files\Docker\docker.exe' $params

For your reference the full script looks like this (it downloads the correct dlls from our TFS, creates a gMSA for that container and runs the container)

$name = "nsys17111"

$image = "2017-cu5-de"

$bakfile = "C:\temp\newsystem_170110100_CU05_TFE.bak"

$navrelease = "100"

$nsysrelease = "170110000"

[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null

$CodeServerPath = [System.Web.HttpUtility]::UrlEncode("$/RMT/Dynamics NAV 2017 DLL/$nsysrelease/Kumulativ")

$Url = "http://s00-tfs1.global.fum:8080/tfs/AxiansInfoma/RMT/_api/_versionControl/itemContentZipped?repositoryId=&path=$CodeServerPath"

$filename = "c:\temp\$name.$nsysrelease.zip"

$path = "c:\temp\$name.$nsysrelease"

if (Test-Path $filename) {

Remove-Item $filename

}

if (Test-Path $path) {

Remove-Item -Recurse $path

}

wget -Uri $Url -UseDefaultCredentials -OutFile $filename

Expand-Archive -Path $filename -DestinationPath $path

cmd /c C:\scripts\psexec.exe -u \ -p ~ -h powershell "& c:\scripts\Remove-gMSA.ps1 -ContainerName $name" --% 2>&1

cmd /c C:\scripts\psexec.exe -u \ -p ~ -h powershell "& c:\scripts\New-gMSA.ps1 -ContainerName $name" --% 2>&1

$params = @("run",

"--rm",

"--security-opt", "`"credentialspec=file://$name.json`"",

"--name", "$name",

"--hostname", "$name",

"-e", "accept_eula=y",

"-e", "accept_outdated=y",

"--network", "MyTransparentNetwork",

"-e", "auth=Windows",

"-e", "username=admin",

"-e", "password=***",

"-e", "clickonce=y",

"-e", "folders=`"c:\run\my=https://github.com/tfenster/nav-docker-samples/archive/grant-user-access.zip\nav-docker-samples-grant-user-access`"",

"-e", "DevDomain=FUM-GLOBAL",

"-e", "DevGroup=GRP_INFOMA_DEV_ALL",

"-v", "c:\temp:c:\temp",

"-v", "`"$path\kumulativ:C:\Program Files\Microsoft Dynamics NAV\$navrelease\Service\Add-ins\Infoma`"",

"-e", "customWebSettings=`"Productname=newsystem`""

"-e", "bakfile=$bakfile"

"microsoft/dynamics-nav:$image"

)

Write-Host $params

& 'C:\Program Files\Docker\docker.exe' $params

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/nav-docker/issues/160#issuecomment-365549933, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgiBnaeDoy0Rh9zRpCeAMrPV05ddBRqhks5tUqtmgaJpZM4SD3bx.

richardrobberse commented 6 years ago

I have the exact same issue on nav2018-cu2-nl with the following scenario:

  1. Created container with the Cronus database (no bakfile parameter)
  2. Some objects were imported, compiled etc.
  3. Created a backup of this database.
  4. Created a new container based on this bakfile.

I'll try again to verify if this is a recurring problem and also test this on CU1.

freddydk commented 6 years ago

Could you try to specify a license file with -e licensefile= ?

richardrobberse commented 6 years ago

@freddydk I used our NAV 2018 dev license.

freddydk commented 6 years ago

But was that specified in the launch of the container?

richardrobberse commented 6 years ago

Yes!

freddydk commented 6 years ago

Could you download the container log using the new get-navcontainereventlog and attach it?

richardrobberse commented 6 years ago

Currently rerunning the scenario, I'll attach the event log asap. EDIT: the exact same scenario now runs fine.

freddydk commented 6 years ago

Ok, so the "There are no more files" is an error which occurs under cleanup - meaning that the cause is in the eventlog further up - and for some reason, it doesn't always get printet - but you have to get it using the cmdlet. So the headline "there are no more files" can be the heading for a lot of different errors, not the error itself.

richardrobberse commented 6 years ago

Thanks Freddy, if I get the error again I will retrieve the event log and post my findings here.

dynamicsblog commented 6 years ago

thank you freddy ! sometimes it could be so easy...