msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Planner Plan creation succeeds (Plan created) but Library throws an Exception

Open OliverUlm opened this issue 7 years ago • 3 comments

Since this weekend upon creation of a Planner Plan the library throws an Exception: "You do not have the required permissions to access this item, or the item may not exist." The plan is however created and fully functional.

Please provide the following (and please check them off the list with [x]) before submitting this issue:

  • [x] Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
  • [x] Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
  • [x] Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.

Expected behavior

Plan is created and no exception is thrown. This was the behavior prior to this weekend.

Actual behavior

Plan is created but an exception is thrown.

You do not have the required permissions to access this item, or the item may not exist.


   at Microsoft.Graph.HttpProvider.<SendAsync>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Graph.BaseRequest.<SendAsync>d__31`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()

Steps to reproduce the behavior

.Net Framework 4.7 Visual Studio 2017 Microsoft.Graph 1.15.0

var svcUser = await graphClient.Users[usr].Request().GetAsync();

var groupReq = graphClient.Groups.Request();
Group newGrp = await groupReq.AddAsync(new Group()
{
  DisplayName = planName,
  MailEnabled = false,
  MailNickname = planName.Replace(' ', '_'),
  SecurityEnabled = true,
  GroupTypes = new List<string>() { "Unified" }
});

await graphClient.Groups[newGrp.Id].Members.References.Request().AddAsync(svcUser);
await graphClient.Groups[newGrp.Id].Members.References.Request().AddAsync(user);

PlannerPlan newPlan = await graphClient.Planner.Plans.Request().AddAsync(new PlannerPlan() { Title = planName, Owner = newGrp.Id });```

OliverUlm avatar Jul 01 '19 09:07 OliverUlm

Are you still experiencing this issue? Was it working as expected before and for how long? What was the exception?

MIchaelMainer avatar Jul 09 '19 21:07 MIchaelMainer

It had been working for 1 week befor the issues started. 3 days later it started working again. I therefore assume that it was an issue with the underlaying Graph API and not the library. Sorry, I don't remember the type of exception that has been thrown during that timeframe - this was the exception message:

You do not have the required permissions to access this item, or the item may not exist.

OliverUlm avatar Jul 10 '19 05:07 OliverUlm

Got it. Okay, sounds like a transient error. Please reopen if this is not the case.

MIchaelMainer avatar Jul 10 '19 17:07 MIchaelMainer