HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOps Compiler Errror - Windows PowerShel NonInteractive-Mode (BC 19) #445

Closed pri-kise closed 2 years ago

pri-kise commented 2 years ago

Describe the bug We receive strange errors for our pipelines.

Windows PowerShell wird im NonInteractive-Modus ausgeführt. Lese- und Eingabeaufforderungsfunktionen sind nicht verfügbar.

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

name: $(Build.BuildId)

variables:
- name: 'AppVersion'
  value: '2.0.*.0'
- group: 'ALOps Settings'

pool:
  name: BusinessCentralBuildAgents

trigger:
- main

steps:
- checkout: self
  clean: true

- task: DownloadBuildArtifacts@0
  displayName: 'Download'
  inputs:
    buildType: 'specific'
    project: '17c2be83-1a75-4aae-96a2-42b1ab245c52'
    pipeline: '200' 
    buildVersionToDownload: 'latestFromBranch'
    allowPartiallySucceededBuilds: true
    branchName: 'refs/heads/main'
    downloadType: 'specific'
    itemPattern: '**/*.app'
    downloadPath: '$(System.ArtifactsDirectory)'

- task: ALOpsAppCompiler@2
  inputs:
    artifacttype: 'Sandbox'
    artifactcountry: 'de'
    appversiontemplate: '$(AppVersion)'
    alcodeanalyzer: 'AppSourceCop,CodeCop,PerTenantExtensionCop,UICop'
    publishartifact: false

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

