HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOps App Compiler refers to wrong artifacts folder #440

Closed dNsl9r closed 3 years ago

dNsl9r commented 3 years ago

Describe the bug Noticed this morning, that our build pipelines fail on step "ALOps App Compiler". Instead of referring to the correct artifacts folder like: 'C:\bcartifacts.cache\sandbox\19.0.29894.31374\de\Applications.DE\Any.Source.zip' some cryptic subfolders are used. 'C:\bcartifacts.cache\sandbox\19.0.29894.31374\tbsskl5m.ghw\Applications.DE\Any.Source.zip'

the used yaml please provide the yaml that you used. It helps you put the yaml like this:

....
    - task: ALOpsAppCompiler@2
      displayName: 'Compile App'
      inputs:
        artifacttype: 'Sandbox'
        artifactcountry: 'de'
        ruleset: '.\.vscode\settings.RuleSet.json'        
        appversiontemplate: '$(D365BC19-ReleaseNo).*'
        appfilenametemplate: '%APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app'
        alcodeanalyzer: 'CodeCop,AppSourceCop'
        showmycode: 'Disable'  
        publishartifact: True
        publishxlif: True             
....

the output Also the complete output is necessary for us to see what is going on. Also use backtics:

2021-10-18T12:35:27.7248994Z ##[section]Starting: Compile App
2021-10-18T12:35:27.7453347Z ==============================================================================
2021-10-18T12:35:27.7453684Z Task         : ALOps App Compiler
2021-10-18T12:35:27.7453961Z Description  : Compile AL Extension(s) for Business Central
2021-10-18T12:35:27.7454196Z Version      : 2.0.2647
2021-10-18T12:35:27.7454678Z Author       : Hodor
2021-10-18T12:35:27.7454944Z Help         : Compile Business Central extension(s) from AL code.
2021-10-18T12:35:27.7455458Z ==============================================================================
2021-10-18T12:35:29.6234014Z *** Configure AMSI for session: disable (in memory)
2021-10-18T12:35:29.6499173Z 0
2021-10-18T12:35:29.8697164Z ******************************************************************************
2021-10-18T12:35:29.8713214Z *** ALOps v2 - Preview                                                     ***
2021-10-18T12:35:29.8727857Z ******************************************************************************
2021-10-18T12:35:29.8742278Z *** Importing required ALOps-Functions
2021-10-18T12:35:30.5171262Z *** Task Inputs:
2021-10-18T12:35:30.5242282Z 
2021-10-18T12:35:30.5385238Z name                   value                                                                           
2021-10-18T12:35:30.5390026Z ----                   -----                                                                           
2021-10-18T12:35:30.5393552Z artifactversion                                                                                        
2021-10-18T12:35:30.5396582Z artifacttype           Sandbox                                                                         
2021-10-18T12:35:30.5399321Z artifactcountry        de                                                                              
2021-10-18T12:35:30.5402460Z versionselect          Latest                                                                          
2021-10-18T12:35:30.5405589Z alternativevsixurl                                                                                     
2021-10-18T12:35:30.5409444Z alsourcepath           C:\Agent\_work\92\s                                                             
2021-10-18T12:35:30.5412332Z ruleset                .\.vscode\settings.RuleSet.json                                                 
2021-10-18T12:35:30.5415991Z appversiontemplate     19.0.0.*                                                                        
2021-10-18T12:35:30.5418680Z updatebuildnumber      True                                                                            
2021-10-18T12:35:30.5420967Z appfilenametemplate    %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app
2021-10-18T12:35:30.5423432Z alcodeanalyzer         CodeCop,AppSourceCop                                                            
2021-10-18T12:35:30.5426453Z showmycode             Disable                                                                         
2021-10-18T12:35:30.5429485Z applicationinsightskey                                                                                 
2021-10-18T12:35:30.5433109Z alcachepath            C:\Agent\_work\92\s                                                             
2021-10-18T12:35:30.5435923Z publishartifact        True                                                                            
2021-10-18T12:35:30.5438122Z publishxlif            True                                                                            
2021-10-18T12:35:30.5441179Z failonwarnings         False                                                                           
2021-10-18T12:35:30.5445109Z storageaccount                                                                                         
2021-10-18T12:35:30.5447453Z sastoken                                                                                               
2021-10-18T12:35:30.5450642Z printappmanifest       True                                                                            
2021-10-18T12:35:30.5453922Z outputalclogs          True                                                                            
2021-10-18T12:35:30.5454865Z additionalprobingpaths                                                                                 
2021-10-18T12:35:30.5455295Z 
2021-10-18T12:35:30.5492909Z 
2021-10-18T12:35:30.5506240Z 
2021-10-18T12:35:30.5728580Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-10-18T12:35:30.5734794Z 
2021-10-18T12:35:30.9231542Z *** ALOps License:
2021-10-18T12:35:30.9263351Z   * Licensed To: ###############
2021-10-18T12:35:30.9270461Z 
2021-10-18T12:35:31.1160025Z *** Importing required Task-Functions
2021-10-18T12:35:33.7070541Z 
2021-10-18T12:35:33.7680851Z *** Artifact Type   : [Sandbox]
2021-10-18T12:35:33.7693224Z *** Artifact Version: []
2021-10-18T12:35:33.7708409Z *** Artifact Country: [de]
2021-10-18T12:35:33.7715884Z *** AL Source Path  : [C:\Agent\_work\92\s]
2021-10-18T12:35:33.7764632Z *** AL Cache Path   : [C:\Agent\_work\92\s]
2021-10-18T12:35:33.7766824Z 
2021-10-18T12:35:33.8039339Z 
2021-10-18T12:35:33.8138517Z *** Default Working Folder: C:\Agent\_work\92\s
2021-10-18T12:35:33.8152672Z *** Artifact Folder       : C:\Agent\_work\92\a
2021-10-18T12:35:33.8165798Z *** Agent Tool Folder     : C:\Agent\_work\_tool
2021-10-18T12:35:33.8179829Z *** Agent Temp Folder     : C:\Agent\_work\_temp
2021-10-18T12:35:33.8185966Z 
2021-10-18T12:35:33.8243090Z *** Resolving Path: [C:\Agent\_work\92\s]
2021-10-18T12:35:33.8319179Z *** AL Source Folder      : C:\Agent\_work\92\s
2021-10-18T12:35:33.8335609Z *** Resolving Path: [C:\Agent\_work\92\s]
2021-10-18T12:35:33.8366731Z *** AL Cache Folder       : C:\Agent\_work\92\s
2021-10-18T12:35:33.8372152Z 
2021-10-18T12:35:33.8399819Z *** Check BcContainerHelper
2021-10-18T12:35:34.0104909Z *** Load BcContainerHelper
2021-10-18T12:35:34.2326833Z BcContainerHelper version 2.0.6
2021-10-18T12:35:35.1163567Z 
2021-10-18T12:35:35.1174892Z 
2021-10-18T12:35:35.1254418Z ##[command]"Get-BCArtifactUrl" 
2021-10-18T12:35:35.1255358Z Name                           Value                                                                                   
2021-10-18T12:35:35.1256135Z ----                           -----                                                                                   
2021-10-18T12:35:35.1256731Z select                         Latest                                                                                  
2021-10-18T12:35:35.1257350Z type                           Sandbox                                                                                 
2021-10-18T12:35:35.1257992Z country                        de                                                                                      
2021-10-18T12:35:35.1258355Z 
2021-10-18T12:35:35.1275674Z 
2021-10-18T12:35:35.1276418Z  -select: Latest -type: Sandbox -country: de
2021-10-18T12:35:42.1136633Z Downloading platform artifact /sandbox/19.0.29894.31374/platform
2021-10-18T12:35:42.1301512Z Downloading C:\Users\###\AppData\Local\Temp\20233735-93f4-48bb-b561-61ca7c6fbc33.zip
2021-10-18T12:35:53.9758723Z Unpacking platform artifact to tmp folder using Expand-Archive
2021-10-18T12:36:08.6713401Z ##[error]Cannot find path 'C:\bcartifacts.cache\sandbox\19.0.29894.31374\krlb4eyi.ogp\Applications\APIV1\Source' because it does not exist.
2021-10-18T12:36:08.7172711Z ##[section]Finishing: Compile CVN App

