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

Docker run leads to error #2

Closed
kitzler-walli opened this issue Sep 14, 2024 · 6 comments
Closed

Docker run leads to error #2

kitzler-walli opened this issue Sep 14, 2024 · 6 comments

Comments

@kitzler-walli
Copy link

kitzler-walli commented Sep 14, 2024

I currently try to get the bot running in my Matrix Ansible deployment but when In try to run the docker container I receive this error: /bin/sh: 1: /app/baibot: Exec format error

I user Ubuntu 24.04.1 LTS and Docker version 27.2.0, build 3ab4256

this is the command I try to execute:

docker run \
-it \
--rm \
--name=matrix-bot-baibot \
--user=998:1000 \
--cap-drop=ALL \
--read-only \
--network=matrix-addons \
--env-file=/matrix/baibot/config/env \
--mount type=bind,src=/matrix/baibot/config/config.yml,dst=/app/config.yml,ro \
--mount type=bind,src=/matrix/baibot/data,dst=/data \
--tmpfs=/tmp:rw,noexec,nosuid,size=1024m \
ghcr.io/etkecc/baibot:latest
@spantaleev
Copy link
Contributor

Are you possibly on the arm32 architecture?
There's no prebuilt image for it, so you would need to use self-building.

I think there is also a playbook bug, in the sense that self-building is not automatically enabled for you when it should be.

@kitzler-walli
Copy link
Author

I'm using amd64 (x86_64).
How can i work around the self-building issue?

@spantaleev
Copy link
Contributor

The image should be multi-arch and support both amd64 and arm64. Could you try pulling it again?

@kitzler-walli
Copy link
Author

It seems like the image is not built - when i do it by hand it seems to work but when I use the docker run command I've shown in my first comment I still receive /bin/sh: 1: /app/baibot: Exec format error

@kitzler-walli
Copy link
Author

I was able to surpass the problems by building the image locally and then use it in my matrix setup. That works, at least it compiles and starts but during the usage of the bot I now receive these errors:
Couldn't setup and resume recovery Sdk(Http(Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("matrix.kw.at")), port: None, path: "/_matrix/client/v3/user/@baibot:kw.at/account_data/m.secret_storage.default_key", query: None, fragment: None }, source: TimedOut })))

Error: Error creating a new login session: Error recovering encryption keys: Failed to recover with an unknown error: Failed to recover with an unknown error: SecretStorage(Sdk(Http(Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("matrix.kw.at")), port: None, path: "/_matrix/client/v3/user/@baibot:kw.at/account_data/m.secret_storage.default_key", query: None, fragment: None }, source: TimedOut }))))

Could it be an issue with the docker networks?

@spantaleev
Copy link
Contributor

You're right - the :latest tag was problematic and only worked on arm64. It's some odd CI issue with that build which I haven't figured out yet.

I have rebuilt it and it seems to be fine now. I'll keep an eye on future CI runs and see if it can be reproduced.


The error that you're quoting seems to indicate a that the bot cannot connect to the Matrix server.

If you're using the Ansible playbook with the default Traefik reverse-proxy server, it should be communicating with Synapse via http://matrix-traefik:8008 over the container network. To allow this, the bot is automatically connected to the traefik network. To clarify, Synapse (in non-worker-mode) is reachable via http://matrix-synapse:8008 on the matrix-homeserver network, but requests are made to go through Traefik (http://matrix-traefik:8008) as an additional level of indirection.

If you're using another reverse-proxy, you may need to adjust the configuration and/or container networks.


About self-building not kicking in correctly on arm32 (as I was suspecting earlier), it turns out that it's not the case.

Self-building is correctly enabled for architectures other than arm64 and amd64 as seen here.

spantaleev added a commit that referenced this issue Sep 21, 2024
Related to #2

We've had a few more instances of the same issue since then.
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