HodorNV / ALOps

ALOps
56 stars 24 forks source link

A package with publisher 'publisher', name 'MyBaseApp', and a version compatible with '1.0.0.0' could not be found in the package cache folder 'c:\Run\DevOps\PackageCache' #157

Closed mrabus closed 4 years ago

mrabus commented 4 years ago

Hi guys,

I came to a problem I can't solve on my own when compiling MyApp that depends on another app (let's call that MyBaseApp).

MyBaseApp has its own pipeline and got version 1.0.202030.360 during the last run. In MyApp, I have a dependency to Version 1.0.0.0 of My Base App. We use image version: mcr.microsoft.com/businesscentral/onprem:16.3.14085.14238-de

To do CI for MyApp i created the following pipeline: image

image

Downloading the base app and publishing it to my container works just fine but during the compilation of MyApp I get the following error:

[error]Compilation started for project 'MyApp '260' files at '23:31:18.841'.

[error]error AL1022: A package with publisher 'B.i.TEAM Gesellschaft für Softwareberatung mbH', name 'MyBaseApp', and a version compatible with '1.0.0.0' could not be found in the package cache folder 'c:\Run\DevOps\PackageCache'

[error]Compilation ended at '23:31:26.560'.

If I do the same process locally on my machine it just works. Do you have any idea what I'm doing wrong here?

waldo1001 commented 4 years ago

Can you give us the output of the download-step, and of the publish-step? and also the step that fails?

mrabus commented 4 years ago

Of course:

Output Download Step:

Starting: Download MyBaseAppApp
==============================================================================
Task         : Download build artifacts
Description  : Download files that were saved as artifacts of a completed build
Version      : 0.167.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/download-build-artifacts
==============================================================================
Latest build found:  360
Downloading artifacts for build: 360
Linked artifacts count:  1
Downloading items from container resource #/4353709/Ehret
Downloading artifact Dynamics 365 App from: https://dev.azure.com/biteam//_apis/resources/Containers/4353709?itemPath=Customername&isShallow=true&api-version=4.1-preview.4
Downloading Customername/B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app to C:\agent\_work\5\a\Customername\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app
Downloaded Customername/B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app to C:\agent\_work\5\a\Customername\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app
Skipped processing item Customername/compilelog.txt
Total Files: 2, Processed: 1, Skipped: 1, Failed: 0, Download time: 1.024 secs, Download size: 94266Bytes
Successfully downloaded artifacts to C:\agent\_work\5\a
Finishing: Download MyBaseApp App
mrabus commented 4 years ago

Publish Step:

Starting: ALOpsAppPublish
-
Task         : ALOps App Publish
Description  : Publish NAV Apps
Version      : 1.431.1520
Author       : Hodor
Help         : Publish Business Central extension to service tier.
-
*** Validate configuration
*** No ALOps License found. Set License with the [alops-licenseid] or [alops_licenseid] variables.
*** Importing required PS-Functions
 - Use Docker         = True
 - Artifact Path      = 
 - App Filter         = *.app
 - Process Type       = Build
 - Skip Verification  = True
 - Force Sync         = False

*** Importing required PS-Functions
*** Initiate Docker Session
*** Set Docker Container ErrorActionPreference = Stop
*** Install AL TestTool: False
*** Working folder: C:\agent\_work\5\s
*** Artifact folder: C:\agent\_work\5\a
*** Pipeline workspace: C:\agent\_work\5
***
*** Copy Artifacts to Docker Container: 5c0af91f7d66f885714bb28003adc2c6089d95a3925b29609f7529b33fddbc59
*** Docker Artifacts Folder: c:\Run\DevOps\Artifacts
*** Dynamic resolve App file.
*** Scanning [System.DefaultWorkingDirectory].
*** Scanning [System.ArtifactsDirectory].
*** Scanning [Pipeline.Workspace].
*** Multiple App files found with filter [*.app].
  * C:\agent\_work\5\a\Customername\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app
*** Resolved App File: [B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app].
*** Copy Artifact: [C:\agent\_work\5\a\Customername\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app]
*** Import NAV/BC Management DLL's
*** Loading assemblies for ServiceTier [BC].
*** Loading assemblies from: [C:\program files\microsoft dynamics nav\160\service]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]

**************************************
 * App File = [c:\Run\DevOps\Artifacts\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app]

 * App.ID        = f90a6281-5db4-4672-9e17-6b287ed009e3
 * App.Name      = MyBaseApp
 * App.Publisher = B.i.TEAM Gesellschaft für Softwareberatung mbH
 * App.Version   = 1.0.202030.360
 => Publishing App 'MyBaseApp v1.0.202030.360'
*** Get Tenants