Expected behavior Using subpath de instead of krlb4eyi.ogp.

Additional context Tested also with "Artifact Version" filter like 18 - same problem. Last Friday everything worked without any problems. No Updates installed on the machine..

I'm kinda confused because ALOps Version was last friday 2.0.2647 - and today it's the same. So I guess nothing changed at your side as well?

dNsl9r commented 3 years ago

After cleaning up the whole build machine, deleting all temp folders, artifacts etc it is running as expected again. Don't ask me why 😕

dNsl9r commented 2 years ago

Had the same issue again. Solution the same as the last time, deleting everything - running pipeline again: Works as expected

waldo1001 commented 2 years ago

What we do: As a last step of each pipeline, we run the ALopsMaintaintenance step - this makes sure the step is always run after an agent has been used .. . May be try that?

dNsl9r commented 2 years ago

We thought about this, but as we want to save time we do this only once a month. Maybe I can add a cleaning job that runs once a week..

waldo1001 commented 2 years ago

The problem with that is that you don't really know which build server it will execute, and you want to execute cleaning jobs on all build servers.

There is a way to circumvent this (it was explained somewhere in the forum), but the disadvantage then is that you'll have to maintain the buildserver-names in a pipeline.

My approach just makes sure that every buildserver that is used, is also cleaned 🤷‍♀️

dNsl9r commented 2 years ago

We are currently using just one buildserver, so that's no problem for us 👍

waldo1001 commented 2 years ago

Then the only thing I can think of is to up the frequency. For example: once a day during the night? I mean - why not? ;-)