boxdot / gurk-rs

Signal Messenger client for terminal
GNU Affero General Public License v3.0
456 stars 33 forks source link

relink: "Error: no provisioning message received" #208

Closed ccstolley closed 1 year ago

ccstolley commented 1 year ago

I had to relink gurk and it produces the QR code followed by this error from the log:

2023-01-03T23:46:01.783443Z  INFO presage::manager: generating qrcode from provisioning link: sgnl://linkdevice?uuid=xxx&pub_key=yyy
2023-01-03T23:46:01.897170Z  WARN libsignal_service::websocket: Response code for keep-alive is not 200: WebSocketResponseMessage
{ id: Some(85...45), status: Some(401), message: Some("Unauthorized"), headers: ["Content-Type:application/json", "Content-Length:47"], body: Some([123, ..., 125]) }
2023-01-03T23:46:01.897225Z ERROR libsignal_service::websocket: SignalWebSocket: Unexpected response: HTTP 401
2023-01-03T23:46:01.897267Z  INFO libsignal_service::provisioning::pipe: Sink closed, provisioning is done!

(I redacted some of the data because I'm not sure whether it's revealing or not)

It might be helpful to not print the QR code unless the web request succeeds, but more importantly, I'm not sure why it's failing with a 401 error.

I was able to relink signal-desktop.app so I don't think it's caused by something unique to my account.

Are others seeing this problem?

This is against the code in master. I'm using Debian Bullseye on amd64 and Rust 1.66.0.

gferon commented 1 year ago

Thanks for the report. As libsignal-service-rs and presage aren't official implementations, it sometimes breaks like this and we have to catch up. I'll have a look ASAP!

ccstolley commented 1 year ago

I dug into this a little bit and it appears that the /v1/keepalive endpoint now requires authentication, which explains the 401 error. There is however an unauthenticated keepalive endpoint for provisioning called /v1/keepalive/provisioning .

As a temporary work-around I changed the libsignal-service to use the provisioning keepalive endpoint and everything started working again. The real fix seems a bit more involved but I'll look into it.

gferon commented 1 year ago

So, I knew this rang a 🔔 - we fixed that bug some time ago in the downstream libraries used in gurk. I have opened https://github.com/boxdot/gurk-rs/pull/214 which should fix the issue you're having (at least I tested linking and relinking, and it works as expected).

hoomp3 commented 1 year ago

any update on when the fix will get merged in?

boxdot commented 1 year ago

@hoomp3 #214 is merged. I would appreciate a lot if you could test whether it fixes the issue for you. Thanks.

nevun commented 1 year ago

@hoomp3 #214 is merged. I would appreciate a lot if you could test whether it fixes the issue for you. Thanks.

I had the same issue, this fixed it. Thanks!

hoomp3 commented 1 year ago

@hoomp3 #214 is merged. I would appreciate a lot if you could test whether it fixes the issue for you. Thanks.

Yep, just tried it again and everything works great, thanks for the quick response ^^