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

No actual bridging happening at all #32

Closed
F13 opened this issue Sep 3, 2020 · 2 comments
Closed

No actual bridging happening at all #32

F13 opened this issue Sep 3, 2020 · 2 comments

Comments

@F13
Copy link

F13 commented Sep 3, 2020

I had a problem with the bridge no longer sending/receiving any messages. I attempted to reinstall multiple times. I can see events firing in the logs when I send a message in Matrix as well as when I receive one in Hangouts, but nothing is communicated between the two services. The only error I can find is immediately after login:

[2020-09-03 04:24:03,006] [INFO@hangups.auth] Authentication successful
[2020-09-03 04:24:03,673] [INFO@hangups.channel] Requesting new gsessionid and SID...
[2020-09-03 04:24:03,674] [DEBUG@hangups.http_utils] Sending request post https://0.client-channel.google.com/client-channel/channel/bind:
{'count': 0, 'ofs': 0}
[2020-09-03 04:24:03,873] [DEBUG@hangups.http_utils] Received response 200 OK:
b'100\n[[0,["c","E[redacted]","",8]\n]\n,[1,[{"gsid":"h[redacted]"}]]\n]\n'
[2020-09-03 04:24:03,874] [INFO@hangups.channel] New SID: E[redacted]
[2020-09-03 04:24:03,874] [INFO@hangups.channel] New gsessionid: h[redacted]
[2020-09-03 04:24:03,874] [INFO@hangups.channel] Opening new long-polling request
[2020-09-03 04:24:03,922] [DEBUG@hangups.channel] Received chunk:
b'153\n[[2,[{"p":"{\\"1\\":{\\"1\\":{\\"1\\":{\\"1\\":1,\\"2\\":1}},\\"4\\":\\"[redacted]\\",\\"5\\":\\"S1\\"},\\"3\\":{\\"1\\":{\\"1\\":1},\\"2\\":\\"lcsw_hangouts_[redacted]\\"}}"}]]\n]\n'
[2020-09-03 04:24:03,922] [DEBUG@hangups.event] Fired Event('Channel.on_connect')
[2020-09-03 04:24:03,922] [DEBUG@hangups.event] Fired Event('Client.on_connect')
[2020-09-03 04:24:03,927] [DEBUG@hangups.client] Sending Protocol Buffer request contacts/getselfinfo:
request_header {
  client_version {
    client_id: CLIENT_ID_WEB_HANGOUTS
    major_version: "hangups-0.4.10"
  }
  language_code: "en"
}

[2020-09-03 04:24:03,927] [DEBUG@hangups.http_utils] Sending request post https://clients6.google.com/chat/v1/contacts/getselfinfo:
b'\n\x18\n\x12\x08,\x1a\x0ehangups-0.4.10"\x02en'
[2020-09-03 04:24:04,089] [DEBUG@hangups.http_utils] Received response 401 Unauthorized:
b'{\n  "error": {\n    "code": 401,\n    "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",\n    "errors": [\n      {\n        "message": "Invalid Credentials",\n        "domain": "global",\n        "reason": "authError",\n        "location": "Authorization",\n        "locationType": "header"\n      }\n    ],\n    "status": "UNAUTHENTICATED"\n  }\n}\n'
[2020-09-03 04:24:04,089] [INFO@hangups.http_utils] Request returned unexpected status: 401 Unauthorized
[2020-09-03 04:24:04,090] [ERROR@mau.user.@f13:[redacted]] Failed to get_self_info
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mautrix_hangouts/user.py", line 232, in on_connect_later
    info = await self.client.get_self_info(hangouts.GetSelfInfoRequest(
  File "/usr/lib/python3.8/site-packages/hangups/client.py", line 543, in get_self_info
    await self._pb_request('contacts/getselfinfo',
  File "/usr/lib/python3.8/site-packages/hangups/client.py", line 413, in _pb_request
    res = await self._base_request(
  File "/usr/lib/python3.8/site-packages/hangups/client.py", line 469, in _base_request
    res = await self._session.fetch(
  File "/usr/lib/python3.8/site-packages/hangups/http_utils.py", line 86, in fetch
    raise exceptions.NetworkError(
hangups.exceptions.NetworkError: Request return unexpected status: 401: Unauthorized

After this error I continue to see regular log updates, including what appear to be Hangouts events, including:

[2020-09-03 04:35:10,004] [DEBUG@hangups.client] Received StateUpdate:
state_update_header {
  active_client_state: ACTIVE_CLIENT_STATE_OTHER_ACTIVE
  request_trace_id: "-[redacted]"
  notification_settings {
    dnd_settings {
      do_not_disturb: false
    }
  }
  current_server_time: [redacted]
}
event_notification {
  event {
    conversation_id {
      id: "[redacted]"
    }
    sender_id {
      gaia_id: "[redacted]"
      chat_id: "[redacted]"
    }
    timestamp: [redacted]
    self_event_state {
      user_id {
        gaia_id: "[redacted]"
        chat_id: "[redacted]"
      }
      client_generated_id: "[redacted]"
      notification_level: NOTIFICATION_LEVEL_RING
    }
    chat_message {
      message_content {
        segment {
          type: SEGMENT_TYPE_TEXT
          text: "asdf"
          formatting {
            bold: false
            italic: false
            strikethrough: false
            underline: false
          }
        }
      }
    }

and others.

I have tried completely removing the mautrix database and restarting the docker container from scratch and I still get the same result. Aside from the one error noted above, the log makes no indication whatsoever that anything is amiss.

Any thoughts?

@tulir
Copy link
Member

tulir commented Sep 3, 2020

This seems to be something hangouts changed, other people are also reporting it: tdryer/hangups#498

Probably need to fork/update the library to retry on 401 or something

@tulir
Copy link
Member

tulir commented Sep 4, 2020

Switched to a fork of hangups in 826c127

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

No branches or pull requests

2 participants