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

Error: Cannot resolve receiver #37

Open
ThorpeJosh opened this issue Sep 29, 2023 · 3 comments
Open

Error: Cannot resolve receiver #37

ThorpeJosh opened this issue Sep 29, 2023 · 3 comments

Comments

@ThorpeJosh
Copy link

ThorpeJosh commented Sep 29, 2023

Have you come across this error message Cannot resolve receiver before?
I did a quick search but couldn't find the source code that throws this specific message.

2023-09-30 02:10:33,154 - root - INFO - [Bot] Producer #1 started
2023-09-30 02:10:33,157 - websockets.client - DEBUG - = connection is CONNECTING
2023-09-30 02:10:33,158 - websockets.client - DEBUG - > GET /v1/receive/+88888888 HTTP/1.1
2023-09-30 02:10:33,158 - websockets.client - DEBUG - > Host: signal-api:8080
2023-09-30 02:10:33,158 - websockets.client - DEBUG - > Upgrade: websocket
2023-09-30 02:10:33,159 - websockets.client - DEBUG - > Connection: Upgrade
2023-09-30 02:10:33,159 - websockets.client - DEBUG - > Sec-WebSocket-Key: abcdefg==
2023-09-30 02:10:33,159 - websockets.client - DEBUG - > Sec-WebSocket-Version: 13
2023-09-30 02:10:33,159 - websockets.client - DEBUG - > Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
2023-09-30 02:10:33,159 - websockets.client - DEBUG - > User-Agent: Python/3.11 websockets/10.4
2023-09-30 02:10:33,161 - websockets.client - DEBUG - < HTTP/1.1 101 Switching Protocols
2023-09-30 02:10:33,161 - websockets.client - DEBUG - < Upgrade: websocket
2023-09-30 02:10:33,161 - websockets.client - DEBUG - < Connection: Upgrade
2023-09-30 02:10:33,161 - websockets.client - DEBUG - < Sec-WebSocket-Accept: abcdefg=
2023-09-30 02:10:33,162 - websockets.client - DEBUG - = connection is OPEN
2023-09-30 02:11:27,180 - websockets.client - DEBUG - < PING '' [0 bytes]
2023-09-30 02:11:27,180 - websockets.client - DEBUG - > PONG '' [0 bytes]
2023-09-30 02:11:58,320 - websockets.client - DEBUG - < TEXT '{"envelope":{"source":"+9999999999","sourceNum...account":"+8888888888"}' [396 bytes]
2023-09-30 02:11:58,321 - root - INFO - [Raw Message] {"envelope":{"source":"+9999999999","sourceNumber":"+9999999999","sourceUuid":"abcdefg","sourceName":"Josh","sourceDevice":4,"timestamp":1696011117227,"dataMessage":{"timestamp":1696011117227,"message":"help","expiresInSeconds":28800,"viewOnce":false,"groupInfo":{"groupId":"qwerty=","type":"DELIVER"}}},"account":"+8888888888"}
2023-09-30 02:11:58,322 - root - INFO - [Bot] Consumer #1 got new job in 0.00051 seconds
2023-09-30 02:11:58,322 - root - ERROR - [IPCommand] Error: Cannot resolve receiver.
2023-09-30 02:12:21,172 - websockets.client - DEBUG - < PING '' [0 bytes]
2023-09-30 02:12:21,173 - websockets.client - DEBUG - > PONG '' [0 bytes]
@ThorpeJosh
Copy link
Author

Ok so the error is being thrown by SignalBot._resolve_receiver. They are groups that the SignalBot is listening to so I assume this line group_id = self._groups_by_internal_id[receiver]["id"] is throwing a Key error.

There was a lot of changes made relating to the groups and this specific exception was introduced in v0.8.0.
Downgrading to v0.7.0 resolves the issue, so it appears that something in v0.8.0 has introduced some instability.

@filipre
Copy link
Owner

filipre commented Sep 30, 2023

I see. Could you provide the initialization code that you use to start the bot and register the groups? I tried to make v0.8 backward compatible but there are probably still some bugs.

You can also try to use the new .register method that allows you to pass in signal group IDs and group names directly, without needing the secret or to call .listen*. There is an example in the example folder.

@ThorpeJosh
Copy link
Author

ThorpeJosh commented Oct 1, 2023

Here is my current setup.

config = {
    "signal_service": SIGNAL_API_HOST,
    "phone_number": SIGNAL_MOBILE_NO,
    "storage": None,
}
bot = SignalBot(config)
for group_id, group_internal_id in .....:
    bot.listen(group_id, group_internal_id)
bot.register(IPCommand())
bot.start()

I'll try out the new .register when I get a chance

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