microsoft / AL-Go

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

Error: IncrementVersionNumber action failed. Error: Settings file .\.AL-Go\settings.json is malformed. Cannot bind argument to parameter 'object' because it is null.. Stacktrace: at <ScriptBlock> #477

Closed DanielMagMat closed 1 year ago

DanielMagMat commented 1 year ago

I am stucked at creating a release. I have followed workshop, videos and resolution of similar issues #352 . But I do not seem to find the answer to my issue. Maybe a bug, Am I missing something?

Help appreciated.

Getting this error:

Error: IncrementVersionNumber action failed. Error: Settings file ..AL-Go\settings.json is malformed. Cannot bind argument to parameter 'object' because it is null.. Stacktrace: at , D:\a_actions\microsoft\AL-Go-Actions\preview\IncrementVersionNumber\IncrementVersionNumber.ps1: line 89 at , D:\a_actions\microsoft\AL-Go-Actions\preview\IncrementVersionNumber\IncrementVersionNumber.ps1: line 61 at , D:\a_temp\0d13274b-fec2-469c-9d68-815f7ea71e88.ps1: line 2 at , : line 1

jonaswre commented 1 year ago

Hi, it seems like your settings.json isn't correctly formated.

From experience it's most often a , in the last property. If you can't find the issue. It would be helpful to see the settings.json.

DanielMagMat commented 1 year ago

It is a one app project. I leave you the code in the settings.json file:

{ "country": "mx", "appFolders": [], "testFolders": [], "bcptTestFolders": [], "insiderSasTokenSecretName": "InsiderSasToken", "licenseFileUrlSecretName": "LicenseFileUrl", "configPackages": ["STANDARD"], "doNotRunBcptTests": true }

freddydk commented 1 year ago

What are you entering as new version number?

jonaswre commented 1 year ago

Okay, your json is valid. I've found an oddity.

https://github.com/microsoft/AL-Go/blob/b90607c6ca55e8d764a1723ca93774858197da7c/Actions/IncrementVersionNumber/IncrementVersionNumber.ps1#L89

Error Message Template: Settings file $project\$ALGoSettingsFile is malformed

Your Error Message: Settings file ..AL-Go\settings.json is malformed

This lets me to the conclusion you have specified the wrong project. The error message should be Settings file .\.AL-Go\settings.json is malformed

DanielMagMat commented 1 year ago

@freddydk I have tried with +0.1, 1.1, +0.2, 1.2

I have used Preview Al Go and Current. I have tried only using IncrementVersionNumber Workflow with same results.

DanielMagMat commented 1 year ago

Last run did indeed prompted

IncrementVersionNumber action failed. Error: Settings file .\.AL-Go\settings.json is malformed. Cannot bind argument to parameter 'object' because it is null.. Stacktrace: at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\preview\IncrementVersionNumber\IncrementVersionNumber.ps1: line 89 at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\preview\IncrementVersionNumber\IncrementVersionNumber.ps1: line 61 at <ScriptBlock>, D:\a\_temp\27af9152-6953-4ed4-8234-e21e780b42a5.ps1: line 2 at <ScriptBlock>, <No file>: line 1

freddydk commented 1 year ago

Any chance you could add me to the repo, so that I can have a look? My GitHub username is freddydk.

Thanks

DanielMagMat commented 1 year ago

Any chance you could add me to the repo, so that I can have a look? My GitHub username is freddydk.

Thanks

I have sent you the invite. Thank you very much.

freddydk commented 1 year ago

The repo you invited me to is empty???

DanielMagMat commented 1 year ago

I am sorry I invited you to wrong repo. I have now corrected that and send you right invite.

freddydk commented 1 year ago

You have an empty line in the beginning of the settings file - try to remove that. image

The InitializeWorkflow actually should check all settings files for validity and report whether or not they are valid, but apparently there is a bug in that, which causes it to skip the test - will fix that.

DanielMagMat commented 1 year ago

This indeed resolved the issue. Thanks very much @freddydk !