PSComputerName                         : 5c0af91f7d66f885714bb28003adc2c6089d95a3925b29609f7529b33fddbc59
RunspaceId                             : 20bb1cd9-c25e-4697-a10a-020128214728
ServerInstance                         : MicrosoftDynamicsNavServer$BC
DatabaseName                           : Cronusde
DatabaseServer                         : localhost\SQLEXPRESS
DatabaseUserName                       : 
mrabus commented 4 years ago

And compile Extension:

Starting: ALOps Compile Extension
==============================================================================
Task         : ALOps App Compiler
Description  : Compiles NAV Apps
Version      : 1.431.1520
Author       : Hodor
Help         : Compile a Business Central extension from AL code.
==============================================================================
*** Validate configuration
*** No ALOps License found. Set License with the [alops-licenseid] or [alops_licenseid] variables.
*** Importing required PS-Functions
*** Initiate Docker Session
*** Set Docker Container ErrorActionPreference = Stop
*** Import NAV/BC Management DLL's
*** Loading assemblies for ServiceTier [BC].
*** Loading assemblies from: [C:\program files\microsoft dynamics nav\160\service]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Apps.Management.dll]
*** Selected module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Loading module: [C:\program files\microsoft dynamics nav\160\service\Microsoft.Dynamics.Nav.Management.dll]
*** Setting up AL Compiler [ALLanguage]
*** Downloading AL Compiler [ALLanguage]
*** Get Extension from Local-Disk...[C:\Run\ALLanguage.vsix]
*** Resolving Path [C:\Run\ALLanguage.vsix]
*** VSIX Path Resolved: [C:\Run\ALLanguage.vsix]
*** Unpacking Extension to folder...
*** Loading Json Object: [c:\Run\Microsoft.al\al-ALLanguage\extension\package.json]
*** Using AL Compiler [vALLanguage] located [C:\Run\Microsoft.al\al-ALLanguage\extension\bin\alc.exe]
***
*** Working folder: C:\agent\_work\5\s
***
*** Copy Working folder to Docker Container: 5c0af91f7d66f885714bb28003adc2c6089d95a3925b29609f7529b33fddbc59
*** Docker Working Folder: c:\Run\DevOps\
*** Copy from [C:\agent\_work\5\s] to [c:\Run\DevOps\]
*** Source File setup completed
*** Target Project: \app.json
*** Check for app.json files: c:\Run\DevOps\
*** Project found:
   - C:\Run\DevOps
*** Retrieving App-Info [\app.json]
*** Loading Json Object: [c:\Run\DevOps\app.json]
  * App.ID          = f0387a01-4ad3-4600-9cd7-14bf0f3c85d8
  * App.Name        = Customername General
  * App.Publisher   = B.i.TEAM Gesellschaft für Softwareberatung mbH
  * App.Version     = 1.0.0.2
  * App.Platform    = 16.0.0.0
  * App.Application = 
