Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams webhook returns 404 when running botpress on a (not empty) root path #1777

Open
gpdeltedesco opened this issue Oct 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gpdeltedesco
Copy link

gpdeltedesco commented Oct 6, 2023

Description

When running botpress on path (e.g. EXTERNAL_URL=http://localhost:3000/some_path), messaging endpoint for teams fails with 404 (e.g. POST http://localhost:3000/some_path/api/v1/messaging/webhooks/<bot-id>/teams)

To reproduce

  1. Run botpress with a not empty root path:

    docker run --rm --name botpress --publish 3000:3000 --env "EXTERNAL_URL=http://localhost:3000/botpress" botpress/server:v12_31_0
    
  2. Navigate to http://localhost:3000/botpress and create an admin

  3. Create an empty bot named empty_bot, and configure teams channel:

    ...
      "messaging": {
        "channels": {
          "teams": {
            "enabled": true,
            "appId": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
            "appPassword": "01234567890.1234567890.123456789.abcde.."
          }
        }
      }
    
  4. Try to post to http://localhost:3000/botpress/api/v1/messaging/webhooks/empty_bot/teams

    curl -vvv --request POST http://localhost:3000/botpress/api/v1/messaging/webhooks/empty_bot/teams
    *   Trying 127.0.0.1:3000...
    * Connected to localhost (127.0.0.1) port 3000 (#0)
    > POST /botpress/api/v1/messaging/webhooks/empty_bot/teams HTTP/1.1
    > Host: localhost:3000
    > User-Agent: curl/7.88.1
    > Accept: */*
    > 
    < HTTP/1.1 404 Not Found
    < X-Powered-By: Express
    < content-security-policy: default-src 'none'
    < x-content-type-options: nosniff
    < content-type: text/html; charset=utf-8
    < content-length: 173
    < date: Fri, 06 Oct 2023 01:20:59 GMT
    < connection: close
    < Vary: Accept-Encoding
    < 
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Error</title>
    </head>
    <body>
    <pre>Cannot POST /botpress/webhooks/empty_bot/teams</pre>
    </body>
    </html>
    * Closing connection 0
    

Expected behavior

Botpress should be able to resolve the given URL (in this case, should return 400 BAD REQUEST). To ilustrate, repeat the example but with EXTERNAL_URL=http://localhost:3000 and executing a POST to http://localhost:3000/api/v1/messaging/webhooks/empty_bot/teams

Screenshots
n/a

Environment (please complete the following information):

  • OS: Linux (docker)
  • Browser: n/a
  • Browser Version: n/a
  • Botpress Version: 12.30.9 to 12.31.0
  • NodeJS: n/a

Additional context
n/a

@gpdeltedesco gpdeltedesco added the bug Something isn't working label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant