{"record":{"id":"9cc59404c2f25861","repo":"OrchardCMS/OrchardCore","slug":"could-not-find-content-item","errorCode":null,"errorMessage":"Could not find content item ","messagePattern":"Could not find content item ","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.Lists/RemotePublishing/MetaWeblogHandler.cs","lineNumber":265,"sourceCode":"\n        return array;\n    }\n\n    private async Task<XRpcArray> MetaWeblogGetRecentPosts(\n        XmlRpcContext context,\n        string contentItemId,\n        string userName,\n        string password,\n        int numberOfPosts,\n        IEnumerable<IXmlRpcDriver> drivers)\n    {\n        var user = await ValidateUserAsync(userName, password);\n\n        // User needs to at least have permission to edit its own blog posts to access the service.\n        await CheckAccessAsync(CommonPermissions.EditContent, user, null);\n\n        var list = (await _contentManager.GetAsync(contentItemId))\n            ?? throw new InvalidOperationException(\"Could not find content item \" + contentItemId);\n\n        var array = new XRpcArray();\n\n        var contentItems = await _session.Query<ContentItem>()\n            .With<ContainedPartIndex>(x => x.ListContentItemId == contentItemId)\n            .With<ContentItemIndex>(x => x.Latest)\n            .OrderByDescending(x => x.CreatedUtc)\n            .Take(numberOfPosts)\n            .ListAsync();\n\n        foreach (var contentItem in contentItems)\n        {\n            var postStruct = await CreateBlogStructAsync(context, contentItem);\n\n            foreach (var driver in drivers)\n            {\n                driver.Process(postStruct);\n            }","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Lists/RemotePublishing/MetaWeblogHandler.cs#L247-L283","documentation":"metaWeblog.getRecentPosts requires the contentItemId to reference an existing list (e.g. a Blog). If IContentManager.GetAsync returns null the handler throws 'Could not find content item ' + contentItemId (note the unlocalized string with no closing punctuation).","triggerScenarios":"Calling getRecentPosts with a blogId that does not match any content item ID, or with a deleted/unpublished-removed item.","commonSituations":"Mistyped or stale blog ID in blog client configuration; connecting to the wrong tenant/site; content deleted after the client was configured.","solutions":["Verify the blogId/content item ID in the client config matches an existing Blog content item's ID (copy it from the admin URL)","Check you are connecting to the correct tenant/site URL","Recreate or republish the blog and update the client"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var exists = await contentManager.GetAsync(blogId); if (exists == null) throw new ArgumentException($\"Blog '{blogId}' does not exist on this site\");","typeGuard":"bool IsValidContentItem(ContentItem item) => item != null && !string.IsNullOrEmpty(item.ContentItemId);","tryCatchPattern":"try { posts = await handler.MetaWeblogGetRecentPosts(blogId, ...); } catch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Could not find content item\")) { RefreshBlogConfiguration(); }","preventionTips":["Copy blog IDs directly from the admin content item URL","Re-verify blog IDs after deleting or recreating content","Ensure the client endpoint URL matches the intended tenant","Periodically refresh the client's blog list"],"tags":["xmlrpc","metaweblog","contentitem","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}