API test against web service running in AKS fails with 'Connection refused' and lots of 'Could not resolve module' errors in the Katalon log when executed from Github Actions workflow

I am trying to run a Katalon API test suite (with 1 API test) from a Github Actions workflow against a web service running in AKS. I am running into the following issue:

The run is consistently failing with errors shown below:
[2022-03-23T13:27:56.311] [INFO] katalon - GET https://raw.githubusercontent.com/katalon-studio/katalon-studio/master/releases.json 200.
[2022-03-23T13:27:56.317] [INFO] katalon - Download Katalon Studio 8.2.5 to /home/runner/.katalon/8.2.5.
[2022-03-23T13:27:56.318] [INFO] katalon - Downloading from https://download.katalon.com/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5.tar.gz. It may take a few minutes.
[2022-03-23T13:27:56.319] [INFO] katalon - Downloading from https://download.katalon.com/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5.tar.gz to /tmp/tmp-1603-z8A1Q5XgMgql.

[2022-03-23T13:28:04.251] [INFO] katalon - Finished downloading.
[2022-03-23T13:28:04.255] [INFO] katalon - Decompressing the /tmp/tmp-1603-z8A1Q5XgMgql into /home/runner/.katalon/8.2.5.
Katalon Folder: /home/runner/.katalon/8.2.5
Katalon Executable File: /home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/katalonc
Execute Katalon Studio: /home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/katalonc -noSplash -runMode="console" -projectPath="/home/runner/work/test/test/src/KatalonFunctionalTests/NPG.Server.HSM.Service.KatalonFunctionalTests.prj" -retry=0 -testSuitePath="Test Suites/Functional Tests" -browserType="Web Service" -executionProfile="default" --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true
Execute "sh -c /home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/katalonc -noSplash -runMode="console" -projectPath="/home/runner/work/test/test/src/KatalonFunctionalTests/KatalonFunctionalTests.prj" -retry=0 -testSuitePath="Test Suites/Functional Tests" -browserType="Web Service" -executionProfile="default" --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true" in /tmp/tmp-1603-ayO0wcWEkuJd.
Unable to init server: Could not connect: Connection refused
Katalonc: Cannot open display: 

Katalonc:
An error has occurred. See the log file
/home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/configuration/1648042100271.log.

Exit code: 13.
Error: Exit code 13.

The Katalon log (in /home/runner) shows LOTS of ‘Could not resolve module’ errors for various Katalon modules. Here is the first of those instances (there are many more of those for different modules):

!SESSION 2022-03-23 13:28:20.132 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.14.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en
Framework arguments:  -runMode=console -projectPath=/home/runner/work/npg-server-hsm/npg-server-hsm/src/KatalonFunctionalTests/KatalonFunctionalTests.prj -retry=0 -testSuitePath=Test Suites/Functional Tests -browserType=Web Service -executionProfile=default --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data @noDefault -runMode=console -projectPath=/home/runner/work/KatalonFunctionalTests/KatalonFunctionalTests.prj -retry=0 -testSuitePath=Test Suites/Functional Tests -browserType=Web Service -executionProfile=default --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true

!ENTRY com.kms.katalon.activation 4 0 2022-03-23 13:28:21.840
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.kms.katalon.activation [24]
  Unresolved requirement: Require-Bundle: com.kms.katalon.custom
    -> Bundle-SymbolicName: com.kms.katalon.custom; bundle-version="1.0.0.202201190711"; singleton:="true"
       com.kms.katalon.custom [38]
         Unresolved requirement: Require-Bundle: com.kms.katalon.entity
           -> Bundle-SymbolicName: com.kms.katalon.entity; bundle-version="1.0.0.202201190711"
              com.kms.katalon.entity [42]
                Unresolved requirement: Require-Bundle: com.kms.katalon.core
                  -> Bundle-SymbolicName: com.kms.katalon.core; bundle-version="1.0.0.202201190711"; singleton:="true"
                     com.kms.katalon.core [30]
                       Unresolved requirement: Require-Bundle: com.microsoft.sqlserver.mssql-jdbc
                         -> Bundle-SymbolicName: com.microsoft.sqlserver.mssql-jdbc; bundle-version="6.2.2.jre8"
                            com.microsoft.sqlserver.mssql-jdbc [65]
                              Unresolved requirement: Import-Package: com.microsoft.aad.adal4j; resolution:="optional"
                              Unresolved requirement: Import-Package: com.microsoft.azure.keyvault; resolution:="optional"
                              Unresolved requirement: Import-Package: com.microsoft.azure.keyvault.authentication; resolution:="optional"
                              Unresolved requirement: Import-Package: com.microsoft.azure.keyvault.models; resolution:="optional"
                              Unresolved requirement: Import-Package: com.microsoft.azure.keyvault.webkey; resolution:="optional"
                              Unresolved requirement: Import-Package: com.microsoft.rest.credentials; resolution:="optional"
                              Unresolved requirement: Import-Package: javax.xml.bind
                       Unresolved requirement: Require-Bundle: org.glassfish.tyrus.client
                         -> Bundle-SymbolicName: org.glassfish.tyrus.client; bundle-version="1.13.1"
                            org.glassfish.tyrus.client [248]
                              Unresolved requirement: Import-Package: org.glassfish.tyrus.core; version="[1.13.0,2.0.0)"
                                -> Export-Package: org.glassfish.tyrus.core; bundle-symbolic-name="org.glassfish.tyrus.core"; bundle-version="1.13.1"; version="1.13.1"; uses:="javax.websocket,javax.websocket.server,org.glassfish.tyrus.core.cluster,org.glassfish.tyrus.core.extension,org.glassfish.tyrus.core.frame,org.glassfish.tyrus.core.monitoring,org.glassfish.tyrus.core.wsadl.model,org.glassfish.tyrus.spi,org.osgi.framework"
                                   org.glassfish.tyrus.core [250]
                                     Unresolved requirement: Import-Package: javax.xml.bind.annotation
                              Unresolved requirement: Import-Package: org.glassfish.tyrus.core.cluster; version="[1.13.0,2.0.0)"
                                -> Export-Package: org.glassfish.tyrus.core.cluster; bundle-symbolic-name="org.glassfish.tyrus.core"; bundle-version="1.13.1"; version="1.13.1"; uses:="javax.websocket,org.glassfish.tyrus.core"
                       Unresolved requirement: Require-Bundle: org.glassfish.tyrus.container-grizzly-client
                         -> Bundle-SymbolicName: org.glassfish.tyrus.container-grizzly-client; bundle-version="1.13.1"
                            org.glassfish.tyrus.container-grizzly-client [249]
                              Unresolved requirement: Import-Package: org.glassfish.tyrus.client; version="[1.13.0,2.0.0)"
                                -> Export-Package: org.glassfish.tyrus.client; bundle-symbolic-name="org.glassfish.tyrus.client"; bundle-version="1.13.1"; version="1.13.1"; uses:="javax.net.ssl,javax.websocket,org.glassfish.tyrus.core,org.glassfish.tyrus.spi"
                  -> Export-Package: org.glassfish.tyrus.core; bundle-symbolic-name="org.glassfish.tyrus.core"; bundle-version="1.13.1"; version="1.13.1"; uses:="javax.websocket,javax.websocket.server,org.glassfish.tyrus.core.cluster,org.glassfish.tyrus.core.extension,org.glassfish.tyrus.core.frame,org.glassfish.tyrus.core.monitoring,org.glassfish.tyrus.core.wsadl.model,org.glassfish.tyrus.spi,org.osgi.framework"

