-
|
We’re intermittently seeing 404 Not Found responses when EnsureFolderAsync internally calls GetFolderByServerRelativeUrl. Immediately after, the operation continues and fails with a 400 stating the folder already exists. This behavior is not consistent and is difficult to reliably reproduce. Observed sequence (from logs): 1- GetFolderByServerRelativeUrl → 404 public async Task<string?> EnsureFolderAsync(string siteUrl, string listTitle, string folderPath)
{
using PnPContext pnpContext = await _pnpContextFactory.CreateAsync(siteUrl);
// Get a root folder via a list
IList list = await GetList(pnpContext, listTitle);
IFolder? folder = await list.RootFolder.EnsureFolderAsync(folderPath);
return folder?.ServerRelativeUrl;
}Is this a known issue with EnsureFolderAsync and/or GetFolderByServerRelativeUrl under certain conditions? PnP Core SDK version: [1.14] NOTE! I didn't report this as an issue since there is no clear instruction for how to reproduce this. I appreciate any help we can get here. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
I'm also seeing this. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for the late reply. pnpcore/src/sdk/PnP.Core/Model/SharePoint/Core/Internal/Folder.cs Lines 407 to 416 in be4b565 It seems like we have a race condition between the GET and the POST like I think the easiest way would be to add to What do you think? May I kindly ask you to just rise up a follow up issue for that and lets try to get this fixed 👍 |
Beta Was this translation helpful? Give feedback.
Sorry for the late reply.
This is some good find and IMO we should totally create an issue for it. From what I quickly checked the problem is most likely here
pnpcore/src/sdk/PnP.Core/Model/SharePoint/Core/Internal/Folder.cs
Lines 407 to 416 in be4b565
It seems like we have a race condition between the GET and the POST like