***
*** Match: yyyyWW
*** Retaining original [Major] from version (?.0.0.0)
*** Retaining original [Minor] from version (0.?.0.0)
*** Setting Managed App Version [c:\Run\DevOps\app.json] =>  1.0.202030.369
***
*** Working Direcotry: [c:\Run\DevOps\]
*** Target Project: [\app.json]
*** Project Directory: [c:\Run\DevOps]
*** VSCode Settings: [c:\Run\DevOps\.vscode\settings.json]
*** VSCode-Settings json found.
*** Loading Json Object: [c:\Run\DevOps\.vscode\settings.json]
*** No AL-RuleSet json found.
***
***
*** Download Application-Symbols for [Base Application v16.0.0.0]
*** Downloading NAV Symbols for [Base Application v16.0.0.0]
*** Downloading NAV Symbols from [https://5c0af91f7d66:7049/BC/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0&tenant=default]
*** Downloading NAV Symbols with BasicAuthentication [admin]
Invoke-RestMethod -Method Get -Uri https://5c0af91f7d66:7049/BC/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0&tenant=default
*** Content-Disposition: attachment; filename="Microsoft_Base Application_16.3.14085.14238.app"
*** Saving symbol file [Microsoft_Base Application_16.3.14085.14238.app] to [c:\Run\DevOps\PackageCache]
*** Read App Manifest: [c:\Run\DevOps\PackageCache\Microsoft_Base Application_16.3.14085.14238.app].
*** Propagated Dependency: Microsoft - System Application - 16.3.0.0
***
*** Download Application-Symbols for [MyBaseApp v1.0.0.0]
*** Downloading NAV Symbols for [MyBaseApp v1.0.0.0]
*** Downloading NAV Symbols from [https://5c0af91f7d66:7049/BC/dev/packages?publisher=B.i.TEAM Gesellschaft für Softwareberatung mbH&appName=MyBaseApp&versionText=1.0.0.0&tenant=default]
*** Downloading NAV Symbols with BasicAuthentication [admin]
Invoke-RestMethod -Method Get -Uri https://5c0af91f7d66:7049/BC/dev/packages?publisher=B.i.TEAM Gesellschaft für Softwareberatung mbH&appName=MyBaseApp&versionText=1.0.0.0&tenant=default
*** Content-Disposition: attachment; filename="=?utf-8?B?Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=?="
*** Modified Name from [=?utf-8?B?Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=?=] to [=_utf-8_B_Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=_=]
*** Saving symbol file [=_utf-8_B_Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=_=] to [c:\Run\DevOps\PackageCache]
*** Read App Manifest: [c:\Run\DevOps\PackageCache\=_utf-8_B_Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=_=].
***
*** Download Application-Symbols for [System Application v16.3.0.0]
*** Downloading NAV Symbols for [System Application v16.3.0.0]
*** Downloading NAV Symbols from [https://5c0af91f7d66:7049/BC/dev/packages?publisher=Microsoft&appName=System Application&versionText=16.3.0.0&tenant=default]
*** Downloading NAV Symbols with BasicAuthentication [admin]
Invoke-RestMethod -Method Get -Uri https://5c0af91f7d66:7049/BC/dev/packages?publisher=Microsoft&appName=System Application&versionText=16.3.0.0&tenant=default
*** Content-Disposition: attachment; filename="Microsoft_System Application_16.3.14085.14238.app"
*** Saving symbol file [Microsoft_System Application_16.3.14085.14238.app] to [c:\Run\DevOps\PackageCache]
*** Read App Manifest: [c:\Run\DevOps\PackageCache\Microsoft_System Application_16.3.14085.14238.app].
***
*** Starting AL Compiler...
*** App.Name         = Customername General
*** App.Publisher    = B.i.TEAM Gesellschaft für Softwareberatung mbH
*** App.Compiler Path= C:\Run\Microsoft.al\al-ALLanguage\extension\bin\alc.exe
*** Checking for Assemblies in App
*** Assemblies in App found. Adding Probing Paths (1).
  * C:\Run\DevOps\.netpackages
*** Add Windows Assembly Path [C:\Windows\assembly]
& C:\Run\Microsoft.al\al-ALLanguage\extension\bin\alc.exe /packagecachepath:"c:\Run\DevOps\PackageCache" /project:"c:\Run\DevOps" /out:"c:\Run\DevOps\B.i.TEAM Gesellschaft für Softwareberatung mbH_Customername General_1.0.202030.369.app" /fullpaths /assemblyprobingpaths:C:\Run\DevOps\.netpackages,C:\Windows\assembly
*** AL Compiler Exit Code: 1
*** AL Compiler raw logs: Start
Microsoft (R) AL Compiler version 5.0.4.26576 Copyright (C) Microsoft Corporation. All rights reserved  Compilation started for project 'Customername General' containing '260' files at '9:2:36.354'.  error AL1022: A package with publisher 'B.i.TEAM Gesellschaft für Softwareberatung mbH', name 'MyBaseApp', and a version compatible with '1.0.0.0' could not be found in the package cache folder 'c:\Run\DevOps\PackageCache'  Compilation ended at '9:2:43.963'. 
*** AL Compiler raw logs: End
*** Start processing compile results.
##[error]Compilation started for project 'Customername General' containing '260' files at '9:2:36.354'.
##[error]error AL1022: A package with publisher 'B.i.TEAM Gesellschaft für Softwareberatung mbH', name 'MyBaseApp', and a version compatible with '1.0.0.0' could not be found in the package cache folder 'c:\Run\DevOps\PackageCache'
##[error]Compilation ended at '9:2:43.963'.
*** Store compile log to [c:\Run\DevOps\compilelog.txt]
*** Start processing compile results done.
*** Transfer App Artifact from Docker container.
##[error]Cannot find path 'c:\Run\DevOps\B.i.TEAM Gesellschaft für Softwareberatung mbH_Customername General_1.0.202030.369.app' because it does not exist.
Async Command Start: Add Build Tag
Build '369' has following tags now: mcr.microsoft.com/businesscentral/onprem-16.3.14085.14238-de-ltsc2019, BC.Platform.16.0.14073.14195, BC.Version.16.3.14085.14238, AL.Compiler.ALLanguage, App.MyBaseApp.1.0.202030.360
Async Command End: Add Build Tag
Async Command Start: Update Build Number
Update build number to 1.0.202030.369 for build 369
Async Command End: Update Build Number
Finishing: ALOps Compile Extension
waldo1001 commented 4 years ago

I don't see anything wrong .. .

We need to investigate if the extension gets published. What I would do:

And then please report back. I assume it's again the special chars that's playing its part :(.

mrabus commented 4 years ago

So, i did just that:

The download of the dependency seems to have an issue: If I navigate to the PackageCache folder, MyBaseApp is missing.

image

Then I tried to invoke the WebRequest and made it work:

[E5D49767AD35]: PS C:\Run\DevOps\PackageCache>     Directory: C:\Run\DevOps\PackageCache

Mode                LastWriteTime         Length Name                                                                                             
----                -------------         ------ ----                                                                                             
-a----        7/27/2020   6:01 PM         108325 =_utf-8_B_Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDM
                                                 wLjM2MC5hcHA=_=                                                                                  
-a----        7/27/2020   6:47 PM         108325 B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app                        
-a----        7/27/2020   6:01 PM       30017871 Microsoft_Base Application_16.3.14085.14238.app                                                  
-a----        7/27/2020   6:01 PM          68199 Microsoft_System Application_16.3.14085.14238.app                                                
-a----        7/27/2020   6:01 PM         126536 Microsoft_System_16.0.14073.14195.app    

Can we somehow debug the web request within ALOps?

waldo1001 commented 4 years ago

So you executed the exact "Invoke-RestMethod" as it was displayed in the output?

waldo1001 commented 4 years ago

Ok, we found the issue - the weird first file happens to be the app-file. We'll fix it. (and yes, it's again those "unconventional" characters ;-))

mrabus commented 4 years ago

Yes, I executed the invoke-webrequest and wrote the output to a file.

One different question: I requested a ALOps license last week (through your website). Didn't hear anything back since then. Can you check that too? :-)

waldo1001 commented 4 years ago

One different question: I requested a ALOps license last week (through your website). Didn't hear anything back since then. Can you check that too? :-)

Thanks for the order ;-). We decided to send you that by the end of the week (beginning of the month - makes it somewhat more clear). I hope you're not stuck at the moment?

mrabus commented 4 years ago

Not yet. I guess my test license ran out yesterday (started 27.06.) but my ALOps tasks seem to run just fine today :-)