2021-10-26T14:17:34.7468391Z ##[section]Starting: ALOpsAppCompiler
2021-10-26T14:17:34.7588418Z ==============================================================================
2021-10-26T14:17:34.7588870Z Task         : ALOps App Compiler
2021-10-26T14:17:34.7589217Z Description  : Compile AL Extension(s) for Business Central
2021-10-26T14:17:34.7589495Z Version      : 2.0.2647
2021-10-26T14:17:34.7590502Z Author       : Hodor
2021-10-26T14:17:34.7590818Z Help         : Compile Business Central extension(s) from AL code.
2021-10-26T14:17:34.7591226Z ==============================================================================
2021-10-26T14:17:36.4367925Z ******************************************************************************
2021-10-26T14:17:36.4376549Z *** ALOps v2 - Preview                                                     ***
2021-10-26T14:17:36.4386171Z ******************************************************************************
2021-10-26T14:17:36.4396148Z *** Importing required ALOps-Functions
2021-10-26T14:17:37.0330596Z *** Task Inputs:
2021-10-26T14:17:37.0398763Z 
2021-10-26T14:17:37.0558557Z name                   value                                                                           
2021-10-26T14:17:37.0565671Z ----                   -----                                                                           
2021-10-26T14:17:37.0569578Z artifactversion                                                                                        
2021-10-26T14:17:37.0573686Z artifacttype           Sandbox                                                                         
2021-10-26T14:17:37.0577258Z artifactcountry        de                                                                              
2021-10-26T14:17:37.0580842Z versionselect          Latest                                                                          
2021-10-26T14:17:37.0586889Z alternativevsixurl                                                                                     
2021-10-26T14:17:37.0588825Z alsourcepath           C:\agent3\_work\8\s                                                             
2021-10-26T14:17:37.0593393Z ruleset                                                                                                
2021-10-26T14:17:37.0597884Z appversiontemplate     2.0.*.0                                                                         
2021-10-26T14:17:37.0601534Z updatebuildnumber      True                                                                            
2021-10-26T14:17:37.0605439Z appfilenametemplate    %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%_%BC_TYPE%_%BC_VERSION%_%BC_COUNTRY%.app
2021-10-26T14:17:37.0609128Z alcodeanalyzer         AppSourceCop,CodeCop,PerTenantExtensionCop,UICop                                
2021-10-26T14:17:37.0613172Z showmycode             Keep                                                                            
2021-10-26T14:17:37.0616875Z applicationinsightskey                                                                                 
2021-10-26T14:17:37.0620675Z alcachepath            C:\agent3\_work\8\s                                                             
2021-10-26T14:17:37.0628602Z publishartifact        True                                                                            
2021-10-26T14:17:37.0632004Z publishxlif            False                                                                           
2021-10-26T14:17:37.0636115Z failonwarnings         False                                                                           
2021-10-26T14:17:37.0639567Z storageaccount                                                                                         
2021-10-26T14:17:37.0642842Z sastoken                                                                                               
2021-10-26T14:17:37.0646566Z printappmanifest       True                                                                            
2021-10-26T14:17:37.0649987Z outputalclogs          True                                                                            
2021-10-26T14:17:37.0654023Z additionalprobingpaths                                                                                 
2021-10-26T14:17:37.0654864Z 
2021-10-26T14:17:37.0686424Z 
2021-10-26T14:17:37.0696175Z 
2021-10-26T14:17:37.0916413Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-10-26T14:17:37.0919850Z 
2021-10-26T14:17:37.3557223Z *** ALOps License:
2021-10-26T14:17:37.3597803Z   * Licensed To: company(Organisation License)
2021-10-26T14:17:37.3603507Z 
2021-10-26T14:17:37.3833684Z *** Importing required Task-Functions
2021-10-26T14:17:39.9649661Z 
2021-10-26T14:17:39.9968258Z *** Artifact Type   : [Sandbox]
2021-10-26T14:17:39.9983651Z *** Artifact Version: []
2021-10-26T14:17:39.9996561Z *** Artifact Country: [de]
2021-10-26T14:17:40.0008281Z *** AL Source Path  : [C:\agent3\_work\8\s]
2021-10-26T14:17:40.0019088Z *** AL Cache Path   : [C:\agent3\_work\8\s]
2021-10-26T14:17:40.0022986Z 
2021-10-26T14:17:40.0060793Z 
2021-10-26T14:17:40.0379554Z *** Default Working Folder: C:\agent3\_work\8\s
2021-10-26T14:17:40.0391574Z *** Artifact Folder       : C:\agent3\_work\8\a
2021-10-26T14:17:40.0403133Z *** Agent Tool Folder     : C:\agent3\_work\_tool
2021-10-26T14:17:40.0414039Z *** Agent Temp Folder     : C:\agent3\_work\_temp
2021-10-26T14:17:40.0419425Z 
2021-10-26T14:17:40.0508015Z *** Resolving Path: [C:\agent3\_work\8\s]
2021-10-26T14:17:40.0582758Z *** AL Source Folder      : C:\agent3\_work\8\s
2021-10-26T14:17:40.0597212Z *** Resolving Path: [C:\agent3\_work\8\s]
2021-10-26T14:17:40.0615180Z *** AL Cache Folder       : C:\agent3\_work\8\s
2021-10-26T14:17:40.0618729Z 
2021-10-26T14:17:40.0644547Z *** Check BcContainerHelper
2021-10-26T14:17:40.1234435Z *** Load BcContainerHelper
2021-10-26T14:17:40.2910045Z BcContainerHelper version 2.0.12
2021-10-26T14:17:41.1256153Z 
2021-10-26T14:17:41.1261378Z 
2021-10-26T14:17:41.1340844Z ##[command]"Get-BCArtifactUrl" 
2021-10-26T14:17:41.1341505Z Name                           Value                                                                                   
2021-10-26T14:17:41.1342546Z ----                           -----                                                                                   
2021-10-26T14:17:41.1343566Z select                         Latest                                                                                  
2021-10-26T14:17:41.1344796Z type                           Sandbox                                                                                 
2021-10-26T14:17:41.1345715Z country                        de                                                                                      
2021-10-26T14:17:41.1346144Z 
2021-10-26T14:17:41.1346315Z 
2021-10-26T14:17:41.1346788Z  -select: Latest -type: Sandbox -country: de
2021-10-26T14:17:47.5403743Z *** Platform: c:\bcartifacts.cache\sandbox\19.0.29894.31651\platform
2021-10-26T14:17:47.5433065Z *** Localisation: c:\bcartifacts.cache\sandbox\19.0.29894.31651\de
2021-10-26T14:17:47.5759549Z *** BC Management DLL: C:\bcartifacts.cache\sandbox\19.0.29894.31651\platform\ServiceTier\program files\Microsoft Dynamics NAV\190\Service\Microsoft.Dynamics.Nav.Management.dll
2021-10-26T14:17:47.6233334Z *** BC App Management DLL: C:\bcartifacts.cache\sandbox\19.0.29894.31651\platform\ServiceTier\program files\Microsoft Dynamics NAV\190\Service\Microsoft.Dynamics.Nav.Apps.Management.dll
2021-10-26T14:17:47.6529058Z *** Get [*.app] and [app.json] files recursive from [C:\agent3\_work\8\s]
2021-10-26T14:17:47.6692228Z *** Found [1] file.
2021-10-26T14:17:47.6703206Z *** Extract App detail from [C:\agent3\_work\8\s\MainApp\app.json]
2021-10-26T14:17:47.7029572Z *** Starting Batch compile of Apps:
2021-10-26T14:17:47.7073601Z   * C:\agent3\_work\8\s\MainApp
2021-10-26T14:17:47.7089307Z *** Start Compiling: [C:\agent3\_work\8\s\MainApp]
2021-10-26T14:17:47.7749046Z *** Get App Information
2021-10-26T14:17:47.7792896Z *** Loading Json Object: [C:\agent3\_work\8\s\MainApp\app.json]
2021-10-26T14:17:47.7819463Z   * Id         : 947d308a-ff7d-4beb-9b04-3f1788b12d9d
2021-10-26T14:17:47.7829623Z   * Publisher  : prisma informatik GmbH
2021-10-26T14:17:47.7841244Z   * Name       : Module
2021-10-26T14:17:47.7851327Z   * Description: Module
2021-10-26T14:17:47.8020477Z *** Setting Managed App Version [C:\agent3\_work\8\s\MainApp\app.json] =>  2.0.9247.0
2021-10-26T14:17:47.8155360Z *** VSCode Settings: [C:\agent3\_work\8\s\MainApp\.vscode\settings.json]
2021-10-26T14:17:47.8173604Z *** VSCode-Settings json found.
2021-10-26T14:17:47.8190166Z *** Loading Json Object: [C:\agent3\_work\8\s\MainApp\.vscode\settings.json]
2021-10-26T14:17:47.8287337Z *** Using Ruleset: [C:\agent3\_work\8\s\MainApp\.vscode\ruleset.json]
2021-10-26T14:17:47.8368601Z ##[command]"Get-BCArtifactUrl" 
2021-10-26T14:17:47.8369221Z Name                           Value                                                                                   
2021-10-26T14:17:47.8369844Z ----                           -----                                                                                   
2021-10-26T14:17:47.8370418Z select                         Latest                                                                                  
2021-10-26T14:17:47.8371020Z type                           Sandbox                                                                                 
2021-10-26T14:17:47.8371926Z country                        de                                                                                      
2021-10-26T14:17:47.8372246Z 
2021-10-26T14:17:47.8372751Z 
2021-10-26T14:17:47.8373662Z 
2021-10-26T14:17:53.6115992Z *** Platform: c:\bcartifacts.cache\sandbox\19.0.29894.31651\platform
2021-10-26T14:17:53.6137189Z *** Localisation: c:\bcartifacts.cache\sandbox\19.0.29894.31651\de
2021-10-26T14:17:53.6421353Z *** VSIX Path: C:\bcartifacts.cache\sandbox\19.0.29894.31651\platform\ModernDev\program files\Microsoft Dynamics NAV\190\AL Development Environment\ALLanguage.vsix
2021-10-26T14:17:53.8225784Z ##[error]Windows PowerShell wird im NonInteractive-Modus ausgeführt. Lese- und Eingabeaufforderungsfunktionen sind nicht verfügbar.
2021-10-26T14:17:53.8607931Z ##[section]Finishing: ALOpsAppCompiler

