Duplicate key value violates unique constraint "objects_unique_apid_index"
Environment
- Installation type: From source
- Pleroma version: 2.0.50-1802-gc2a052a3-v-develop
- Elixir version: Elixir 1.9.4 (compiled with Erlang/OTP 22)
- Operating system: NixOS 10.03
- PostgreSQL version: 12.2
Bug description
Honestly, i don’t know which description fits here, so here's just what i was able to dig up:
Jul 04 18:49:05 swift pl[28751]: 18:49:05.484 [error] Error while fetching https://moon.holiday/users/red/statuses/104456602451412368: {:error, {:transmogrifier, {:error, {:error, #Ecto.Changeset<action: :insert, changes: %{data: %{"@context" => ["https://www.w3.org/ns/activitystreams", %{"atomUri" => "ostatus:atomU>
Jul 04 18:49:05 swift Pg[20168]: [9-3] 2020-07-04 16:49:05.438 GMT [20168] STATEMENT: INSERT INTO "objects" ("data","inserted_at","updated_at") VALUES ($1,$2,$3) RETURNING "id"
Jul 04 18:49:05 swift Pg[20168]: [9-2] 2020-07-04 16:49:05.438 GMT [20168] DETAIL: Key ((data ->> 'id'::text))=(https://moon.holiday/users/red/statuses/104456602451412368) already exists.
Jul 04 18:49:05 swift Pg[20168]: [9-1] 2020-07-04 16:49:05.438 GMT [20168] ERROR: duplicate key value violates unique constraint "objects_unique_apid_index"
18:49:05.484 [error] Error while fetching https://moon.holiday/users/red/statuses/104456602451412368: {:error, {:transmogrifier, {:error, {:error,
#Ecto.Changeset<action: :insert, changes: %{
data: %{"@context" => ["https://www.w3.org/ns/activitystreams", %{
"atomUri" => "ostatus:atomUri", "conversation" => "ostatus:conversation", "inReplyToAtomUri" => "ostatus:inReplyToAtomUri",
"ostatus" => "http://ostatus.org#", "sensitive" => "as:sensitive", "toot" => "http://joinmastodon.org/ns#",
"votersCount" => "toot:votersCount"}], "actor" => "https://moon.holiday/users/red",
"atomUri" => "https://moon.holiday/users/red/statuses/104456602451412368", "attachment" => [],
"attributedTo" => "https://moon.holiday/users/red", "bcc" => [], "bto" => [],
"cc" => ["https://www.w3.org/ns/activitystreams#Public", "https://fedi.underscore.world/users/Dee", "https://mastodon.technology/users/trickster"],
"content" => "
<p><span class=\"h-card\"><a href=\"https://fedi.underscore.world/users/Dee\" class=\"u-url mention\">@<span>Dee</span></a></span>
<span class=\"h-card\"><a href=\"https://mastodon.technology/@trickster\" class=\"u-url mention\">@<span>trickster</span></a></span>
off-topic but can i say duckduckwent is an outstanding word</p>",
"contentMap" => %{"en" => "
<p><span class=\"h-card\"><a href=\"https://fedi.underscore.world/users/Dee\" class=\"u-url mention\">@<span>Dee</span></a></span>
<span class=\"h-card\"><a href=\"https://mastodon.technology/@trickster\" class=\"u-url mention\">@<span>trickster</span></a></span>
off-topic but can i say duckduckwent is an outstanding word</p>"},
"context" => "tag:mastodon.technology,2020-07-04:objectId=35125242:objectType=Conversation",
"context_id" => 264049, "emoji" => %{}, "id" => "https://moon.holiday/users/red/statuses/104456602451412368",
"inReplyTo" => "https://fedi.underscore.world/objects/ea0c7fec-4ada-49bf-825e-1abc19f11cd4",
"inReplyToAtomUri" => "https://fedi.underscore.world/objects/ea0c7fec-4ada-49bf-825e-1abc19f11cd4",
"published" => "2020-07-04T16:47:43Z",
"replies" => %{"first" => %{"items" => [],
"next" => "https://moon.holiday/users/red/statuses/104456602451412368/replies?only_other_accounts=true&page=true",
"partOf" => "https://moon.holiday/users/red/statuses/104456602451412368/replies", "type" => "CollectionPage"},
"id" => "https://moon.holiday/users/red/statuses/104456602451412368/replies", "type" => "Collection"},
"sensitive" => false, "summary" => "",
"tag" => [%{"href" => "https://fedi.underscore.world/users/Dee", "name" => "@Dee@fedi.underscore.world", "type" => "Mention"},
%{"href" => "https://mastodon.technology/users/trickster", "name" => "@trickster@mastodon.technology", "type" => "Mention"}],
"to" => ["https://moon.holiday/users/red/followers"], "type" => "Note", "url" => "https://moon.holiday/@red/104456602451412368"}},
errors: [ap_id: {"has already been taken", [constraint: :unique, constraint_name: "objects_unique_apid_index"]}], data: #Pleroma.Object<>, valid?: false>}}}}
pleroma=> select * from objects where data->>'id' = 'https://moon.holiday/users/red/statuses/104456602451412368';
-[ RECORD 1 ]---------------------------------------------------------------------------------------------------
id | 264052
data | {
"cc": ["https://www.w3.org/ns/activitystreams#Public", "https://fedi.underscore.world/users/Dee", "https://mastodon.technology/users/trickster"],
"id": "https://moon.holiday/users/red/statuses/104456602451412368",
"to": ["https://moon.holiday/users/red/followers"], "bcc": [], "bto": [],
"tag": [{"href": "https://fedi.underscore.world/users/Dee", "name": "@Dee@fedi.underscore.world", "type": "Mention"},
{"href": "https://mastodon.technology/users/trickster", "name": "@trickster@mastodon.technology", "type": "Mention"}],
"url": "https://moon.holiday/@red/104456602451412368", "type": "Note",
"actor": "https://moon.holiday/users/red", "emoji": {}, "likes": ["https://catgirl.science/users/alexandria"],
"atomUri": "https://moon.holiday/users/red/statuses/104456602451412368",
"content": "
<p><span class=\"h-card\"><a href=\"https://fedi.underscore.world/users/Dee\" class=\"u-url mention\">@<span>Dee</span></a></span>
<span class=\"h-card\"><a href=\"https://mastodon.technology/@trickster\" class=\"u-url mention\">@<span>trickster</span></a></span>
off-topic but can i say duckduckwent is an outstanding word</p>",
"context": "tag:mastodon.technology,2020-07-04:objectId=35125242:objectType=Conversation",
"replies": {"id": "https://moon.holiday/users/red/statuses/104456602451412368/replies", "type": "Collection",
"first": {"next": "https://moon.holiday/users/red/statuses/104456602451412368/replies?only_other_accounts=true&page=true",
"type": "CollectionPage", "items": [], "partOf": "https://moon.holiday/users/red/statuses/104456602451412368/replies"}},
"summary": "", "@context": ["https://www.w3.org/ns/activitystreams",
{"toot": "http://joinmastodon.org/ns#", "atomUri": "ostatus:atomUri", "ostatus": "http://ostatus.org#", "sensitive": "as:sensitive",
"votersCount": "toot:votersCount", "conversation": "ostatus:conversation", "inReplyToAtomUri": "ostatus:inReplyToAtomUri"}],
"inReplyTo": "https://fedi.underscore.world/objects/ea0c7fec-4ada-49bf-825e-1abc19f11cd4",
"published": "2020-07-04T16:47:43Z", "sensitive": false, "attachment": [],
"contentMap": {"en": "<p><span class=\"h-card\"><a href=\"https://fedi.underscore.world/users/Dee\" class=\"u-url mention\">@<span>Dee</span></a></span>
<span class=\"h-card\"><a href=\"https://mastodon.technology/@trickster\" class=\"u-url mention\">@<span>trickster</span></a></span>
off-topic but can i say duckduckwent is an outstanding word</p>"},
"context_id": 264049, "like_count": 1, "attributedTo": "https://moon.holiday/users/red",
"announcements": ["https://catgirl.science/users/alexandria"],
"inReplyToAtomUri": "https://fedi.underscore.world/objects/ea0c7fec-4ada-49bf-825e-1abc19f11cd4", "announcement_count": 1}
inserted_at | 2020-07-04 16:49:05
updated_at | 2020-07-04 16:49:05
Edited by bird