mrabus commented 4 years ago

It ran without error - yaaay. Thank youuu!

I don't know if it's a bug or a feature but the file name of MyBaseApp is still a funny string compared to the Base App from MS.


*** Download Application-Symbols for [Base Application v16.0.0.0]
*** Downloading NAV Symbols for [Base Application v16.0.0.0]
*** Downloading NAV Symbols from [https://1325d323d676:7049/BC/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0&tenant=default]
*** Downloading NAV Symbols with BasicAuthentication [admin]
Invoke-RestMethod -Method Get -Uri https://1325d323d676:7049/BC/dev/packages?publisher=Microsoft&appName=Base Application&versionText=16.0.0.0&tenant=default
*** Content-Disposition: attachment; **filename="Microsoft_Base Application_16.3.14085.14238.app"**
*** Saving symbol file [Microsoft_Base Application_16.3.14085.14238.app] to [c:\Run\DevOps\PackageCache]
*** Read App Manifest: [c:\Run\DevOps\PackageCache\Microsoft_Base Application_16.3.14085.14238.app].
*** Propagated Dependency: Microsoft - System Application - 16.3.0.0
***
*** Download Application-Symbols for [MyBaseApp v1.0.0.0]
*** Downloading NAV Symbols for [MyBaseApp v1.0.0.0]
*** Downloading NAV Symbols from [https://1325d323d676:7049/BC/dev/packages?publisher=B.i.TEAM Gesellschaft für Softwareberatung mbH&appName=MyBaseApp&versionText=1.0.0.0&tenant=default]
*** Downloading NAV Symbols with BasicAuthentication [admin]
Invoke-RestMethod -Method Get -Uri https://1325d323d676:7049/BC/dev/packages?publisher=B.i.TEAM Gesellschaft für Softwareberatung mbH&appName=MyBaseApp&versionText=1.0.0.0&tenant=default
*** Content-Disposition: attachment; f**ilename="=?utf-8?B?Qi5pLlRFQU0gR2VzZWxsc2NoYWZ0IGbDvHIgU29mdHdhcmViZXJhdHVuZyBtYkhfZWFzeVBERl8xLjAuMjAyMDMwLjM2MC5hcHA=?="**
*** Saving symbol file [B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app] to [c:\Run\DevOps\PackageCache]
*** Read App Manifest: [c:\Run\DevOps\PackageCache\B.i.TEAM Gesellschaft für Softwareberatung mbH_MyBaseApp_1.0.202030.360.app].
***

If it works it can stay like that of course. Just wanted to point it out in case the file name causes issues later on.

waldo1001 commented 4 years ago

We did an update, indeed ;-). Thanks for confirming.

The funny string is what Microsoft returns - not sure why, but nothing much we can do about that - I'm just happy that it works.