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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Federation with friendica does not work #2029

Closed
xundeenergie opened this issue Jan 10, 2022 · 7 comments
Closed

Federation with friendica does not work #2029

xundeenergie opened this issue Jan 10, 2022 · 7 comments
Labels
area: federation support federation via activitypub bug Something isn't working

Comments

@xundeenergie
Copy link

Found a bug? Please fill out the sections below. 馃憤

For front end issues, use lemmy-ui

Issue Summary

I can follow a community on lemmy from friendica. But no postings or comments get federated.

Steps to Reproduce

  1. Search for a lemmy community on friendica
  2. Klick "Follow"
  3. Post something in the community on lemmy

Technical details

The lemmy-logs does not give an error.
But in friendica i get this:

2022-01-10T01:58:43Z index [INFO]: Taking key from id {"id":"https://lemmy.schuerz.at/c/test#main-key"} - {"file":"HTTPSignature.php","line":644,"function":"fetchKey","uid":"0ec689","process_id":1169635}        
2022-01-10T01:58:43Z index [INFO]: Taking key from id {"id":"https://lemmy.schuerz.at/c/test#main-key"} - {"file":"HTTPSignature.php","line":644,"function":"fetchKey","uid":"f4fe30","process_id":1169627}        
2022-01-10T01:58:43Z index [INFO]: Verification failed [] - {"file":"HTTPSignature.php","line":575,"function":"getSigner","uid":"0ec689","process_id":1169635}                                                     
2022-01-10T01:58:43Z index [INFO]: Verification failed [] - {"file":"HTTPSignature.php","line":575,"function":"getSigner","uid":"f4fe30","process_id":1169627}                                                     
2022-01-10T01:58:43Z index [WARNING]: Invalid HTTP signature, message will be discarded. [] - {"file":"Receiver.php","line":104,"function":"processInbox","uid":"f4fe30","process_id":1169627}                     
2022-01-10T01:58:43Z index [WARNING]: Invalid HTTP signature, message will be discarded. [] - {"file":"Receiver.php","line":104,"function":"processInbox","uid":"0ec689","process_id":1169635}                     
2022-01-10T01:58:43Z index [INFO]: Taking key from id {"id":"https://lemmy.schuerz.at/c/test#main-key"} - {"file":"HTTPSignature.php","line":644,"function":"fetchKey","uid":"8fa452","process_id":1171206}        
2022-01-10T01:58:43Z index [INFO]: Verification failed [] - {"file":"HTTPSignature.php","line":575,"function":"getSigner","uid":"8fa452","process_id":1171206}                                                     
2022-01-10T01:58:43Z index [WARNING]: Invalid HTTP signature, message will be discarded. [] - {"file":"Receiver.php","line":104,"function":"processInbox","uid":"8fa452","process_id":1171206}                     

Friendica wants to fetch a Public-Key from lemmy on https://lemmy.schuerz.at/c/test#main-key but this URL only returns the community.
I found in my friendica log, that for another site/relay on https://ap-relay-ger.650thz.de/actor#main-key (which is asked in friendica also with "Taking key from id" gives me a JSON with some informations and a pubkey.

So... i don't know, if friendica asks to the wrong url or if lemmy does not answer correctly...

@xundeenergie xundeenergie added the bug Something isn't working label Jan 10, 2022
@Nutomic
Copy link
Member

Nutomic commented Jan 10, 2022

