HodorNV / ALOps

ALOps
59 stars 24 forks source link

ALOps App License Check throws error: "License File is corrupt. Error code: Unknown Error." #567

Closed innonav-dev closed 1 year ago

innonav-dev commented 2 years ago

Describe the bug When we try to use the newly added License Check task to check our built apps against our license, the task always runs into an error claiming the license file is corrupt. We tried with locally stored and online hosted license files, but that didn't change the result. We are trying to get it running without a docker container, because we also run the batch compile task without a container before trying to check the compile output against the license.

We approached you guys last week at the BC Tech Days explaining the problem, and you guys recommended us to install the Visual C++ Redistributable on our agent machine, but that also didn't fix the problem.

Do you have any other idea how to fix the error? Do we have to install a specific VC++ version, or any other dependency to get it running on our machine?

the used yaml

- task: ALOpsAppLicenseCheck@1
    displayName: 'ALOps App License Check'
    inputs:
        licensefile: "$(Build.SourcesDirectory)/Licenses/LicenseFile.flf"
        artifact_path: $(Build.ArtifactStagingDirectory)
        artifact_exclude: "*-TEST*"

the output

...
"Get-BCArtifactUrl" 
Name                           Value                                                                                   
----                           -----                                                                                   
select                         Latest                                                                                  
type                           OnPrem                                                                                  
country                        W1                                                                                      

 -select: Latest -type: OnPrem -country: W1
*** Platform: C:\bcartifacts.cache\onprem\20.5.45456.45889\platform
*** Localisation: C:\bcartifacts.cache\onprem\20.5.45456.45889\w1
*** BC Management DLL: C:\bcartifacts.cache\onprem\20.5.45456.45889\platform\ServiceTier\program files\Microsoft Dynamics NAV\200\Service\Microsoft.Dynamics.Nav.Management.dll
*** BC App Management DLL: C:\bcartifacts.cache\onprem\20.5.45456.45889\platform\ServiceTier\program files\Microsoft Dynamics NAV\200\Service\Microsoft.Dynamics.Nav.Apps.Management.dll
*** BC NCL Management DLL: C:\bcartifacts.cache\onprem\20.5.45456.45889\platform\ServiceTier\program files\Microsoft Dynamics NAV\200\Service\Microsoft.Dynamics.Nav.Ncl.dll
*** BC Types DLL: C:\bcartifacts.cache\onprem\20.5.45456.45889\platform\ServiceTier\program files\Microsoft Dynamics NAV\200\Service\Microsoft.Dynamics.Nav.Types.dll
*** Load CodeAnalysis from [C:\bcartifacts.cache\onprem\20.5.45456.45889\platform\ServiceTier\program files\Microsoft Dynamics NAV\200\Service]
*** Get License: [C:\DevOps_Agent_01\_work\124\s/Licenses/LicenseFile.flf]
*** App License Check: [C:\DevOps_Agent_01\_work\124\a]
*** Resolved Path  : C:\DevOps_Agent_01\_work\124\a
*** Apps to process:

Name                                                         
----                                                         
onprem_19.2_ch_App.app

*** Setup NAV-License Delegate
*** Using 'Microsoft.Dynamics.Nav.Types.ObjectType' signature
*** Load License
##[error]Ausnahme beim Aufrufen von "Invoke" mit 2 Argument(en):  "Die Lizenzdatei ist beschädigt. Fehlercode: Unknown error."
Finishing: ALOps App License Check
waldo1001 commented 2 years ago

May be one other thing to try: can you download a new version of the license-file and try with that one? Also: what version of BC are we talking about?

innonav-dev commented 2 years ago

The Apps are built on version 19.2 and the license used is a BC 20 license downloaded less than a month ago. Will try to download a new license file tomorrow and see if that changes anything.

waldo1001 commented 2 years ago

Would it be possible to run this step in a docker container?

Meantime, we'll see what other requirements are necessary (we were able to simulate it, so we should be able to work towards a solution..).

innonav-dev commented 2 years ago

Tried it with a newly downloaded BC20 Partner License but still get the same error message.

waldo1001 commented 2 years ago

Well - as I said - not much we can do about BC licensing 🤷‍♂️

metda11 commented 2 years ago

Is there any news about this problem? We have the same issue with all our customer licenses. Does the license have to be hosted in an Azure store or is it also possible within a pipeline? Neither of these work for me. What type of function are you calling to determine that the file is corrupted? Thank you for your feedback

waldo1001 commented 2 years ago

We're working on supporting the .bclicense for the licensecheck .. hopefully news soon.

AdminHodor commented 2 years ago

Dear @InnoNavSupport ,

Could you please try our latest release v1.454.3354 ? You can now feed a .bclicense file in the "licensefile" parameter. The BCLicense work in an entirely other way and doesn't involve tricky DLLs to work with.

Kind regards,

innonav-dev commented 1 year ago

Dear @AdminHodor , We just tested the function with the bclicense File. Seems to work better. One of the MS Apps is throwing an error. image I was only able to use the LicenseFile with a URL and not with a Path. Does the license file need to be uploaded manually to the docker?

waldo1001 commented 1 year ago

Duplicate: #612