HodorNV / ALOps

ALOps
55 stars 24 forks source link

Error Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available. when using ALOps App Compiler V2 on BC20 #774

Open MortenBLarsen opened 2 weeks ago

MortenBLarsen commented 2 weeks ago

Describe the bug A clear and concise description of what the bug is.

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

steps:
- task: Hodor.hodor-alops.alopsdeploytask.ALOpsAppCompiler@2
  displayName: 'ALOps App Compiler (App)'
  inputs:
    artifactversion: 20
    artifactcountry: w1
    alsourcepath: app/app.json
    appversiontemplate: '$(MOB_version.id).?.$(MOB_build.id)'
    appfilenametemplate: '%APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%.app'
    alcodeanalyzer: CodeCop

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

2024-07-03T07:42:51.1383402Z ##[section]Starting: ALOps App Compiler (App)
2024-07-03T07:42:51.1487179Z ==============================================================================
2024-07-03T07:42:51.1487288Z Task         : ALOps App Compiler
2024-07-03T07:42:51.1487349Z Description  : Compile AL Extension(s) for Business Central
2024-07-03T07:42:51.1487430Z Version      : 2.0.6167
2024-07-03T07:42:51.1487484Z Author       : Hodor
2024-07-03T07:42:51.1487538Z Help         : Compile Business Central extension(s) from AL code.
2024-07-03T07:42:51.1487620Z ==============================================================================
2024-07-03T07:42:51.6784433Z ******************************************************************************
2024-07-03T07:42:51.6790208Z *** ALOps v2 - Preview                                                     ***
2024-07-03T07:42:51.6794728Z ******************************************************************************
2024-07-03T07:42:51.6813483Z *** Importing required ALOps-Functions
2024-07-03T07:42:51.7473932Z *** Task Inputs:
2024-07-03T07:42:51.7498070Z 
2024-07-03T07:42:51.7557217Z name                                             value                                                                 
2024-07-03T07:42:51.7559193Z ----                                             -----                                                                 
2024-07-03T07:42:51.7560516Z artifactversion                                  20                                                                    
2024-07-03T07:42:51.7562046Z artifacttype                                     OnPrem                                                                
2024-07-03T07:42:51.7563666Z artifactcountry                                  w1                                                                    
2024-07-03T07:42:51.7565019Z versionselect                                    Latest                                                                
2024-07-03T07:42:51.7566357Z alternativeartifacturl                                                                                                 
2024-07-03T07:42:51.7566794Z alternativevsixurl                                                                                                     
2024-07-03T07:42:51.7567610Z alsourcepath                                     app/app.json                                                          
2024-07-03T07:42:51.7568461Z ruleset                                                                                                                
2024-07-03T07:42:51.7569134Z suppresswarnings                                 KEEP                                                                  
2024-07-03T07:42:51.7570581Z appversiontemplate                               5.49.?.242                                                            
2024-07-03T07:42:51.7571653Z updatebuildnumber                                True                                                                  
2024-07-03T07:42:51.7572493Z appfilenametemplate                              %APP_PUBLISHER%_%APP_NAME%_%APP_VERSION%.app                          
2024-07-03T07:42:51.7573287Z alcodeanalyzer                                   CodeCop                                                               
2024-07-03T07:42:51.7574101Z ignorepragmas                                                                                                          
2024-07-03T07:42:51.7574950Z enable_external_rulesets                         False                                                                 
2024-07-03T07:42:51.7575765Z showmycode                                       Keep                                                                  
2024-07-03T07:42:51.7576618Z resourceexposurepolicy_allowdebugging            Keep                                                                  
2024-07-03T07:42:51.7577451Z resourceexposurepolicy_allowdownloadingsource    Keep                                                                  
2024-07-03T07:42:51.7578935Z resourceexposurepolicy_includesourceinsymbolfile Keep                                                                  
2024-07-03T07:42:51.7579233Z internalsvisibleto                               Keep                                                                  
2024-07-03T07:42:51.7580219Z preprocessorsymbols                                                                                                    
2024-07-03T07:42:51.7593182Z alcachepath                                      C:\vsts-agent-win-x64-2.217.2\_work\42\s                              
2024-07-03T07:42:51.7594165Z publishartifact                                  True                                                                  
2024-07-03T07:42:51.7594416Z publishxlif                                      False                                                                 
2024-07-03T07:42:51.7595878Z failonwarnings                                   False                                                                 
2024-07-03T07:42:51.7596776Z failonany                                        False                                                                 
2024-07-03T07:42:51.7597727Z storageaccount                                                                                                         
2024-07-03T07:42:51.7597978Z sastoken                                                                                                               
2024-07-03T07:42:51.7599127Z printappmanifest                                 True                                                                  
2024-07-03T07:42:51.7600340Z outputalclogs                                    True                                                                  
2024-07-03T07:42:51.7600606Z additionalprobingpaths                                                                                                 
2024-07-03T07:42:51.7601444Z allowed_publisher_names                                                                                                
2024-07-03T07:42:51.7602331Z allowed_publisher_names_separator                ,                                                                     
2024-07-03T07:42:51.7603198Z accept_insider_eula                              False                                                                 
2024-07-03T07:42:51.7604133Z track_source_build_metadata                      True                                                                  
2024-07-03T07:42:51.7604366Z 
2024-07-03T07:42:51.7615447Z 
2024-07-03T07:42:51.7620956Z 
2024-07-03T07:42:51.7727771Z True
2024-07-03T07:42:51.7827113Z *** For documentation, please visit   : https://www.alops.be/documentation
2024-07-03T07:42:51.7829665Z 
2024-07-03T07:42:52.1020980Z 
2024-07-03T07:42:52.1146197Z *** Importing required Task-Functions
2024-07-03T07:42:52.1456346Z 
2024-07-03T07:42:52.1559697Z *** Artifact Type   : [OnPrem]
2024-07-03T07:42:52.1564889Z *** Artifact Version: [20]
2024-07-03T07:42:52.1570064Z *** Artifact Country: [w1]
2024-07-03T07:42:52.1573770Z *** AL Source Path  : [app/app.json]
2024-07-03T07:42:52.1578120Z *** AL Cache Path   : [C:\vsts-agent-win-x64-2.217.2\_work\42\s]
2024-07-03T07:42:52.1580467Z 
2024-07-03T07:42:52.1591469Z 
2024-07-03T07:42:52.1681818Z *** Default Working Folder: C:\vsts-agent-win-x64-2.217.2\_work\42\s
2024-07-03T07:42:52.1686618Z *** Artifact Folder       : C:\vsts-agent-win-x64-2.217.2\_work\42\a
2024-07-03T07:42:52.1691215Z *** Agent Tool Folder     : C:\vsts-agent-win-x64-2.217.2\_work\_tool
2024-07-03T07:42:52.1695682Z *** Agent Temp Folder     : C:\vsts-agent-win-x64-2.217.2\_work\_temp
2024-07-03T07:42:52.1698195Z 
2024-07-03T07:42:52.1719438Z *** Resolving Path: [app/app.json]
2024-07-03T07:42:52.1738768Z *** Resolved Path : [C:\vsts-agent-win-x64-2.217.2\_work\42\s\app\app.json]
2024-07-03T07:42:52.1743622Z *** AL Source Folder      : C:\vsts-agent-win-x64-2.217.2\_work\42\s\app\app.json
2024-07-03T07:42:52.1748854Z *** Resolving Path: [C:\vsts-agent-win-x64-2.217.2\_work\42\s]
2024-07-03T07:42:52.1762894Z *** AL Cache Folder       : C:\vsts-agent-win-x64-2.217.2\_work\42\s
2024-07-03T07:42:52.1765292Z 
2024-07-03T07:42:52.1775288Z *** Check BcContainerHelper
2024-07-03T07:42:52.2019868Z *** Load BcContainerHelper
2024-07-03T07:42:52.2526890Z BcContainerHelper version 6.0.19
2024-07-03T07:42:52.3826367Z BC.HelperFunctions emits usage statistics telemetry to Microsoft
2024-07-03T07:42:52.4441705Z Running on Windows, PowerShell 5.1.20348.2110
2024-07-03T07:42:53.6972368Z 
2024-07-03T07:42:53.6976432Z 
2024-07-03T07:42:53.7156011Z ##[command]"Get-BCArtifactUrl" 
2024-07-03T07:42:53.7156580Z Name                           Value                                                                                   
2024-07-03T07:42:53.7157575Z ----                           -----                                                                                   
2024-07-03T07:42:53.7157944Z select                         Latest                                                                                  
2024-07-03T07:42:53.7159128Z version                        20                                                                                      
2024-07-03T07:42:53.7159624Z type                           OnPrem                                                                                  
2024-07-03T07:42:53.7159904Z country                        w1                                                                                      
2024-07-03T07:42:53.7160007Z 
2024-07-03T07:42:53.7160110Z 
2024-07-03T07:42:53.7160507Z 
2024-07-03T07:42:55.5835689Z *** Platform: c:\bcartifacts.cache\onprem\20.18.60911.0\platform
2024-07-03T07:42:55.5860391Z *** Localisation: c:\bcartifacts.cache\onprem\20.18.60911.0\w1
2024-07-03T07:42:55.6304456Z *** VSIX Path: C:\bcartifacts.cache\onprem\20.18.60911.0\platform\ModernDev\program files\Microsoft Dynamics NAV\200\AL Development Environment\ALLanguage.vsix
2024-07-03T07:42:55.8026175Z ##[error]Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
2024-07-03T07:42:55.8327162Z ##[section]Finishing: ALOps App Compiler (App)

Expected behavior We should be able to compile app using v2 compiler also on BC20 platform

Additional context We do not have multiple agents running on the build server as mentioned on other similar bug issues filed earlier.

MortenBLarsen commented 2 weeks ago

I can further add to this issue, that the error happens only when compiling against OnPrem artifacts. Sandbox artifact type works as expected.

MortenBLarsen commented 2 weeks ago

After further investigation this seems to be caused by Build Agents running with different versions of powershell installed. PowerShell 5.1.17763.5328 works, PowerShell 5.1.20348.2110 does not.

Should we update to PowerShell 7?

waldo1001 commented 2 weeks ago

I have to ask - is it Windows 10? If so - we can't support that OS. Needs to be a server-OS. Did you install all Windows updates?

MortenBLarsen commented 2 weeks ago

The build agent that works is running on Windows Server 2019 with all windows updates installed. The build agent that doesn't work is running on Windows Server 2022 also with all windows updates installed. Funny thing is that BC20.17 works, but BC20.18 doesn't.

Don't spend to much time on investigating this. We will transition to PowerShell 7 and see if that fixes the issue. Until we have transitioned we will compile against BC20.17