Expected behavior Sometimes our pipelines are running and sometimes we receive this error. Please fix this or help with the error message.

Screenshots

Additional context

pri-kise commented 2 years ago

I only see this error for BC 19 right now. Maybe this could help to find the problem.

waldo1001 commented 2 years ago

Could it be that you are using multiple agents on the same server? Because that could be conflicting when both are doing the same on the same place .. causing an interaction, which PS doesn't allow (needs interaction).

pri-kise commented 2 years ago

Yes this might cause the issue. Is there some flag that we can set to deal with this probelm? Or maybe could you copy the alc.exe to the agent workspace folder that multiple agents do not conflict with each other?

waldo1001 commented 2 years ago

I wouldn't want to do that, because we also use this to speed up builds (caching)

And .. it's a Microsoft recommendation to NOT put multiple agents to one machine: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops&tabs=browser#install

So in all honesty, we might mitigate this issue, only to expect the next one at some point in time...

pri-kise commented 2 years ago

@waldo1001 I understand your point. We have multiple agents on one system to speed up, too. Since the downloading of different images is often the part that takes the most time.

waldo1001 commented 2 years ago

I understand. Multiple agents is important. Can't you split them in VMs or something?

We are also looking into setting this up for the community, so that other people can use our build agents ... I think that can simplify things as well .. .

dsaveyn commented 2 years ago

I've got the exact same problem with a single agent

image

image

It seems the cause of this issue might be something different after all.

waldo1001 commented 2 years ago

I see "DSA-LAPTOP" - I hope this is not a Windows11 or 10?

dsaveyn commented 2 years ago

I see "DSA-LAPTOP" - I hope this is not a Windows11 or 10?

It is, since we are awaiting our final server. Is this not supported? (I have used a self-hosted agent on Windows 10 in the past). I might be missing something?

waldo1001 commented 2 years ago

No, Windows 10 comes with a whole lot of challenges. As such, a build server does run on it, but we're doing a lot in PowerShell and Docker (especially Docker) that simply isn't supportable on a non-server-system.

I have a blogpost here that kind of gives you the best way to install a build server: https://www.waldo.be/2020/07/13/installing-a-devops-agent-with-docker-with-the-most-chance-of-success/

dsaveyn commented 2 years ago

No, Windows 10 comes with a whole lot of challenges. As such, a build server does run on it, but we're doing a lot in PowerShell and Docker (especially Docker) that simply isn't supportable on a non-server-system.

I have a blogpost here that kind of gives you the best way to install a build server: https://www.waldo.be/2020/07/13/installing-a-devops-agent-with-docker-with-the-most-chance-of-success/

Ok thank you for the information. I agree this is quite uncommon. We'll wait for our final server to arrive so we can set up ALOps

waldo1001 commented 2 years ago

I'll close this issue for now, since there are alternative solutions in place. Please, if you have this issue on a windows server AND with a single build server on it, you can open a new issue, with full log and yml details.