microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
293 stars 124 forks source link

LocalDevEnv - Error: Cannot bind argument to parameter 'InputObject' because it is null. #717

Closed pieter-kok closed 1 year ago

pieter-kok commented 1 year ago

I'm having a repository (AL:Go for GitHub v3.2) with a dependency in another repository (a repo of our own) and creating the local dev environment is raising the following error during creating a LocalDevEnv. BcContainerHelper is version 5.0.5, as mentioned in the script output.

Error: Cannot bind argument to parameter 'InputObject' because it is null.
Stacktrace: at <ScriptBlock>, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 1003
at AnalyzeRepo, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 974
at CreateDevEnv, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 1549
at <ScriptBlock>, C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\localDevEnv.ps1: line 125
at <ScriptBlock>, C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\Bluace-DevEnv.ps1: line 9

This looks like issue https://github.com/microsoft/AL-Go/issues/434, however the version of AL:Go for GitHub is higher than v3.1, the version that solved that issue. When using gh auth token in GitHub CLI, the exact same token is returned. I'm also able to list the releases of the dependent repo through GitHub CLI.

This is the complete output of LocalDevEnv.ps1. I replaced the actual token in the output with a dummy value for the sake of this issue.

  _                     _   _____             ______            
 | |                   | | |  __ \           |  ____|           
 | |     ___   ___ __ _| | | |  | | _____   __ |__   _ ____   __
 | |    / _ \ / __/ _` | | | |  | |/ _ \ \ / /  __| | '_ \ \ / /
 | |____ (_) | (__ (_| | | | |__| |  __/\ V /| |____| | | \ V / 
 |______\___/ \___\__,_|_| |_____/ \___| \_/ |______|_| |_|\_/  

This script will create a docker based local development environment for your project.

NOTE: You need to have Docker installed, configured and be able to create Business Central containers for this to work.
If this fails, you can setup a cloud based development environment by running cloudDevEnv.ps1

All apps and test apps will be compiled and published to the environment in the development scope.
The script will also modify launch.json to have a Local Sandbox configuration point to your environment.

Applying settings from C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.github\AL-Go-Settings.json
Applying settings from C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\settings.json
Checking System Requirements

Downloading BcContainerHelper latest version from CDN
Using 7zip
BcContainerHelper version 5.0.5
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Applying settings from C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.github\AL-Go-Settings.json
Applying settings from C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\settings.json
Not using Azure KeyVault, attempting to retrieve an auth token using gh auth token
Checking type
Checking appFolders, testFolders and bcptTestFolders
Application Dependency 22.0.0.0
Checking artifact setting for project
Checking Country and additionalCountries
https://bcartifacts.azureedge.net/Sandbox/22.5.59966.60658/nl
Latest AT artifacts https://bcartifacts.azureedge.net/sandbox/22.5.59966.60658/at
Countries with artifacts at,base,be,bg,br,ca,ch,co,core,cz,vn,de,ee,es,fi,fr,gb,gr,hk,hr,hu,ie,au,in,is,it,kr,lt,lv,mx,nl,no,nz,pe,ph,pl,dk,pt,rs,se,si,sk,th,tr,tw,ua,us,jp,ro,w1
Allowed Country codes ae,ar,bd,dz,cl,pr,eg,fo,gl,id,ke,lb,lk,lu,ma,mm,mt,my,ng,qa,sa,sg,tn,ua,za,ao,bh,ba,bw,cr,cy,do,ec,sv,gt,hn,jm,mv,mu,ni,pa,py,tt,uy,zw,at,base,be,bg,br,ca,ch,co,core,cz,vn,de,ee,es,fi,fr,gb
,gr,hk,hr,hu,ie,au,in,is,it,kr,lt,lv,mx,nl,no,nz,pe,ph,pl,dk,pt,rs,se,si,sk,th,tr,tw,us,jp,ro,w1
Downloading artifacts from https://bcartifacts.azureedge.net/sandbox/22.5.59966.60658/nl
Updating app- and test Dependencies
Analyzing Test App Dependencies
Checking project dependencies
Checking appDependencyProbingPaths
Dependency to projects '*' in https://github.com/BluaceBV/appsourcecommon@main, version latest, release status release
Using secret gho_[REMOVED FOR THE ISSUE TEXT] for access to repository
Removing BcContainerHelper
Error: Cannot bind argument to parameter 'InputObject' because it is null.
Stacktrace: at <ScriptBlock>, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 1003
at AnalyzeRepo, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 974
at CreateDevEnv, C:\Users\PieterKok\AppData\Local\Temp\tmpAF57.tmp.ps1: line 1549
at <ScriptBlock>, C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\localDevEnv.ps1: line 125
at <ScriptBlock>, C:\Users\PieterKok\Documents\AL\appsourcebasefunctionality\.AL-Go\Bluace-DevEnv.ps1: line 9
freddydk commented 1 year ago

I think this is a duplicate of #708, which is fixed in preview. Will check when we will roll out a new prod version