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

Connecting to Firebase fails with invalid URL, scheme is not http #162

Open
konrad-xtention opened this issue Oct 21, 2024 · 3 comments
Open

Comments

@konrad-xtention
Copy link

Since upgrading to Hedwig 2.1.0 the connection to Firebase fails.
This is printed to the log:
ERROR matrix_hedwig::error: fcm error: error sending request for url (https://fcm.googleapis.com/v1/projects/<snip>/messages:send): error trying to connect: invalid URL, scheme is not http

This is a duplicate of #159, which was closed without the bug actually being fixed.

@nikzen nikzen added the bug Something isn't working label Oct 24, 2024
@vanyasem
Copy link

vanyasem commented Nov 1, 2024

I have tried applying a suggested fix from #159 by reverting ebc1804, but unfortunately this didn't solve the problem - productlabteam@1cd5c64

The error is exactly the same:

2024-11-01T21:11:26.111255Z ERROR matrix_hedwig::error: fcm error: error sending request for url (https://fcm.googleapis.com/v1/projects/nnm-im/messages:send): error trying to connect: invalid URL, scheme is not http
...
2024-11-01T21:11:33.867512Z  INFO matrix_hedwig::api: A push failed (device type: Ios), even after retrying: {
  "error": "Something went wrong while trying to interact with fcm",
  "errcode": "FCM_FAILED"
}

@vanyasem
Copy link

vanyasem commented Nov 1, 2024

hedwig uses firebae-cm = "0.1.0", which is the first version of firebae-cm ever released available here: https://github.com/Vesafary/firebae-cm/tree/a2a2f035d3650b4eb9a9a14a831a07db13bf4baa

If we take a look at it's Cargo.toml, we might notice the lack of a specified TLS implementation for reqwest:

reqwest =           { version = "0.11.9", features = ["json"], default-features=false }`

You can see an explanation of why that's an issue here: seanmonstar/reqwest#2161

This was later fixed in this commit, adding a "rustls-tls" feature: Vesafary/firebae-cm@d0bf005, which went into firebae-cm = "0.3.0" release.

Unfortunately firebae-cm 0.3.0 has had breaking changes, and cannot be directly updated to without making changes to hedwig's codebase.

@vanyasem
Copy link

vanyasem commented Nov 2, 2024

We made a fork of firebae-cm = "0.1.0" with the TLS fix backported: https://github.com/productlabteam/firebae-cm/tree/0.1.0

You can use our fixed fork of hedwig, or you can apply the patch directly: productlabteam@b7883b5

@nikzen nikzen removed the bug Something isn't working label Dec 2, 2024
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