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

Unable to get it working #168

Open
jhjacobs81 opened this issue Sep 23, 2024 · 9 comments
Open

Unable to get it working #168

jhjacobs81 opened this issue Sep 23, 2024 · 9 comments

Comments

@jhjacobs81
Copy link

jhjacobs81 commented Sep 23, 2024

Hello,

I have created a docker-compose.yml file like so:

services:
  matrix-whook:
    image: nim65s/matrix-webhook:latest
    container_name: matrix-whook
    environment:
      - MATRIX_URL="HOMESERVER"
      - MATRIX_ID="bot:HOMESERVER"
      - MATRIX_PW="PASSWORD"
      - API_KEY="SECRET"
    ports:
      - 4785:4785
    restart: always
    networks:
      - matrix-lan

networks:
    default:
        driver: bridge
    matrix-lan:
        external: true

This seems to spin up normally, but after that nothing happens. I can see its running when i do docker ps. But i cant invite the bot to any rooms, and when i try to use the curl command as per documentation, it just hangs.. nothing happens?

I am unsure what i am doing wrong here? matrix-lan is the network the matrix server is also on, MATRIX_URL is the fqdn of the server which works normally. the account for the bot is created as well.

@nim65s
Copy link
Owner

nim65s commented Sep 23, 2024

I guess we need to increase verbosity. But that is not trivial enough, I'll open a PR to deal with this.

@jhjacobs81
Copy link
Author

jhjacobs81 commented Sep 23, 2024

when i run it with docker compose it hangs at "attaching to matrix-whook" and then nothing. (so i assume its working)

I thought this bot would respond to invites, join the room, and then i could have outside services send messages to that room through the webhook, but maybe i am mistaken?

@nim65s
Copy link
Owner

nim65s commented Sep 23, 2024

You can impersonate the bot in a real matrix client, and check if the bot can join those room manually

@nim65s
Copy link
Owner

nim65s commented Sep 23, 2024

now #169 is merged, if you pull the new docker image, you can add VERBOSITY=3 or 4, and you should get more info

@jhjacobs81
Copy link
Author

thanks, let me try that :)

In element, i can join the invited rooms normally.

@jhjacobs81
Copy link
Author

that results in:

Attaching to matrix-whook
matrix-whook  | Traceback (most recent call last):
matrix-whook  |   File "<frozen runpy>", line 198, in _run_module_as_main
matrix-whook  |   File "<frozen runpy>", line 88, in _run_code
matrix-whook  |   File "/matrix_webhook/__main__.py", line 16, in <module>
matrix-whook  |     main()
matrix-whook  |   File "/matrix_webhook/__main__.py", line 12, in main
matrix-whook  |     app.run()
matrix-whook  |   File "/matrix_webhook/app.py", line 66, in run
matrix-whook  |     loop.run_until_complete(main(event))
matrix-whook  |   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
matrix-whook  |     return future.result()
matrix-whook  |            ^^^^^^^^^^^^^^^
matrix-whook  |   File "/matrix_webhook/app.py", line 23, in main
matrix-whook  |     await utils.CLIENT.login(conf.MATRIX_PW)
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 1097, in login
matrix-whook  |     return await self._send(LoginResponse, method, path, data)
matrix-whook  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 777, in _send
matrix-whook  |     transport_resp = await self.send(
matrix-whook  |                      ^^^^^^^^^^^^^^^^
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 291, in wrapper
matrix-whook  |     return await func(self, *args, **kwargs)
matrix-whook  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/nio/client/async_client.py", line 855, in send
matrix-whook  |     return await self.client_session.request(
matrix-whook  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 545, in _request
matrix-whook  |     req = self._request_class(
matrix-whook  |           ^^^^^^^^^^^^^^^^^^^^
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 326, in __init__
matrix-whook  |     self.update_host(url)
matrix-whook  |   File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 400, in update_host
matrix-whook  |     raise InvalidURL(url)
matrix-whook  | aiohttp.client_exceptions.InvalidURL: %22https://<URL>%22/_matrix/client/r0/login
matrix-whook exited with code 0

@nim65s
Copy link
Owner

nim65s commented Sep 23, 2024

Better. Those %22 here seems to indicate you should remove surrounding " characters from your URL

@jhjacobs81
Copy link
Author

jhjacobs81 commented Sep 23, 2024

i did that for all the variables, now i'm back to "it hangs at attaching to matrix-whook"
It doesnt come online, but its not outputting anything either.

@jhjacobs81
Copy link
Author

should i download the whole directory and build it using the Dockerfile? or is the image working itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants