-
Notifications
You must be signed in to change notification settings - Fork 245
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
New-NAVDatabase in v24 no longer works with external sql - cannot create v24 containers with external #3541
Comments
Works fine here |
and the reason why this shows in Waitforcontainerready is that the database restore is done in a background job running on the host, while the container is being created (and the host is waiting for the container to be created). During container creation the container will stop when it needs the database and wait for that process to be complete before continuing |
Similar Issue in the same spot.
|
BTW, if we remove the -replaceexternaldatabases (just for fun?)
|
Try to run this on the host: Restore-BcDatabaseFromArtifacts -artifactUrl $artifactUrl -databaseServer $databaseServer -databaseInstance $databaseInstance -databasePrefix $databasePrefix -databaseName $databaseName -multitenant:$multitenant Maybe that will give you a better indication as to what goes wrong? (That is basically what runs behind the scenes when using -replaceexternaldatabases) |
Hi Freddy.
Same result... here's the output:
|
BTW I tested pinging host.containerhelper.internal from inside the (earlier) container and its perfect. |
Remarkably, above DBRestore works perfectly in PS5.1:
Will try to build container (in PS 7.4) without replacing external DB using this DB. |
So no progress.
|
And SQL Server on the host is listening on all NIC's? |
Yes. SQL was set to listen on all IPs and NICs. (And all of this works perfectly with BC23 and PS 5.1 on the same hardware.) |
Yeah, well - it works perfectly with 24.1 on my machine as well - so I am looking for differences... |
Could it be that PS7.4 is missing some modules...? can you think of anything other than the SQLServer module that needs to be installed? I also tried to enable TLS1.2... but that made no difference. also added certificate to SQL. |
The entire creation of the container still runs PS5.1 inside the container, |
Do you think the errors mentioned above are being thrown by the PS5.1 instance in the container? The restore DB issue (not working in PS7.4 but does work in PS5.1) is not happening inside a container, but using PS5.1 on the host is a workaround for that one. But it sounds like you think the inability to connect to SQL for the Import Encryption Key (NavEncryptionKey) is inside the container PS5.1 / Is that right? Does it help to know that the import encryption key takes a long time to error out? |
I ended up getting this working by installing PS 7.4. I write a lot of my code in VSCode and it was defaulting to PS 7, which doesn't work with bccontainerhelper - it needs to be running in PS 5.1 to start the commands at all. Basically, after I installed PS 7.4, in vscode you can change the instance version that PS is running. Once I did that, you can change the default as well, so now when I open VSCode it opens in PS 5.1 and all seems to be back to working like normal for me. |
interesting approach. I couldn't get it to work in the PS 5.1 ISE, so I tried your idea to switch the PS version in VSC to 5.1.... unfortunately, still getting the Import Key error. Also strange, I thought BCContainerHelper only worked with PS7.4, but it seemed to import ok when i tried it in VSC:
|
@kevindstanley holy smokes! So I tried your approach one more time, but this time I included the -replaceExternalDatabases to allow the script to overwrite the database i managed to install earlier..... It worked! Including setting up external IPs! No issue with retrieving the encryption key. Thanks! For others hoping to try this approach, you need to switch the PowerShell Session in VSC to the Powershell 5.1... In VSC, open the Command Palette on Windows with Ctrl+Shift+P. note that (in my case) You can check the version using $PSVersionTable Here are the links I used for reference in addition to @kevindstanley advice: By the way, I don't think this is the right approach overall, but it seems to be the only workaround I've found to get BC24 installed on a container with an external DB and IP address. (And of course, always appreciating @freddydk 's help) @freddydk is is possible you are using the PS5.1 PS session in VSC as well? |
I have been running that test in PS5.1 (using PowerShell ISE) BTW - I assume you have PS 7.4.1 (or .2) |
yep. PS 7.4.2 in VSC. Actually, there was a specific reason why we originally went to PS7 that had something to do with BCContainerHelper and the external DB, but I can't find it in my notes. |
Describe the issue
Ultimately the problem represents itself when running New-BcContainer with external db paramaters, but I narrowed it down to the call inside of Restore-BcDatabaseFromArtifacts.ps1 (which inside of start-job is incredibly difficult to debug). The line of code that causes the failure is the following on line 157. This is in the NAV Management DLL and I could not debug any further and it just immediately spits out an error on v24.
navcontainerhelper/Bacpac/Restore-BcDatabaseFromArtifacts.ps1
Line 157 in b68af9f
The error shows up in what seems to be an unlikely area the Wait-NavContainerReady.ps1
Scripts used to create container and cause the issue
Full output of scripts
The text was updated successfully, but these errors were encountered: