Rasa server gives 404 for most endpoints

I first did this in one terminal:

(rasa) C:\Users\MysriO\Documents\sourceCode\rasa_insomnia>rasa run
2021-10-30 21:42:57 INFO     root  - Starting Rasa server on http://localhost:5005
2021-10-30 21:42:57 INFO     rasa.model  - Loading model models\20211028-164831.tar.gz...
[skipped unrelavent logging]
2021-10-30 21:43:33 INFO     root  - Rasa server is up and running.

And I used curl to test this server. The root URL works fine:

(rasa) C:\Users\MysriO\Documents\sourceCode\rasa_insomnia>curl http://localhost:5005/
Hello from Rasa: 2.8.3

But even the simplest version endpoint did not work:

(rasa) C:\Users\MysriO\Documents\sourceCode\rasa_insomnia>curl http://localhost:5005/version
<!DOCTYPE html><html lang=en><meta charset=UTF-8><title>⚠️ 404 — Not Found</title>
<style>
        html { font-family: sans-serif }
        h2 { color: #888; }
        .tb-wrapper p { margin: 0 }
        .frame-border { margin: 1rem }
        .frame-line > * { padding: 0.3rem 0.6rem }
        .frame-line { margin-bottom: 0.3rem }
        .frame-code { font-size: 16px; padding-left: 4ch }
        .tb-wrapper { border: 1px solid #eee }
        .tb-header { background: #eee; padding: 0.3rem; font-weight: bold }
        .frame-descriptor { background: #e2eafb; font-size: 14px }
    </style>
<h1>⚠️ 404 — Not Found</h1><p>Requested URL /version not found

I don’t know why this happened. Since the server is alive, and the version endpoint, as far as what I read in its definition, does not requires anything like authentication.

@app.get("/version")
    async def version(request: Request) -> HTTPResponse:
        """Respond with the version number of the installed Rasa."""

        return response.json(
            {
                "version": rasa.__version__,
                "minimum_compatible_version": MINIMUM_COMPATIBLE_VERSION,
            }
        )

Of course, other endpoints except / give 404 also.

Btw, I wonder if you know how to debug rasa run in IDE, in other word, start rasa server from a script rather than command line. Running rasa server in the command line seems to not provide enough information for me. I tried this:

import rasa

rasa.run(
    model="models",
    endpoints="endpoints.yml",
    credentials="credentials.yml"
)

But it always gives TensorFlow errors, while starting rasa server in the command line works fine. I can even chat with the bot in rasa shell or rasa x UI normally. I don’t understand why.

Thank you in advance for any reply!

Make sure you do the rasa run command with the --enable-api option.

1 Like