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

"the server returned an error: [404] <non-json bytes>" #338

Open
ahs3 opened this issue Aug 23, 2024 · 6 comments
Open

"the server returned an error: [404] <non-json bytes>" #338

ahs3 opened this issue Aug 23, 2024 · 6 comments

Comments

@ahs3
Copy link

ahs3 commented Aug 23, 2024

Any clues as to what the message in the title means?

To reproduce this, I have removed ~/.config/iamb, ~/.local/share/iamb, and ~/.cache/iamb -- just like it would be if I had never run iamb before. With a sufficient timeout, I can sync up my matrix account with fedora.im. I can see rooms and spaces and such -- it all looks quite nice, really; thank you!

However, if I quit iamb, and then run it again, I get the following:

$ ~/projects/iamb/target/debug/iamb

  • Logging in for @
  • Syncing...
    the server returned an error: [404]

If I remove all the files again, I can sync up again, but have to go through the SSO process again. And if I quit iamb, I'm back to .

I've attached a debug log but with my matrix account redacted. I would dig further, but I'm still a rust n00b.

iamb-log-2024-08-23.txt

@ahs3
Copy link
Author

ahs3 commented Aug 24, 2024

additional info: no verification had taken place; however, even if verification was successful, and the final tab is :quit, I get the same message

@ulyssa
Copy link
Owner

ulyssa commented Aug 30, 2024

It looks like there may be something odd going on with which server it's trying to connect to. I can see that it's getting back 404 responses from chat.fedoraproject.org

% grep '\<404\>' iamb-log-2024-08-23.txt | less
2024-08-23T22:46:43.648650Z DEBUG send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8] config=RequestConfig { timeout: 120s, retry_timeout: 120s } request_id="REQ-1" method=GET uri="https://chat.fedoraproject.org/_matrix/client/v3/user/@redacted:server/account_data/m.secret_storage.default_key" status=404 response_size="153 B"}: matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 404, body: NotJson { bytes: b"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.27.1</center>\r\n</body>\r\n</html>\r\n", deserialization_error: Error("expected value", line: 1, column: 1) } })))
2024-08-23T22:46:43.648927Z ERROR matrix_sdk::encryption: Couldn't setup and resume recovery Sdk(Http(Api(Server(ClientApi(Error { status_code: 404, body: NotJson { bytes: b"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.27.1</center>\r\n</body>\r\n</html>\r\n", deserialization_error: Error("expected value", line: 1, column: 1) } })))))
2024-08-23T22:46:43.654046Z DEBUG sync_with_callback:sync_with_result_callback{sync_settings=SyncSettings { timeout: 30s, full_state: false, set_presence: "online" }}:sync_once{sync_settings=SyncSettings { timeout: 30s, full_state: false, set_presence: "online" }}:send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8] config=RequestConfig { timeout: 150s, retry_timeout: 120s } request_id="REQ-3" method=GET uri="https://chat.fedoraproject.org/_matrix/client/v3/sync" status=404 response_size="153 B"}: matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 404, body: NotJson { bytes: b"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.27.1</center>\r\n</body>\r\n</html>\r\n", deserialization_error: Error("expected value", line: 1, column: 1) } })))
2024-08-23T22:46:43.654259Z ERROR sync_with_callback:sync_with_result_callback{sync_settings=SyncSettings { timeout: 30s, full_state: false, set_presence: "online" }}: matrix_sdk::sync: Received an invalid response: the server returned an error: [404] <non-json bytes>
2024-08-23T22:46:43.654208Z DEBUG sync_once{sync_settings=SyncSettings { filter: FilterDefinition(FilterDefinition { event_fields: None, event_format: "client", presence: Filter { not_types: [], limit: None, senders: None, types: None, not_senders: [] }, account_data: Filter { not_types: [], limit: None, senders: None, types: None, not_senders: [] }, room: RoomFilter { include_leave: false, account_data: RoomEventFilter { not_types: [], not_rooms: [], limit: None, rooms: None, not_senders: [], senders: None, types: None, url_filter: None, lazy_load_options: Disabled, unread_thread_notifications: false }, timeline: RoomEventFilter { not_types: [], not_rooms: [], limit: None, rooms: None, not_senders: [], senders: None, types: None, url_filter: None, lazy_load_options: Disabled, unread_thread_notifications: false }, ephemeral: RoomEventFilter { not_types: [], not_rooms: [], limit: None, rooms: None, not_senders: [], senders: None, types: None, url_filter: None, lazy_load_options: Disabled, unread_thread_notifications: false }, state: RoomEventFilter { not_types: [], not_rooms: [], limit: None, rooms: None, not_senders: [], senders: None, types: None, url_filter: None, lazy_load_options: Enabled { include_redundant_members: false }, unread_thread_notifications: false }, not_rooms: [], rooms: None } }), timeout: 30s, full_state: false, set_presence: "online" }}:send{server_versions=[V1_0, V1_1, V1_2, V1_3, V1_4, V1_5, V1_6, V1_7, V1_8] config=RequestConfig { timeout: 150s, retry_timeout: 120s } request_id="REQ-2" method=GET uri="https://chat.fedoraproject.org/_matrix/client/v3/sync" status=404 response_size="153 B"}: matrix_sdk::http_client: Error while sending request: Api(Server(ClientApi(Error { status_code: 404, body: NotJson { bytes: b"<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.27.1</center>\r\n</body>\r\n</html>\r\n", deserialization_error: Error("expected value", line: 1, column: 1) } })))

But it looks like that's not the right Matrix homeserver URL:

% curl https://fedoraproject.org/.well-known/matrix/client
{  
   "m.homeserver": {
       "base_url": "https://fedoraproject.ems.host"
   },
   "m.identity_server": {
       "base_url": "https://vector.im"
   },
   "org.matrix.msc3575.proxy": {
       "url": "https://fedoraproject.ems.host"
   }
}

You might want to try setting your profile to have an explicit homeserver and see if that fixes it:

[profiles.PROFILENAME]
user_id = "@whatever:fedoraproject.org"
url = "https://fedoraproject.ems.host"

@ahs3
Copy link
Author

ahs3 commented Aug 30, 2024 via email

@ahs3
Copy link
Author

ahs3 commented Sep 1, 2024 via email

@ahs3
Copy link
Author

ahs3 commented Sep 3, 2024 via email

@bombermuecke
Copy link

I've had the same error message while trying to login to my matrix account at utwente.io. For me, the following solved it: usually, they (utwente) automatically redirect the server url from https://utwente.io to the actual address https://matrix.utwente.io. But it seems that this automatism does not work with iamb. After I changed the url in the iamb configfile to https://matrix.utwente.io, the login worked without issues. Maybe there is a similar issue with your matrix server.

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

3 participants