KRE Error: Activation failed. Please make sure you are using a valid license

Hello, I am attempting to execute an existing test suite on a build server using Katalon Runtime Engine v7.2.1 (previously it was running on v5.10.1 of Katalon.)

When running the suite using the Runtime Engine locally, it succeeds, but when running it on the build server, it fails during license activation despite the fact that I am providing a valid API key in both instances.

Katalon workspace folder is set to default location: D:\TFSAgent\_work\_temp\session-dfe7ccef
Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
INFO: Katalon Version: 7.2.1
INFO: Command-line arguments: -projectPath=./MyProject.prj -testSuitePath=MyTestSuite -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789
INFO: User working dir: D:\TFSAgent_work\29\s
INFO: Error log: D:/TFSAgent/_work/_temp/session-dfe7ccef/.metadata/.log
INFO: Katalon TestOps server URL: https://analytics.katalon.com
INFO: Katalon Store server URL: https://store.katalon.com
INFO: User home: C:\Users\syncuser
INFO: Java vendor: Oracle Corporation
INFO: Java version: 1.8.0_181
INFO: Local OS: Windows Server 2012 R2 64bit
INFO: CPU load: 0%
INFO: Total memory: 16381 MB
INFO: Free memory: 10695 MB
INFO: Machine ID: a0061c3fd32a9305c85edfad7b24a59f
Activating…
Start activating offline…
Search for valid offline licenses in folder: C:\Users\syncuser.katalon\license
The number of valid offline licenses: 0
Offline activation failed.
Start activating online…
Online activation for console mode failed.
All launchers terminated
Activation failed. Please make sure you are using a valid license.
Process completed with exit code 3 and had 3 error(s) written to the error stream.

My organization has two Node-locked KRE licenses still available, so that shouldn’t be the issue. The API key being used is the same when I run it locally and on the server.

I initially thought that the build server might be unable to communicate with Katalon, but I tested it, and the build server is able to send HTTP traffic to both store.katalon.com and analytics.katalon.com successfully, so connectivity should not be an issue.

The error message gives no indication of what is wrong. “Please make sure you are using a valid license” is confusing because as far as I can tell from the CLI documentation, there is no way to specify a license, only an API key.

How can I troubleshoot this issue further? This is currently preventing my organization from adopting Katalon v7.x.

Thanks for your time,

  • Shawn

My guess is that KRE does not validate the same way as KSE.

Did you try the -email switch? No idea if it will help, just wondering.

Hello, Russ - thanks for the quick response!
I was actually using the Katalon Runtime Engine both locally and on the build server. I don’t have a Katalon Studio Enterprise license, only node-locked Runtime Engine licenses, so I can only use the KRE to run my tests from the CLI.
As for the -email flag - I just tried it with the email I use for Katalon TestOps, and it seemed to have no effect. The error message remained the same.

Ah, sorry, I missed that. In which case, activation for KRE is very different.

Oh well. I just wondered. Your bug made me read the whole damn docs page :confused:

I think I’ll move this to Bug Reports because something is definitely not right here.

Shout out @ThanhTo @devalex88 @duyluong

Hi @smorrison

What type of environment is your build server (Docker, Azure DevOps, a VM with fixed/dynamic hardware specification, etc ?).

If the license activation succeeds in your local machine, then it suggests you are using a node-locked Runtime Engine. If the build server is something that requires a DevOps Runtime Engine, then it would explain the error message.

It is a long-lived VM hosted in Azure which is running a TFS Build agent.

For reference, in case it is useful, here is the output from running Katalon via the Katalon Runtime Engine locally via Powershell, when it succeeds, using the same API key:

PS C:\Program Files\Katalon\Katalon_Studio_Engine_Windows_64-7.2.1> ./katalonc -projectPath=“C:\MyPath\MyProject.prj” -testSuitePath=“MyTestSuite” -executionProfile=“dev” -browserType=“Chrome” -retry=0 -retryFailedTestCases=true -apiKey=******
Katalon workspace folder is set to default location: C:\Users\SMORRI~1\AppData\Local\Temp\session-7a5ebe44
Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified

INFO: Katalon Version: 7.2.1
INFO: Command-line arguments: -projectPath=./MyProject.prj -testSuitePath=MyTestSuite -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=******
INFO: User working dir: C:\Program Files\Katalon\Katalon_Studio_Engine_Windows_64-7.2.1
INFO: Error log: C:/Users/smorrison/AppData/Local/Temp/session-7a5ebe44/.metadata/.log
INFO: Katalon TestOps server URL: https://analytics.katalon.com
INFO: Katalon Store server URL: https://store.katalon.com
INFO: User home: C:\Users\smorrison
INFO: Java vendor: Oracle Corporation
INFO: Java version: 1.8.0_181
INFO: Local OS: Windows 10 64bit
INFO: CPU load: 25%
INFO: Total memory: 32659 MB
INFO: Free memory: 16832 MB
INFO: Machine ID: 82fae271ae3c14d0003e42a6f4114b71

Activating…
Start activating offline…
Search for valid offline licenses in folder: C:\Users\smorrison.katalon\license
The number of valid offline licenses: 0
Offline activation failed.
Start activating online…
Delete folder: bin
Delete folder: Libs
Cleaning up workspace
Opening project file: C:\MyPath\MyProject.prj
/C%%MyPath\MyProject.prj/Keywords/com/myorg/katalon/core/DataKeywords.groovy: 10 Groovy:unable to resolve class internal.GlobalVariable
Generating global variables…
Parsing custom keywords…
Project ‘MyProject’ opened
Start reloading plugins…
Katalon version: 7.2.1
Plugin info URL: https://store.katalon.com/api/products/ks?appVersion=7.2.1&appType=ENGINE&licenseType=ENTERPRISE
Start check license task
chromedriver is located at default location: C:\Program Files\Katalon\Katalon_Studio_Engine_Windows_64-7.2.1\configuration\resources\drivers\chromedriver_win32\chromedriver.exe. In case your browser is updated to a newer version, please use this command to update chromdriver: --config -webui.autoUpdateDrivers=true


MyTestSuite - Chrome - 20200128_112453…
…0/4(0%)

[ Lots of test output ]

Execution completed. Exit code: 0.
Start clean up session
End check license task
End clean up session
Start release license task
License released
End release license task
All launchers terminated

1 Like

Another data point - I installed v7.1.0 of the Katalon Runtime Engine and tried running the same tests with it and got the same result. So this issue doesn’t seem to be new to v7.2.1 of the KRE.

I’m running out of ideas at this point, so if anyone at Katalon has other suggestions for troubleshooting, let me know.

I will let the team be aware of this issue. I’ll get back to you with more questions when I have them.

1 Like

So I figured out the issue. It was a mistake on my part compounded by really misleading output from Katalon.

The clue that pointed me in the right direction was this line in the failed Katalon output:

INFO: Command-line arguments: -projectPath=./MyProject.prj -testSuitePath=MyTestSuite -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789

While in the successful version, it looked like this:

INFO: Command-line arguments: -projectPath=./MyProject.prj -testSuitePath=MyTestSuite -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=******

Note that the API key is obfuscated by Katalon in the successful version but not the failing version - that means it didn’t correctly identify that argument as an API key in the case where it failed.

On the build server, the command is run from the temporary directory where the git repo is cloned to during the build process. As a result, the path to our Katalon installation contains spaces due to it being in the Program Files directory.

Therefore the Powershell command I was using to invoke it was:

$katalonPath = ‘C:\Program Files\Katalon\Katalon_Studio_Engine_Windows_64-7.2.1\katalonc’
$katalonArguments = ‘-projectPath="./MyProject.prj" testSuitePath=“MyTestSuite” -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789’
& $katalonPath $katalonArguments

The ampersand is the Powershell call operator, which invokes the following string as a command and tolerates paths with spaces.

However the arguments were being stored in one big string in Powershell, and seem to have been getting parsed accordingly into the argument vector.

So from Katalon’s perspective, there was only a single command line argument and it was: ‘-projectPath="./MyProject.prj" testSuitePath=“MyTestSuite” -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789’

However Katalon seems to just ignore the fact that it was only passed a single very long argument and carries on with attempting license activation anyways, and even emitted the string of arguments I passed in as its “Command-line arguments.”

When running locally, I was executing Katalon from the directory where the KRE is installed, and thus wrote the command in a more traditional Powershell format:

./katalonc -projectPath=“C:/MyPath/MyProject.prj” testSuitePath=“MyTestSuite” -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789

In this case, all of the arguments were interpreted correctly and it succeeded.

So the fix on the build server was simply to change the script to be as follows:

$katalonPath = ‘C:\Program Files\Katalon\Katalon_Studio_Engine_Windows_64-7.2.1\katalonc’
& $katalonPath -projectPath="./MyProject.prj" testSuitePath=“MyTestSuite” -executionProfile=dev -browserType=Chrome -retry=0 -retryFailedTestCases=true -apiKey=abc12345-abc1-abc1-abc1-abc123456789

After doing this, Katalon was able to activate the license correctly.

So rather than failing on valid input, Katalon appears to be ignoring garbage input without giving feedback that the user has failed to provide an -apiKey argument (or any meaningful argument at all, for that matter.)

Sorry for the confusion, but I’d like to request a feature enhancement for much better feedback when Katalon is passed bogus CLI arguments, and probably also a warning during license activation when no apiKey argument is provided. That would have helped me get to the bottom of this much more quickly.

3 Likes

Awesome piece of detective work, Shawn. Thanks for posting the solution.

1 Like

Thank you @smorrison

I was about to suggest checking for invisible invalid characters. I will definitely escalate this to the team. Glad that you got it working.

1 Like

Hello everyone,

You’re recommended to read this announcement regarding the consolidation of both Katalon Runtime Engine DevOps and Floating licenses into one licensing offering, Floating .

Jass