-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Failed to prepare profile (Avatar) error while account already had avatar #12
Comments
Despite the bot having done its avatar setup already, it can't know its current avatar is what it expects it to be, so it does a profile check (preparation) every time it starts. If it notices that its name is out-of-sync with the configuration, or its avatar is not what it expects it to be (there's a single image hardcoded in the binary), it will update its profile. So it checking its profile on every startup is not an issue. It's supposed to do it successfully. Does it keep retrying unsuccessfully for you? You can try enabling more verbose logging ( It's odd that it's getting a "not found" error. It almost sounds like the homeserver is down, but.. it shouldn't be, because before the profile preparation work, the underlying library (mxlink) actually does a "who am I" check to ensure the access token is still valid. So the homeserver should have been confirmed working just a moment ago before trying to prepare the profile. |
After some research, I suspect the issue might be caused by calling deprecated API. From the log:
The API is using _matrix/media/v3/download/matrix.org, which is deprecated. According to the Matrix API playground and the specification, this endpoint may return a 404 M_NOT_FOUND error for media that exists but is inaccessible due to the server freezing unauthenticated media access. I suspect this might be the cause. Not sure if anyone else is experiencing the same problem? |
This is caused by the latest matrix-rust-sdk release (v0.7.1) being too out-of-date and not supporting authenticated media. The matrix.org server has disabled unauthenticated media already. Other servers are soon to follow as well. We have a few other features that deal with file downloads/uploads, which would also be broken due to this. Authenticated media support already appears to be working upstream (in ruma and matrix-rust-sdk), but there's no matrix-rust-sdk release yet. The last one is from 8 months ago. Hopefully, the matrix-rust-sdk folks will cut a new release (v0.8?) soon which we can switch to. I've pinged them about it here: matrix-org/matrix-rust-sdk#3742 (comment) |
Now that 39a184e upgraded mxlink to 1.4.0 (which is based on matrix-rust-sdk 0.8.0 which supports authenticated media, baibot supports authenticated media too. In 4847bd8, I have adjusted the local services to enable authenticated media. In 7889324, I have updated the changelog entries for the new baibot release (v1.4.0) to mention this new feature. I have not tested against |
The first login was successful. However, on the second login attempt, since the avatar was already created during the first login, the process continuously repeats and gets stuck in the following error:
2024-09-21T15:02:16.359433Z DEBUG ThreadId(01) baibot::bot::implementation: src/bot/implementation.rs:264: Preparing profile..
2024-09-21T15:02:17.259867Z WARN ThreadId(01) baibot::bot::implementation: src/bot/implementation.rs:249: Failed to prepare profile.. Will retry after delay... err=Failed fetching existing avatar: Http(Api(Server(ClientApi(Error { status_code: 404, body: Standard { kind: NotFound, message: "Not found" } })))) delay=3s
The homeserver I used is matrix.org
The text was updated successfully, but these errors were encountered: