{"record":{"id":"2d110e3373086b3e","repo":"LemmyNet/lemmy","slug":"activity-is-not-in-community","errorCode":null,"errorMessage":"activity is not in community","messagePattern":"activity is not in community","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/apub/activities/src/protocol/block/block_user.rs","lineNumber":48,"sourceCode":"  pub(crate) target: ObjectId<SiteOrCommunity>,\n  #[serde(rename = \"type\")]\n  pub(crate) kind: BlockType,\n  pub(crate) id: Url,\n\n  /// Quick and dirty solution.\n  /// TODO: send a separate Delete activity instead\n  pub(crate) remove_data: Option<bool>,\n  /// block reason, written to mod log\n  pub(crate) summary: Option<String>,\n  pub(crate) end_time: Option<DateTime<Utc>>,\n  pub(crate) audience: Option<ObjectId<ApubCommunity>>,\n}\n\nimpl InCommunity for BlockUser {\n  async fn community(&self, context: &Data<LemmyContext>) -> LemmyResult<ApubCommunity> {\n    let target = self.target.dereference(context).await?;\n    let SiteOrCommunity::Right(community) = target else {\n      return Err(anyhow!(\"activity is not in community\").into());\n    };\n    if let Some(audience) = &self.audience {\n      verify_urls_match(audience.inner(), community.ap_id.inner())?;\n    }\n    Ok(community)\n  }\n}\n\nimpl Id for BlockUser {\n  fn id(&self) -> &Url {\n    &self.id\n  }\n}\n","sourceCodeStart":30,"sourceCodeEnd":62,"githubUrl":"https://github.com/LemmyNet/lemmy/blob/439734dd638a2c06a2f907beab7dcf4646e88f86/crates/apub/activities/src/protocol/block/block_user.rs#L30-L62","documentation":"Protocol validation error in BlockUser::community: the block activity's `target` could not be dereferenced to / resolved as the community the activity claims to apply to, i.e. the activity is not addressed to (in) a community. It fires when a received Block activity's target does not resolve to a valid ApubCommunity; the input at fault is the activity's target field.","triggerScenarios":"Thrown at crates/apub/activities/src/protocol/block/block_user.rs:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reject or drop the malformed Block activity; senders must target a community object.","Verify the sending server addresses block activities with a valid community `target`/audience.","Check that the target community exists locally or can be dereferenced via ActivityPub."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"439734dd638a2c06a2f907beab7dcf4646e88f86","analyzedAt":"2026-09-06T11:28:35.035Z","contentChangedAt":"2026-09-06T11:28:35.035Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}