Not able to connect wordpress website with rasa and okteto

104 Views Asked by At

I'm trying to connect my rasa bot to WordPress while deploying rasa to Okteto I keep getting some or the other error this is the error that I'm facing right now. When I check Chrome console it throws 404 sometimes 500 I really don't understand how to solve them.

From Okteto I'm getting this error

2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server2023-06-26 07:44:01 ERROR rasa_sdk.endpoint - Exception occurred during execution of request <Request: GET /socket.io/>
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverTraceback (most recent call last):
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic_routing/router.py", line 84, in resolve
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    extra,
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "", line 9, in find_route
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serversanic_routing.exceptions.NotFound: Not Found
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverDuring handling of the above exception, another exception occurred:
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverTraceback (most recent call last):
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic_routing/router.py", line 84, in resolve
2023-06-26 07:44:01.36 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    extra,
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "", line 9, in find_route
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serversanic_routing.exceptions.NotFound: Not Found
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverDuring handling of the above exception, another exception occurred:
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverTraceback (most recent call last):
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic/router.py", line 41, in _get
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    extra={"host": host} if host else None,
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic_routing/router.py", line 94, in resolve
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    extra=extra,
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic_routing/router.py", line 96, in resolve
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    raise self.exception(str(e), path=path)
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serversanic_routing.exceptions.NotFound: Not Found
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverDuring handling of the above exception, another exception occurred:
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serverTraceback (most recent call last):
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "handle_request", line 29, in handle_request
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    from types import SimpleNamespace
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic/router.py", line 66, in get
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    return self._get(path, method, host)
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server  File "/usr/local/lib/python3.7/site-packages/sanic/router.py", line 44, in _get
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-server    raise NotFound("Requested URL {} not found".format(e.path))
2023-06-26 07:44:01.37 UTCrasa-actions-server-f948469c9-b5vs2rasa-actions-serversanic.exceptions.NotFound: Requested URL /socket.io not found

when I check my chrome console I get this error enter image description here

I' m using wordpress and my script code is

!(function () {
  let e = document.createElement("script"),
    t = document.head || document.getElementsByTagName("head")[0];
  (e.src =
    "https://cdn.jsdelivr.net/npm/[email protected]/lib/index.js"),
    // Replace 1.x.x with the version that you want
    (e.async = !0),
    (e.onload = () => {
      window.WebChat.default(
        {
          initPayload: '/greet',
          customData: { language: "en" },
          socketUrl: "https://rasa-actions-server-mohammedayanthegreat.cloud.okteto.net",
         // socketUrl: "http://localhost:5005",
          // add other props here
          showMessageDate: true,
          embedded:true,
        },
        null
      );
    }),
    t.insertBefore(e, t.firstChild);
})();
my docker-compose.yml

version: '3.4'

services:
  rasa-server:
    image: rasa-bot:latest
    working_dir: /app
    build: './'
    restart: always
    volumes:
      - ./actions:/app/actions
      - ./data:/app/data
    command: bash -c "rm -rf .rasa/* && rasa train && rasa run --enable-api --cors \"*\" --credentials credentials.yml"
    ports:
      - '5006:5005'
    public: true
    networks:
      - all

  rasa-actions-server:
    image: rasa-bot:latest
    working_dir: /app
    build: './'
    restart: always
    volumes:
      - ./actions:/app/actions
    command: bash -c "rasa run actions"
    ports:
      - '5055:5055'
    networks:
      - all

networks:
  all:
    driver: bridge
    driver_opts:
      com.docker.network.enable_ipv6: "true"
my Dockerfile

FROM python:3.7.5-slim-buster AS BASE

RUN apt-get update \
    && apt-get --assume-yes --no-install-recommends install \
        build-essential \
        curl \
        git \
        jq \
        libgomp1 \
        vim

WORKDIR /app

# upgrade pip version
RUN pip install --no-cache-dir --upgrade pip


RUN pip install rasa
RUN pip install python-engineio==3.13.2
RUN pip install python-socketio==4.6.1

ADD config.yml config.yml
ADD domain.yml domain.yml
ADD credentials.yml credentials.yml
ADD endpoints.yml endpoints.yml
okteto.yml

name: rasa-server
command: bash
volumes:
- /root/.cache/pip
sync:
- .:/app
forward:
- 5006:5006
reverse:
- 8080:8080
endpoints.yml

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

# Server where the models are pulled from.
# https://rasa.com/docs/rasa/model-storage#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/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/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/event-brokers

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

credentials.yml

# This file contains the credentials for the voice & chat platforms
# which your bot is using.
# https://rasa.com/docs/rasa/messaging-and-voice-channels

rest:
#  # you don't need to provide anything here - this channel doesn't
#  # require any credentials


#facebook:
#  verify: "<verify>"
#  secret: "<your secret>"
#  page-access-token: "<your page access token>"

#slack:
#  slack_token: "<your slack token>"
#  slack_channel: "<the slack channel>"
#  slack_signing_secret: "<your slack signing secret>"

socketio:
 user_message_evt: user_uttered
 bot_message_evt: bot_uttered
 session_persistence: true

#mattermost:
#  url: "https://<mattermost instance>/api/v4"
#  token: "<bot token>"
#  webhook_url: "<callback URL>"

# This entry is needed if you are using Rasa X. The entry represents credentials
# for the Rasa X "channel", i.e. Talk to your bot and Share with guest testers.
rasa:
  url: "http://localhost:5002/api"

I was trying to deploy Rasa bot to Okteto and connect it with my wordpress site

0

There are 0 best solutions below