RASA JAVA JDK action server issue

Hi Folks,

I want to develop custom action to query back end data in JAVAbase so I downloaded the code from GitHub - rbajek/rasa-java-sdk: Java SDK for the development of custom actions for Rasa and developed a simple hello world action.

Started RASA core in local on port 5005 and the action server on port 5055 in local. Updated endpoints.yml file as below.

# This file contains the different endpoints your bot can use.

# Server where the models are pulled from.
# https://rasa.com/docs/rasa/user-guide/configuring-http-api/#fetching-models-from-a-server/

#models:
#  url: http://my-server.com/models/default_core@latest
#  wait_time_between_pulls:  10   # [optional](default: 100)

# Server which runs your custom actions.
# https://rasa.com/docs/rasa/core/actions/#custom-actions/

action_endpoint:
  url: "http://localhost:5055/webhook"

# Tracker store which is used to store the conversations.
# By default the conversations are stored in memory.
# https://rasa.com/docs/rasa/api/tracker-stores/

#tracker_store:
#    type: redis
#    url: <host of the redis instance, e.g. localhost>
#    port: <port of your redis instance, usually 6379>
#    db: <number of your database within redis, e.g. 0>
#    password: <password used for authentication>
#    use_ssl: <whether or not the communication is encrypted, default false>

#tracker_store:
#    type: mongod
#    url: <url to your mongo instance, e.g. mongodb://localhost:27017>
#    db: <name of the db within your mongo instance, e.g. rasa>
#    username: <username used for authentication>
#    password: <password used for authentication>

# Event broker which all conversation events should be streamed to.
# https://rasa.com/docs/rasa/api/event-brokers/

#event_broker:
#  url: localhost
#  username: username
#  password: password
#  queue: queue

When I am trying to http://localhost:5005/webhooks/rest/webhook,getting below error in logs. Seems RASA core is not able to communicate with action server.

Failed to run custom action 'custom_reason'. Couldn't connect to the server at 'http://localhost:5055/webhook'. Is the server running? Error: Cannot connect to host localhost:5055 ssl:default [Cannot assign requested address]
2020-11-03 00:09:19 ERROR    rasa.core.processor  - Encountered an exception while running action 'custom_reason'. Bot will continue, but the actions events are lost. Please check the logs of your action server for more information.
2020-11-03 00:09:19 DEBUG    rasa.core.processor  - Failed to execute custom action.
Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 936, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "uvloop/loop.pyx", line 1974, in create_connection
  File "uvloop/loop.pyx", line 1950, in uvloop.loop.Loop.create_connection
  File "uvloop/handles/tcp.pyx", line 180, in uvloop.loop.TCPTransport.connect
  File "uvloop/handles/tcp.pyx", line 202, in uvloop.loop._TCPConnectRequest.connect
OSError: [Errno 99] Cannot assign requested address

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 551, in run
    json=json_body, method="post", timeout=DEFAULT_REQUEST_TIMEOUT
  File "/opt/venv/lib/python3.7/site-packages/rasa/utils/endpoints.py", line 150, in request
    **kwargs,
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/client.py", line 483, in _request
    timeout=real_timeout
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 859, in _create_connection
    req, traces, timeout)
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 1004, in _create_direct_connection
    raise last_exc
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 986, in _create_direct_connection
    req=req, client_error=client_error)
  File "/opt/venv/lib/python3.7/site-packages/aiohttp/connector.py", line 943, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:5055 ssl:default [Cannot assign requested address]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/processor.py", line 650, in _run_action
    events = await action.run(output_channel, nlg, tracker, self.domain)
  File "/opt/venv/lib/python3.7/site-packages/rasa/core/actions/action.py", line 582, in run
    raise Exception("Failed to execute custom action.")
Exception: Failed to execute custom action.

http://localhost:5055/health and http://localhost:5055/ end points of action server are perfectly working fine.

Is there any configuration missing here ??

Hey @penusila611621

Looks like that’s a custom java-sdk, we don’t support it ourselves :frowning_face: Have you tried contacting the author? Also, looks like the last update was done 12 months ago, and there were some changes to the sdk recently due to the 2.0 release.

Thanks @degiz for your response. Is there any user guide from RASA to develop action server using RASA provide JAVA SDK.

Hey @penusila611621

At the moment Rasa Open Source has only python action server SDK.

Thanks @degiz, any roadmap to develop JAVA action server APIS.

Hey @penusila611621

Not at the moment.

Hey @penusila611621 Perhaps this one can help: https://github.com/ArturKorb/rasa-java-action-service. Look also here: https://github.com/ArturKorb/rasa-java-client-library

@degiz Hi I recently started with Rasa and wanted to have a Java action server. Is there any update for java SDK ?