The public keys on Lemmy/Friendica look similar enough, I dont think its the problem. One possibility is that Friendica doesnt support the HTTP Signature version which Lemmy is using (draft 11 which uses new fields (created) and (expires). Lemmy is backwards compatible with older versions, which would explain why sending from Friendica to Lemmy works, but not the other way round.

This issue describes the exact thing I am talking about. I suggest you ask there how its coming along.

@xundeenergie
Copy link
Author

Thank you.
I told it the friendica devs and asked to look into here.

@annando
Copy link

annando commented Jan 21, 2022

The signature check mechanism is improved now. We still have to test the rest of the communication, but this communication layer does work now.

@xundeenergie
Copy link
Author

Now it's another error

  1. Join a Lemmy community from friendica.
  2. Create a posting in Lemmy
  3. see it in Friendica.
  4. answer in Friendica
  5. look into Lemmys logfile while posting
lemmy_1     | 2022-01-23T20:21:26.183621Z  INFO HTTP request{http.method=POST http.scheme="http" http.host=lemmy.schuerz.at http.target=/inbox otel.kind="server" request_id=0d4a8d70-5c5a-46d3-8866-4ea6ee988123}:
shared_inbox: lemmy_apub::http: Received shared inbox activity {"@context":["https://www.w3.org/ns/activitystreams","https://w3id.org/security/v1",{"vcard":"http://www.w3.org/2006/vcard/ns#","dfrn":"http://purl.
org/macgirvin/dfrn/1.0/","diaspora":"https://diasporafoundation.org/ns/","litepub":"http://litepub.social/ns#","toot":"http://joinmastodon.org/ns#","schema":"http://schema.org#","manuallyApprovesFollowers":"as:m
anuallyApprovesFollowers","sensitive":"as:sensitive","Hashtag":"as:Hashtag","directMessage":"litepub:directMessage","discoverable":"toot:discoverable","PropertyValue":"schema:PropertyValue","value":"schema:value
"}],"id":"https://soc.schuerz.at/objects/4edd2508-4361-edb8-c4d8-b45181083984/Create","type":"Create","actor":"https://soc.schuerz.at/profile/jakob","published":"2022-01-23T20:21:24Z","instrument":{"type":"Servi
ce","name":"Friendica 'Siberian Iris' 2021.12-rc-1448","url":"https://soc.schuerz.at"},"to":["https://lemmy.schuerz.at/u/jakob","https://www.w3.org/ns/activitystreams#Public","https://lemmy.schuerz.at/c/test"],"cc":["https://soc.schuerz.at/followers/jakob"],"object":{"id":"https://soc.schuerz.at/objects/4edd2508-4361-edb8-c4d8-b45181083984","type":"Note","summary":"","inReplyTo":"https://lemmy.schuerz.at/post/25360","diaspora:guid":"4edd2508-4361-edb8-c4d8-b45181083984","published":"2022-01-23T20:21:24Z","url":"https://soc.schuerz.at/display/4edd2508-4361-edb8-c4d8-b45181083984","attributedTo":"https://soc.schuerz.at/profile/jakob","sensitive":false,"context":"https://lemmy.schuerz.at/post/25360#context","content":"<span class=\"h-card\"><a href=\"https://lemmy.schuerz.at/u/jakob\" class=\"u-url mention\">@<span>jakob</span></a></span> test","contentMap":{"de":"<bdi>@<a href=\"https://lemmy.schuerz.at/u/jakob\" class=\"userinfo mention\" title=\"jakob\">jakob</a></bdi> test"},"source":{"content":"@[url=https://lemmy.schuerz.at/u/jakob]Jakob[/url] test","mediaType":"text/bbcode"},"diaspora:comment":"{\"author\":\"jakob@soc.schuerz.at\",\"guid\":\"4edd2508-4361-edb8-c4d8-b45181083984\",\"created_at\":\"2022-01-23T20:21:24Z\",\"edited_at\":\"2022-01-23T20:21:24Z\",\"parent_guid\":\"ea620d1e-742c8b4d15249a9b-18b5fca3\",\"text\":\"@{Jakob; jakob@lemmy.schuerz.at} test\",\"author_signature\":\"JNCqOui5Cg8\\/Uxw+f0NtGCRjRnhPOrqE6kGJnMkZvOOKhlCdZbCqvyPlNJzEYDa3Z30mOWQKTTNo5BVI+VVZtGrVEqFOdzNog7jOLQoY1dKU9iEQ9vc8USwUCkyJyv48w1iXpfea87KPwv+03DMlftmD6kC7jdUVwhc7+jm0g4fh06tpOcCMQJOZqTTV\\/80EjxIJQ+8eEk5evSw\\/S98ohD1ahcwSomJ9hJUV1H48ucDvMod1FCLcN5h4ALHqubCu4TZIYhGhw9zoCl52GeHhrD3\\/vL6OW4ftZ7UG4rEKQ4HowuXqmNwydrQldtprRtu2UrZBjLqVusPXEs\\/xERQqZnalNXHijyd1TwwCmfTV4YjKwH4BhX\\/p4hdWMqEP4yYXlfA4apalVeAaYZLrNR58kPJjBHad\\/yqH30ziBFheqZ5odFh\\/jnKB4OCFVST3u9b1OKE0jyTrbTepPTaONwc8giQH1sM8koj1gFdulwuJuOTRUKR\\/8ishgHi5SWwbp5YG5Z3YSINkF10IcLiFZAF300AvwgOCdf7ferim4i\\/7TR1D2CBpoNUZnKCKZRymZbE0GuKEE+A6Pk3lk\\/DCsDtmMXpnxlPZ8Nq8OZS\\/olXevAu1y57MNnxBDXtojr4F54MP2fO7E2JwBr7AlwoeSEvtZSAO\\/elzrKfW0eVWOUM2OnI=\"}","attachment":[],"tag":[{"type":"Mention","href":"https://lemmy.schuerz.at/u/jakob","name":"@jakob@lemmy.schuerz.at"}],"to":["https://lemmy.schuerz.at/u/jakob","https://www.w3.org/ns/activitystreams#Public","https://lemmy.schuerz.at/c/test"],"cc":["https://soc.schuerz.at/followers/jakob"]},"signature":{"type":"RsaSignature2017","nonce":"fe42f1478453c9c5e92efdc8a1b00c7e2dd2ce89501f2437c4438b8add1c8ff7","creator":"https://soc.schuerz.at/profile/jakob#main-key","created":"2022-01-23T20:21:25Z","signatureValue":"iWeNKyfH/d5+f6FDmZIadF4hW7XBliL8w3PQ2QkeKQG7fheqx1MB6825JX+Eaq8C0aNESesTTiDJgy3Xdcw8tgKwAVdji2DNZh7rNbSy57AzXlXOPRDnGJUbXp8gAuW2PJNZx3TTsJ5yM7tKLmHk0PpwsnKbvjFabL5O+htyfRZNVjFAsB9bVym/dBvf4jiTZiLufGDprgsaDVygUi3QrzmwsE41NZtL/MIEtbiC5pROWQvdQBEzeLfMDsnjI4CR+3tnaSlvepipuFxeSFpwl5Ae5+YM6IYRvSDsssjr8kAg1t3XnHUyeBdBdys0A6ryR5t5QuY0ygAHFs+X633JsgHDuCxxHiqNYxFuTs1xO0gmHydFy1iKlEt2rbr9pcX05hSvEFg0bI8HEC5M9GuafpY7sOyLX0jobBUH9CxdHUu0qri4ntORlvvAYsGFNHj+folFlMRBNMkcZ+MbrAxdoXBdjhsAp+tD6nje+PeZy63yJJQmPLQi9E+fHGGe0DAobGrBE/XF8X1ABH+ywyKwVu0t6lkSxu+zdr9+JXKgnf7HaFSsknapumw9aQwC7N/Q0M5KO41fF0R4VL2GtoppyB9Ck9Dg1zwMWjL2KZN3ckbWABb+frWtmKIVQACzupRWzHiHSZjRRNJalK3uugVisHF2PFGkjYoUjHDCNegKHO0="}}
lemmy_1     | 2022-01-23T20:21:26.191104Z  WARN Error encountered while processing the incoming HTTP request: lemmy_server::root_span_builder: data did not match any variant of untagged enum SharedInboxActivities at line 1 column 4107
lemmy_1     |    0: lemmy_apub::http::shared_inbox
lemmy_1     |              at crates/apub/src/http/mod.rs:40
lemmy_1     |    1: lemmy_server::root_span_builder::HTTP request
lemmy_1     |            with http.method=POST http.scheme="http" http.host=lemmy.schuerz.at http.target=/inbox otel.kind="server" request_id=0d4a8d70-5c5a-46d3-8866-4ea6ee988123 http.status_code=400 otel.status_code="OK"
lemmy_1     |              at src/root_span_builder.rs:16
lemmy_1     |    2: tokio::task::runtime.spawn
lemmy_1     |            with kind=local task.name= loc.file="/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
lemmy_1     |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
lemmy_1     |    3: tokio::task::runtime.spawn
lemmy_1     |            with kind=local task.name= loc.file="/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
lemmy_1     |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
lemmy_1     |    4: tokio::task::runtime.spawn
lemmy_1     |            with kind=local task.name= loc.file="/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
lemmy_1     |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
lemmy_1     |    5: tokio::task::runtime.spawn
lemmy_1     |            with kind=local task.name= loc.file="/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22
lemmy_1     |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
lemmy_1     |    6: tokio::task::runtime.spawn
lemmy_1     |            with kind=block_on task.name= loc.file="/root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/task/local.rs" loc.line=466 loc.col=12
lemmy_1     |              at /root/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/util/trace.rs:16
lemmy_1     | LemmyError { message: None, inner: data did not match any variant of untagged enum SharedInboxActivities at line 1 column 4107, context: "SpanTrace" }


@xundeenergie
Copy link
Author

@annando ping

@annando
Copy link

annando commented Jan 29, 2022

@xundeenergie it seems as if we send something unexpected. But from my side the activity really looks fine:

Array
(
    [@context] => Array
        (
            [0] => https://www.w3.org/ns/activitystreams
            [1] => https://w3id.org/security/v1
            [2] => Array
                (
                    [vcard] => http://www.w3.org/2006/vcard/ns#
                    [dfrn] => http://purl.org/macgirvin/dfrn/1.0/
                    [diaspora] => https://diasporafoundation.org/ns/
                    [litepub] => http://litepub.social/ns#
                    [toot] => http://joinmastodon.org/ns#
                    [schema] => http://schema.org#
                    [manuallyApprovesFollowers] => as:manuallyApprovesFollowers
                    [sensitive] => as:sensitive
                    [Hashtag] => as:Hashtag
                    [directMessage] => litepub:directMessage
                    [discoverable] => toot:discoverable
                    [PropertyValue] => schema:PropertyValue
                    [value] => schema:value
                )

        )

    [id] => https://soc.schuerz.at/objects/4edd2508-4361-edb8-c4d8-b45181083984/Create
    [type] => Create
    [actor] => https://soc.schuerz.at/profile/jakob
    [published] => 2022-01-23T20:21:24Z
    [instrument] => Array
        (
            [type] => Service
            [name] => Friendica Siberian Iris 2021.12-rc-1448
            [url] => https://soc.schuerz.at
        )

    [to] => Array
        (
            [0] => https://lemmy.schuerz.at/u/jakob
            [1] => https://www.w3.org/ns/activitystreams#Public
            [2] => https://lemmy.schuerz.at/c/test
        )

    [cc] => Array
        (
            [0] => https://soc.schuerz.at/followers/jakob
        )

    [object] => Array
        (
            [id] => https://soc.schuerz.at/objects/4edd2508-4361-edb8-c4d8-b45181083984
            [type] => Note
            [summary] => 
            [inReplyTo] => https://lemmy.schuerz.at/post/25360
            [diaspora:guid] => 4edd2508-4361-edb8-c4d8-b45181083984
            [published] => 2022-01-23T20:21:24Z
            [url] => https://soc.schuerz.at/display/4edd2508-4361-edb8-c4d8-b45181083984
            [attributedTo] => https://soc.schuerz.at/profile/jakob
            [sensitive] => 
            [context] => https://lemmy.schuerz.at/post/25360#context
            [content] => <span class="h-card"><a href="https://lemmy.schuerz.at/u/jakob" class="u-url mention">@<span>jakob</span></a></span> test
            [contentMap] => Array
                (
                    [de] => <bdi>@<a href="https://lemmy.schuerz.at/u/jakob" class="userinfo mention" title="jakob">jakob</a></bdi> test
                )

            [source] => Array
                (
                    [content] => @[url=https://lemmy.schuerz.at/u/jakob]Jakob[/url] test
                    [mediaType] => text/bbcode
                )

            [diaspora:comment] => {"author":"jakob@soc.schuerz.at","guid":"4edd2508-4361-edb8-c4d8-b45181083984","created_at":"2022-01-23T20:21:24Z","edited_at":"2022-01-23T20:21:24Z","parent_guid":"ea620d1e-742c8b4d15249a9b-18b5fca3","text":"@{Jakob; jakob@lemmy.schuerz.at} test","author_signature":"JNCqOui5Cg8/Uxw+f0NtGCRjRnhPOrqE6kGJnMkZvOOKhlCdZbCqvyPlNJzEYDa3Z30mOWQKTTNo5BVI+VVZtGrVEqFOdzNog7jOLQoY1dKU9iEQ9vc8USwUCkyJyv48w1iXpfea87KPwv+03DMlftmD6kC7jdUVwhc7+jm0g4fh06tpOcCMQJOZqTTV/80EjxIJQ+8eEk5evSw/S98ohD1ahcwSomJ9hJUV1H48ucDvMod1FCLcN5h4ALHqubCu4TZIYhGhw9zoCl52GeHhrD3/vL6OW4ftZ7UG4rEKQ4HowuXqmNwydrQldtprRtu2UrZBjLqVusPXEs/xERQqZnalNXHijyd1TwwCmfTV4YjKwH4BhX/p4hdWMqEP4yYXlfA4apalVeAaYZLrNR58kPJjBHad/yqH30ziBFheqZ5odFh/jnKB4OCFVST3u9b1OKE0jyTrbTepPTaONwc8giQH1sM8koj1gFdulwuJuOTRUKR/8ishgHi5SWwbp5YG5Z3YSINkF10IcLiFZAF300AvwgOCdf7ferim4i/7TR1D2CBpoNUZnKCKZRymZbE0GuKEE+A6Pk3lk/DCsDtmMXpnxlPZ8Nq8OZS/olXevAu1y57MNnxBDXtojr4F54MP2fO7E2JwBr7AlwoeSEvtZSAO/elzrKfW0eVWOUM2OnI="}
            [attachment] => Array
                (
                )

            [tag] => Array
                (
                    [0] => Array
                        (
                            [type] => Mention
                            [href] => https://lemmy.schuerz.at/u/jakob
                            [name] => @jakob@lemmy.schuerz.at
                        )

                )

            [to] => Array
                (
                    [0] => https://lemmy.schuerz.at/u/jakob
                    [1] => https://www.w3.org/ns/activitystreams#Public
                    [2] => https://lemmy.schuerz.at/c/test
                )

            [cc] => Array
                (
                    [0] => https://soc.schuerz.at/followers/jakob
                )

        )

    [signature] => Array
        (
            [type] => RsaSignature2017
            [nonce] => fe42f1478453c9c5e92efdc8a1b00c7e2dd2ce89501f2437c4438b8add1c8ff7
            [creator] => https://soc.schuerz.at/profile/jakob#main-key
            [created] => 2022-01-23T20:21:25Z
            [signatureValue] => iWeNKyfH/d5+f6FDmZIadF4hW7XBliL8w3PQ2QkeKQG7fheqx1MB6825JX+Eaq8C0aNESesTTiDJgy3Xdcw8tgKwAVdji2DNZh7rNbSy57AzXlXOPRDnGJUbXp8gAuW2PJNZx3TTsJ5yM7tKLmHk0PpwsnKbvjFabL5O+htyfRZNVjFAsB9bVym/dBvf4jiTZiLufGDprgsaDVygUi3QrzmwsE41NZtL/MIEtbiC5pROWQvdQBEzeLfMDsnjI4CR+3tnaSlvepipuFxeSFpwl5Ae5+YM6IYRvSDsssjr8kAg1t3XnHUyeBdBdys0A6ryR5t5QuY0ygAHFs+X633JsgHDuCxxHiqNYxFuTs1xO0gmHydFy1iKlEt2rbr9pcX05hSvEFg0bI8HEC5M9GuafpY7sOyLX0jobBUH9CxdHUu0qri4ntORlvvAYsGFNHj+folFlMRBNMkcZ+MbrAxdoXBdjhsAp+tD6nje+PeZy63yJJQmPLQi9E+fHGGe0DAobGrBE/XF8X1ABH+ywyKwVu0t6lkSxu+zdr9+JXKgnf7HaFSsknapumw9aQwC7N/Q0M5KO41fF0R4VL2GtoppyB9Ck9Dg1zwMWjL2KZN3ckbWABb+frWtmKIVQACzupRWzHiHSZjRRNJalK3uugVisHF2PFGkjYoUjHDCNegKHO0=
        )

)

@Nutomic
Copy link
Member

Nutomic commented Feb 7, 2022

@xundeenergie You need to wait for the next Lemmy release, or build the latest dev branch from source.

@Nutomic Nutomic added the area: federation support federation via activitypub label Feb 10, 2022
@Nutomic Nutomic closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: federation support federation via activitypub bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants