matrixgpt / matrix-chatgpt-bot

Talk to ChatGPT via any Matrix client!
GNU Affero General Public License v3.0
230 stars 64 forks source link

[ERROR] [MatrixHttpClient] (REQ-1) <html> #213

Closed RampantPanda closed 10 months ago

RampantPanda commented 10 months ago

Trying to run this with docker-compose. My docker-compose.yml is here:https://bin.garudalinux.org/?a34b6788ef9aca53#CBxc8yTUyZc8hp1BqaxQwqyTqC3cLfKs8bk1SVRLxBwp My .env file is here:https://bin.garudalinux.org/?4cd91773510ba87f#GaJnsTDHUB9TT5XKN66fWQYG8fWjTBphabWFSx3b2SoG

When I run docker-compose up -d, I get this: `$ docker logs matrix-chatgpt-bot yarn run v1.22.19 $ node --enable-source-maps dist/index.js Wed, 16 Aug 2023 19:51:39 GMT [ERROR] [MatrixHttpClient] (REQ-1)

404 Not Found

404 Not Found


nginx/1.25.1

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".] { code: 'ERR_UNHANDLED_REJECTION' }

Node.js v19.9.0 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. yarn run v1.22.19 $ node --enable-source-maps dist/index.js Wed, 16 Aug 2023 19:51:41 GMT [ERROR] [MatrixHttpClient] (REQ-1)

404 Not Found

404 Not Found


nginx/1.25.1

node:internal/process/promises:289 triggerUncaughtException(err, true / fromPromise /); ^

`

max298 commented 10 months ago

This looks like your MATRIX_HOMESERVER_URL is not correct, as nginx (I assume you use NGINX as a reverse proxy for synapse) returns 404, so the matrix-bot-sdk is unable to connect to your homeserver. I think the sdk is searching for MATRIX_HOMESERVER_URL/_matrix/client/something.

Could you try to open your MATRIX_HOMESERVER_URL/_matrix in any browser? You should see a response like this:

{"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}
RampantPanda commented 10 months ago

The unredacted line is: MATRIX_HOMESERVER_URL=https://element.norge.chat , and the url opens in the browser.

EDIT: Sorry, I just now realized the _matrix part. https://element.norge.chat/_matrix does give a 404 error.

max298 commented 10 months ago

Right, because that's the URL from element, the web client. From looking at your URL, what you want to use as the MATRIX_HOMESERVER_URL is https://matrix.norge.chat.

RampantPanda commented 10 months ago

Thanks :) Works great now.