microsoft / navcontainerhelper

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

[Devops Pipeline].[Compile-App] publisher property not found #391

Closed judecot closed 5 years ago

judecot commented 5 years ago

Hi,

I'm trying to reproduce the app/test app deployment with devops Pipeline.

During the "Compile App" part, I have this following error message

image

which concerns this part of the Compile-AppInNavContainer.ps1 image

The error message translated from french: "publisher" property not found in this object. Check it exists"

my app/app.json file: image

I can't find what this message means. I think that all the places I can find the publisher property is in an app.json file. And all the app.json file I have contains this property.

Is someone can help me to see where the problem is ?

Thank you !

freddydk commented 5 years ago

Do you have access to the build agent? Then you can run Get-NavContainerAppInfo on the container and tell me what it returns?

judecot commented 5 years ago

Hi, Thanks for the quick response. Sorry but I didn't undestand where to put this cmdlet in the build agent ?

freddydk commented 5 years ago

Start PowerShell or PowerShell ISE (if the container hasn't been removed)

judecot commented 5 years ago

The Build container has been removed image

freddydk commented 5 years ago

you can modify the pipeline to note remove the container.

judecot commented 5 years ago

Ok so here is what Get-NavContainerAppInfo returns:

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 063b3ac9-c464-4899-96e0-70d5425854e4
Name           : _Exclude_AnonymizedDataSharing_
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 8b3609cf-3947-44c3-9f20-ce6edc6da33f
Name           : _Exclude_ClientAddIns_
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 1b80b577-772f-4e0f-bc13-50214fb3da6e
Name           : QuickBooks Data Migration
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 2a89f298-7ffd-44a5-a7ce-e08dac98abce
Name           : Essential Business Headlines
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 30828ce4-53e3-407f-ba80-13ce8d79d110
Name           : Ceridian Payroll
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 58623bfa-0559-4bc2-ae1c-0979c29fd9e0
Name           : Intelligent Cloud Base
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 334ef79e-547e-4631-8ba1-7a7f18e14de6
Name           : Business Central Intelligent Cloud
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 3d5b2137-efeb-4014-8489-41d37f8fd4c3
Name           : Late Payment Prediction
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 4b5fcac9-28df-4cd8-a6c4-89bd084c0d30
Name           : _Exclude_QuickBooksDesktopSynchronization_
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 68ac36e6-e8eb-493a-aab6-12c246996e05
Name           : _Exclude_QuickBooksSynchronization_
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : 936d57e3-05fe-4aff-8459-35aa9367abec
Name           : Dynamics GP Data Migration
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : bc45ae22-3b5b-44b5-beb4-2a42bf79cc34
Name           : Quickbooks Payroll File Import
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : c526b3e9-b8ca-4683-81ba-fcd5f6b1472a
Name           : Sales and Inventory Forecast
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : ce917438-506c-4724-9b01-13c1b860e851
Name           : Microsoft Pay
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : d09fa965-9a2a-424d-b704-69f3b54ed0ce
Name           : PayPal Payments Standard
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : e2743298-9ccb-49cd-9d8e-4b2d1ab91d36
Name           : Envestnet Yodlee Bank Feeds
Publisher      : Microsoft
Version        : 2.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : e868ad92-21b8-4e08-af2b-8975a8b06e04
Name           : Image Analyzer
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : fbb56a54-4f3b-4d2f-9330-ed8921ec4ec7
Name           : _Exclude_SyncBaseApp_
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global

ServerInstance : MicrosoftDynamicsNavServer$NAV
PSComputerName : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId     : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
AppId          : feeb3504-556e-4790-b28d-a2b9ce302d81
Name           : Dynamics GP Intelligent Cloud
Publisher      : Microsoft
Version        : 1.0.28874.0
ExtensionType  : ModernDev
Scope          : Global
freddydk commented 5 years ago

Could you try again with -symbolsonly

The above all have Publisher...

judecot commented 5 years ago

Yes:

ServerInstance    : MicrosoftDynamicsNavServer$NAV
PSComputerName    : 2e036f2aecd4cf30cb653d59952ddc2067b0eec2b6ed84dbaadc806a1092e61d
RunspaceId        : 63b43868-7d68-43d5-8f8c-d9cea8e185ec
Brief             : 
Description       : 
CompatibilityId   : 0.0.0.0
PrivacyStatement  : 
Eula              : 
Help              : 
Url               : 
Logo              : 
DeveloperTenantId : 
ScreenShots       : {}
Dependencies      : {}
Capabilities      : {}
AppId             : 8874ed3a-0643-4247-9ced-7a7002f7135d
Name              : System
Publisher         : Microsoft
Version           : 13.0.12929.0
ExtensionType     : ModernDev
Scope             : Global
freddydk commented 5 years ago

Very strange... In PowerShell ISE try to open a new tab and run this code:

$containerName = "name of your container"
$tenant = "default"
    $publishedApps = Invoke-ScriptInNavContainer -containerName $containerName -ScriptBlock { Param($tenant)
        Get-NavAppInfo -ServerInstance NAV -tenant $tenant
        Get-NavAppInfo -ServerInstance NAV -symbolsOnly
    } -ArgumentList $tenant

    $applicationApp = $publishedApps | Where-Object { $_.publisher -eq "Microsoft" -and $_.name -eq "Application" }
judecot commented 5 years ago

Yes, what have we to expect with it ? It just returns this:

image

freddydk commented 5 years ago

I was expecting it to fail - these are the lines that fails in the script. You could change the compile app script to print out the values of publishedapps before the line to see what causes the issue. It shouldn't ne possible that an app didn't have a publisher.

judecot commented 5 years ago

Hi Freddy,

I've just updated the Comple-AppInNavContainer to log $publishedapps: image

Here is the log: image

judecot commented 5 years ago

If i do the same in my Powershell ISE:

image

it returns:

Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Manag ement.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsof t.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cm dlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynami cs.Nav.Apps.Management.Cmdlets.NavAppInfo Microsoft.Dynamics.Nav.Apps.Management.Cmdlets.NavAppInfoDetail

judecot commented 5 years ago

@freddydk

I've just tried, with the exactly same repo, to run the agent in an Azure VM. And it works fine !

freddydk commented 5 years ago

The problem is the license file. The publishedapps array contains a licensefile warning as one of the objects - and that one of course doesn't have a publisher.

judecot commented 5 years ago

I've done exactly the same on the Azure VM, with the same license file. Why didn't it fail too ? I had the same warning message when creating the build container, but compilation was ok image

freddydk commented 5 years ago

I don’t know – I didn’t see the warnings in your output else. I will try to modify the compile-app script to be recillient against this kind of warnings.

/Freddy

From: jdecottignies notifications@github.com Sent: 21. marts 2019 06:08 To: Microsoft/navcontainerhelper navcontainerhelper@noreply.github.com Cc: Freddy Kristiansen Freddy.Kristiansen@microsoft.com; Mention mention@noreply.github.com Subject: Re: [Microsoft/navcontainerhelper] [Devops Pipeline].[Compile-App] publisher property not found (#391)

I've done exactly the same on the Azure VM, with the same license file. Why didn't it fail too ? I had the same warning message when creating the build container, but compilation was ok [image]https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F29598240%2F54753993-bc93b680-4be2-11e9-9e64-784eb67ff06c.png&data=02%7C01%7Cfreddy.kristiansen%40microsoft.com%7Ca88a33b44cc0400d542708d6adfe470c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636887704952362115&sdata=BV7JK9vRQRmJbmi5cHZCjx%2BLRwmLBKAFIw%2FxxokksVw%3D&reserved=0

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fnavcontainerhelper%2Fissues%2F391%23issuecomment-475221398&data=02%7C01%7Cfreddy.kristiansen%40microsoft.com%7Ca88a33b44cc0400d542708d6adfe470c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636887704952362115&sdata=vmlqBHN4FGvBreoDBofmlU01Gbd%2BVpU1apGS6WNRIZM%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKRqA1lEd4YIPRn92To5CwMS7GCS2P_9ks5vY4Q-gaJpZM4b_pvE&data=02%7C01%7Cfreddy.kristiansen%40microsoft.com%7Ca88a33b44cc0400d542708d6adfe470c%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636887704952372119&sdata=N0ZqkHXDG644zZeYuxtTnj6MKcms1UXzJtEuQRE3f6w%3D&reserved=0.

freddydk commented 5 years ago

This should be fixed in 0.5.0.11