.
Note: The Katalon log file did not have any instances of the ‘Connection Refused’ error that I could find - so I am not sure if the above errors are related to the Connection Refused error.

Here is the workflow code:
name: RunTestAutomation_KatalonPOC

on: 
    workflow_dispatch:

jobs:
  run_automation:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Katalon Studio Github Action
      uses: katalon-studio/katalon-studio-github-action@v2.2
      with:
          version: '8.2.5'
          projectPath: '${{ github.workspace }}/src/KatalonFunctionalTests/KatalonFunctionalTests.prj'
          args: ' -retry=0 -testSuitePath="Test Suites/Functional Tests" -browserType="Web Service" -exeutionProfile="default" --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true'
    - name: If previous step fails, list and view contents of Katalon log files in runner directory after execution
      if: ${{ failure() }}
      run: |
        ls /home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/configuration/*.log
        cat /home/runner/.katalon/8.2.5/Katalon_Studio_Engine_Linux_64-8.2.5/configuration/*.log

Other information:

  1. Web service is running fine in AKS and I am able to access its API via Swagger in a browser.
  2. The API test connects to the service endpoint, calls the API and verifies the response received.
  3. All steps are implemented in the test object - test case merely calls Send Request and Verify on the test object.
  4. The API test runs fine when executed from KSE.
  5. The API test also runs successfully from the command line using the katalonc command.
  6. The Github Actions workflow is using the following Github Action to run the tests: https://docs.katalon.com/katalon-studio/docs/katalon-studio-github-action.html.

Does anyone have any ideas on what might be causing the Connection Refused error - or if there is anything I can do to troubleshoot this issue?

Also, does anyone have any ideas on what might be causing the errors in the Katalon log and if they are causing/related to the Connection refused failure?

!SESSION 2022-03-23 13:28:20.132 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.14.1
java.vendor=Eclipse Adoptium

You should use Java8 to run Katalon Runtime Engine.

Unable to init server: Could not connect: Connection refused
Katalonc: Cannot open display:

The error shows that the machine is missing Xvfb that requires to run KRE on Linux.
You can try with windows-latest machine. Please refer to this example:

@duyluong

Thanks for your response and information.

Regarding the Connection Refused issue …
Switching to windows-latest worked! (I had tried it before but it was causing the job to hang and I didnt figure out why - but it is working now).

However, while this solution works for the above workflow, it looks like it won’t work for another workflow I am working on - which pulls a Linux Docker image from a repo, launches a container based on that image and then runs Katalon tests against the container. The first step (docker pull command) fails with the error “image operating system “linux” cannot be used on this platform”.

I am still looking for a way to resolve the above issue. In case I am not able to find a solution and have to switch back to a Linux runner, is there a way (from the workflow) to configure Xvfb on the Github-hosted VM/container instantiated by Github Actions?

Regarding the Java version upgrade, it looks like that will need to be done in the code of the Github Action that I referenced in my original post - by whoever owns that repo and the code (which it looks like is Katalon). However, that repo’s master branch has not been updated since May 2020, there are several PRs awaiting approval and the last release (which is the one I am using) was in July 2020. So I am not sure if Katalon is still maintaining that repo. If not, please let me know if there is a more recent version (with the Java version upgraded) of the Action available elsewhere.