-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inactive Custodian Not Adding Correctly #418
Comments
Are there any updates here, graph team? |
Hey @StefanieBier, @JoshuaSchmidt-Epiq. Thanks for raising this. With regards to this error, are you able to share the runtime info of your environment (OS/Dotnet runtime version)? |
I am a little confused by your question as it seems you did not read the entire message as this information is already in there. I am using VB.Net 2019 and my MSGraph library (Standard 2.0) is using the Beta 4.29 version. I have a WinForm program (4.6.2) that references my MSGraph library. All running on Windows 10 19041.1415 The "Only HTTP/1.0..." issue was something that popped up when I updated from SDK v4.29 but this is a minor issue compared with my larger issue related to adding inactive custodians which is the bulk of my message. I need some people from Microsoft to look into this asap as this is part of a large ongoing project that I have been working directly with the AeD API team on for over a year. |
Hey @JoshuaSchmidt-Epiq, Apologies for this. I was hoping to first unblock you while using the latest SDK version to eliminate the possibility of it being an outdated version issue. However, with regards to the issue, are you able to share the code example you are using for this? Is it consistent with the examples provided here? It would also be great if you could share the "client-request-id" from the failed request so that we can see if anything is amiss. |
Understood, Thank you for clarifying.
On a separate note, I noticed a new version of the v4 SDK was released (4.36) and I updated to that and the HTTP error I was previously getting has gone away. The issue with inactive custodians and not being able to add sources still does not work.
Here is a Request ID that had the issue which I just run today.
AdditionalData:
date: 2022-03-30T18:23:57
request-id: 4ac1ef84-4e2b-421e-8fed-2f90f167be28
client-request-id: 4ac1ef84-4e2b-421e-8fed-2f90f167be28
Your logs should show something similar to the following which appears as though I am adding the site source to the Custodians collection not a specific custodian object:
MSGraph.AddCustodianSiteSource : An Error Occured: PNDB_Sync_16//https://epiqsandbox-my.sharepoint.com/personal/MDrone_epiqsandbox_onmicrosoft_com
------------------------------------------------------------------------
MSGraph.AddCustodianSiteSource : Code: UnknownError
Message: {"Message":"No HTTP resource was found that matches the request URI 'https://substrate.office.com:444/complianceworkbench/compliance/ediscovery/cases('5d4c9c87-fbdc-4883-b971-16f14b710815')/custodians('siteSources')'.","MessageDetail":"No type was found that matches the controller named 'cases'."}
However, as you will see in my code, there isn't a call like this, the call is Ediscovery.Cases(aedMatter.ID).Custodians(Custodian.Id).UserSources.Request().AddResponseAsync(userSource) so an ID WOULD be passed by my code.
I also modified my code to show the ID that is passed when these calls fail. The ID that is being used is a valid ID which works though Graph Explorer so it does not appear to be a null or bad ID value being used.
I believe there is an issue within the SDK that when the inactive custodian object is created, that object ID is somehow different or inaccessible within the SDK and therefore the SDK is generating a NULL value for the ID when it actually makes the API call. In my code, I actually verify that an ID has been returned from previous commands BEFORE I attempt to add site sources.
As for the code I actually use:
I have a library with my graph calls and a form which references that library. I am attaching some code from each of these which have the methods in question contained.
The process I use to add custodians is as follows:
Pass 1: I attempt to add a custodian
If this returns successful I move to adding sources
Pass 2: If Pass1 reports an error I try to add the custodian again. Basically I just re-try the call. This was due to some custodians not correctly adding during the first attempt which I believe are due to buffer issues in the Graph API.
If this returns successful I move on to adding sources
Pass 3: If the previous to attempts fail I insert a "." at the start of the email address. This covers custodians which are actually inactive but were not identified as such by my listings. Previously, I believe Microsoft had made a change to check for this situation internally in the SDK/API so it should be caught by the first pass but my code still makes this last attempt.
If this returns successful I move on to adding sources. If this still returns an error, then I assume the custodian can't be added and mark it as such. No further work is done with this custodian.
On a side note, in some situations the SDK will report an error when adding the custodian (usually in pass 1) which would indicate the custodian was NOT created. However, the custodian object is actually created and viewable within the UX. My Pass 2 will usually figure this out and let my process continue. Just an observation for you if it helps.
Form Code:
Private Async Function AddCustodianWorker(ByVal aedMatter As MicrosoftGraph.MSGraph.Compliance.AED_Matter, ByVal CustodianMUDID As String) As Task(Of MicrosoftGraph.MSGraph.Compliance.AED_Custodian)
NewCustodianCounter += 1
UpdateNewCounters()
Dim AEDCustodian As New MicrosoftGraph.MSGraph.Compliance.AED_Custodian
Try
Dim SQLCustodian As SQLiteConnector.MSAED_SQLLite.cSQLCustodian = SQL.GetCustodian_MUDID(aedMatter.ExternalID, CustodianMUDID)
Dim AddedCount As Byte = 0
'--------------------------------------------------
' Create The Custodian Object
'--------------------------------------------------
Do While AddedCount < 2
If AddedCount = 0 AndAlso SQLCustodian.LEAVE_DATE = "" AndAlso SQLCustodian.EMAIL.StartsWith(".") = False Then
'Assuming they are an Active user based on Leave Date and no . in email
TextBox1.Text += "** Adding Custodian 1: " & SQLCustodian.EMAIL & vbCrLf
AEDCustodian = Await MicrosoftGraph.MSGraph.Compliance.AddCustodian(aedMatter, SQLCustodian.EMAIL)
If AEDCustodian Is Nothing OrElse AEDCustodian.Id = "" Then
'If an error occurs, this could be due to a GRAPH issue. Pause the thread for 10 seconds and retry the command
Threading.Thread.Sleep(10000)
TextBox1.Text += "** Adding Custodian 2: " & SQLCustodian.EMAIL & vbCrLf
AEDCustodian = Await MicrosoftGraph.MSGraph.Compliance.AddCustodian(aedMatter, SQLCustodian.EMAIL)
End If
If AEDCustodian Is Nothing OrElse AEDCustodian.Id = "" Then
'We will assume if the custodian has been tried twice and still does not return then the custodian may be inactive but an active email was given.
AddedCount = 1
Else
'The user was successfully added
AEDCustodian.CustodianType = "Active"
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.CustodianType, "Active")
AddedCount = 2
End If
Else
'The account is either Inactive or Failed to add.
'First Check if it failed.
If AddedCount = 1 Then
'Assumed it was an active email but the user is inctive.
'Add a '.' to the start and try again.
TextBox1.Text += "** Adding Custodian 3: " & "." & SQLCustodian.EMAIL & vbCrLf
AEDCustodian = Await MicrosoftGraph.MSGraph.Compliance.AddCustodian(aedMatter, "." & SQLCustodian.EMAIL)
If AEDCustodian IsNot Nothing OrElse AEDCustodian.Id = "" Then
AEDCustodian.CustodianType = "Inactive"
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.CustodianType, "Inactive")
AddedCount = 2
End If
Else
'This should be an inactive user
'The user has a leave date or begins with a '.'
TextBox1.Text += "** Adding Custodian 4: " & SQLCustodian.EMAIL & vbCrLf
AEDCustodian = Await MicrosoftGraph.MSGraph.Compliance.AddCustodian(aedMatter, SQLCustodian.EMAIL)
If AEDCustodian Is Nothing OrElse AEDCustodian.Id = "" Then
AEDCustodian.CustodianType = "Inactive"
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.CustodianType, "Inactive")
AddedCount = 2
End If
End If
End If
Loop
If AEDCustodian IsNot Nothing OrElse AEDCustodian.Id <> "" Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Created")
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.MS_ID, AEDCustodian.Id)
'Custodian object was created
'Add the Data Sources to the custodian object
'We will ALWAYS Add the Mailbox and TRY to add OneDrive
'Add Active Custodian DataSources
If AEDCustodian.CustodianType = "Active" Then
'Then Get the OneDrive URL from Active Directory
Dim AD_OD_URL As String = Await MicrosoftGraph.MSGraph.Compliance.GetCustodianOneDriveURL(SQLCustodian.EMAIL)
If AD_OD_URL <> "" Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.AD_OneDrive, AD_OD_URL)
End If
Dim IncludedSources As MicrosoftGraph.MSGraph.Compliance.SourceType = 0
If AD_OD_URL = "" Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.EmailStatus, "Requested")
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Not Requested")
IncludedSources = Await MicrosoftGraph.MSGraph.Compliance.AddCustodianIncludeSource(aedMatter, AEDCustodian, "")
Else
'OneDrive was provided OR found in AD
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.EmailStatus, "Requested")
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Requested")
IncludedSources = Await MicrosoftGraph.MSGraph.Compliance.AddCustodianIncludeSource(aedMatter, AEDCustodian, "True")
End If
If IncludedSources = 0 Then
'There was a problem adding the sources
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Error")
Else
'Sources Added Correctly
If (IncludedSources And 1) = 1 Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.EmailStatus, "Added")
End If
If (IncludedSources And 2) = 2 Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Added")
End If
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Added")
End If
Else 'Add Inactive Custodian Datasources
Dim MailboxAdded As Boolean = False
Dim SiteGiven As Boolean = False
Dim SiteAdded As Boolean = False
Dim IncludedSources As MicrosoftGraph.MSGraph.Compliance.SourceType = 0
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.EmailStatus, "Requested")
IncludedSources = Await MicrosoftGraph.MSGraph.Compliance.AddCustodianIncludeSource(aedMatter, AEDCustodian, "")
If IncludedSources = 0 Then
'There was a problem adding the sources
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Error")
MailboxAdded = False
Else
'Sources Added Correctly
If (IncludedSources And 1) = 1 Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.EmailStatus, "Added")
End If
MailboxAdded = True
End If
If SQLCustodian.ONEDRIVE = "" Then
'No OneDrive Site is given so lets try to guess it.
Dim UserName As String = SQLCustodian.EMAIL.Substring(0, SQLCustodian.EMAIL.IndexOf("@"))
If UserName.StartsWith(".") Then
UserName = UserName.Substring(1)
End If
Dim TryOneDrivePath As String = pOneDrivePathTemplate
TryOneDrivePath = TryOneDrivePath.Replace("####", UserName)
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Guessed")
Dim RetVal = Await MicrosoftGraph.MSGraph.Compliance.AddCustodianSiteSource(aedMatter, AEDCustodian, TryOneDrivePath)
If RetVal = TryOneDrivePath Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Added")
SiteAdded = True
Else
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Guessed Not Found")
SiteAdded = False
End If
Else
SiteGiven = True
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Requested")
Dim RetVal = Await MicrosoftGraph.MSGraph.Compliance.AddCustodianSiteSource(aedMatter, AEDCustodian, SQLCustodian.ONEDRIVE)
If RetVal = SQLCustodian.ONEDRIVE Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Added")
SiteAdded = True
Else
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.OneDriveStatus, "Error")
SiteAdded = False
End If
End If
If SiteGiven = True Then
If SiteAdded = True AndAlso SiteAdded = True Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Added")
Else
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Error")
End If
Else
If SiteAdded = True Then
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Added")
Else
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Sources Error")
End If
End If
End If
Else
'The Custodian object was not created so lets return an empty aedCustodian object
SQL.UpdateCustodianFieldByMUD(SQLCustodian.Matter_ID, SQLCustodian.MUD_ID, SQLiteConnector.MSAED_SQLLite.CustodianFields.ImportStatus, "Error")
AEDCustodian = Nothing
End If
Catch ex As Exception
Debug.WriteLine("2:" & ex.Message)
Finally
End Try
Return AEDCustodian
End Function
Graph Module Code:
Public Shared Async Function AddCustodian(ByVal aedMatter As Compliance.AED_Matter, ByVal eMail As String) As Task(Of Compliance.AED_Custodian)
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodian", "Start: " & aedMatter.DisplayName & "/" & eMail)
Dim correlationId As String = ""
'Create a Custodian Object
Dim Custodian As Ediscovery.Custodian
Dim RetCustodian As New Compliance.AED_Custodian
Dim CustodianExists As Boolean = False
Try
Custodian = (From x In Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians().Request().GetAsync Where x.Email.Equals(eMail, StringComparison.InvariantCultureIgnoreCase) Select x).FirstOrDefault()
If Custodian Is Nothing Then
Custodian = New Ediscovery.Custodian() With
{
.Email = eMail,
.ApplyHoldToSources = False
}
Dim Response = Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians.Request().AddResponseAsync(Custodian)
Custodian = Await Response.GetResponseObjectAsync()
correlationId = Response.HttpHeaders.GetValues("client-request-id").FirstOrDefault()
RetCustodian = Make_aedCustodian(Custodian)
RaiseEvent RaiseLogEvent(LoggingLevel.Debug, "AddCustodian", "Custodian Created: " & aedMatter.DisplayName & "/" & eMail & " : correlationId=" & correlationId)
Else
RetCustodian = Make_aedCustodian(Custodian)
RaiseEvent RaiseLogEvent(LoggingLevel.Warning, "AddCustodian", "Custodian Already Exists: " & aedMatter.DisplayName & "/" & eMail & " : correlationId=" & correlationId)
End If
Catch ex As Exception
If ex.Message.Contains("Exception Conflict has occured") Then
CustodianExists = True
End If
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodian", "An Error Occured: " & aedMatter.DisplayName & "/" & eMail & " : correlationId=" & correlationId)
If ex.InnerException Is Nothing Then
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodian", ex.Message)
Else
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodian", ex.Message & " IM:" & ex.InnerException.Message)
End If
End Try
If CustodianExists = True Then
Try
Custodian = (From x In Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians().Request().GetAsync Where x.Email.Equals(eMail, StringComparison.InvariantCultureIgnoreCase) Select x).FirstOrDefault()
If Custodian Is Nothing Then
Else
RetCustodian = Make_aedCustodian(Custodian)
End If
Catch ex As Exception
RetCustodian = Nothing
End Try
End If
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodian", "End: " & aedMatter.DisplayName & "/" & eMail)
Return RetCustodian
End Function
Public Shared Async Function AddCustodianIncludeSource(ByVal aedMatter As Compliance.AED_Matter, ByVal Custodian As Compliance.AED_Custodian, ByVal OneDriveURL As String) As Task(Of Compliance.SourceType)
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodianIncludeSource", "Start: " & aedMatter.DisplayName & "/" & Custodian.Email)
Dim correlationId As String = ""
Dim RetVal As Compliance.SourceType = 0
Dim IncludedSources As Compliance.SourceType
Dim SourceExists As Boolean = False
Try
If Custodian.CustodianType = "Active" And OneDriveURL <> "" Then
IncludedSources = Compliance.SourceType.Mailbox + Compliance.SourceType.Site
ElseIf Custodian.CustodianType = "Active" And OneDriveURL = "" Then
IncludedSources = Compliance.SourceType.Mailbox
Else
End If
'Create a UserSource Object
Dim userSource As Ediscovery.UserSource = New Ediscovery.UserSource() With
{
.Email = Custodian.Email,
.IncludedSources = IncludedSources
}
Dim Response = Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians(Custodian.Id).UserSources.Request().AddResponseAsync(userSource)
userSource = Await Response.GetResponseObjectAsync()
correlationId = Response.HttpHeaders.GetValues("client-request-id").FirstOrDefault()
If userSource.IncludedSources = IncludedSources Then
RetVal = IncludedSources
Else
RetVal = IncludedSources
'False
End If
RaiseEvent RaiseLogEvent(LoggingLevel.Informational, "AddCustodianIncludeSource", "User Source Added: " & aedMatter.DisplayName & "/" & Custodian.Email & " : correlationId=" & correlationId)
Catch ex As Exception
If ex.Message.Contains("ResourceAlreadyExists") Then
SourceExists = True
End If
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianIncludeSource", "An Error Occured: " & aedMatter.DisplayName & "/" & Custodian.Email & " : correlationId=" & correlationId)
If ex.InnerException Is Nothing Then
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianIncludeSource", ex.Message & " : correlationId=" & correlationId)
Else
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianIncludeSource", ex.Message & " IM:" & ex.InnerException.Message & " : correlationId=" & correlationId)
End If
End Try
If SourceExists = True Then
Try
Dim RetCustodian = (From x In Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians(Custodian.Id).UserSources.Request().GetAsync Where x.Email.Equals(Custodian.Email, StringComparison.InvariantCultureIgnoreCase) Select x).FirstOrDefault()
RetVal = RetCustodian.IncludedSources
Catch ex As Exception
RetVal = Nothing
End Try
End If
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodianIncludeSource", "End: " & aedMatter.DisplayName & "/" & Custodian.Email)
Return RetVal
End Function
Public Shared Async Function AddCustodianSiteSource(ByVal aedMatter As Compliance.AED_Matter, ByVal Custodian As Compliance.AED_Custodian, ByVal SiteURL As String) As Task(Of String)
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodianSiteSource", "Start: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL)
Dim correlationId As String = ""
Dim RetVal As String = ""
Dim siteSource As New Ediscovery.SiteSource With
{
.AdditionalData = GetSiteAdditionalData(SiteURL)
}
Try
RaiseEvent RaiseLogEvent(LoggingLevel.Debug, "AddCustodianSiteSource", "Adding Custodian Site Source: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL)
Dim Response = Await GraphServiceClient.Compliance.Ediscovery.Cases(aedMatter.ID).Custodians(Custodian.Id).SiteSources.Request().AddResponseAsync(siteSource)
Dim SSource As Ediscovery.SiteSource = Await Response.GetResponseObjectAsync()
correlationId = Response.HttpHeaders.GetValues("client-request-id").FirstOrDefault()
If SSource.Id <> "" AndAlso SSource.Site IsNot Nothing Then
RetVal = SSource.Site.WebUrl
RaiseEvent RaiseLogEvent(LoggingLevel.Debug, "AddCustodianSiteSource", "Custodian Site Source Added: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL & " : correlationId=" & correlationId)
Else
RetVal = ""
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianSiteSource", "An Error Occured, Empty Site Returned: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL & " : correlationId=" & correlationId)
End If
Catch ex As Exception
If ex.Message.Contains("Invalid site source") Then
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianSiteSource", "An Error Occured - Invalid Site Source: " & aedMatter.DisplayName & "/" & Custodian.Id & "/" & SiteURL)
Else
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianSiteSource", "An Error Occured: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL)
If ex.InnerException Is Nothing Then
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianSiteSource", ex.Message)
Else
RaiseEvent RaiseLogEvent(LoggingLevel.Critical, "AddCustodianSiteSource", ex.Message & " IM:" & ex.InnerException.Message)
End If
End If
End Try
RaiseEvent RaiseLogEvent(LoggingLevel.Trace, "AddCustodianSiteSource", "End: " & aedMatter.DisplayName & "/" & Custodian.Email & "/" & SiteURL)
Return RetVal
End Function
|
Thanks for this @JoshuaSchmidt-Epiq, When I look up the request Id, the logs show that 404 response is returned. |
Hey @mahage-msft, Any chance you could help figure out what could be going wrong with this request? The client error received seems to be inconsistent with the graph logs.
|
@andrueastman MaHa's team has already triaged. |
@SeunginLyu - Can you follow up on this? |
Previously we did below experiments to find that C# SDK and graph explorer both are working fine for our Apis for adding sitesources to custodian. We suspect it is VB.net SDK generation issue. Can you check if your SDK version is greater than or equal to our SDK experiment version. Also if you can use C# SDK and see if it works. Experiments:
Graph SDK Nuget Version: 4.32.0-preview var siteSource = new SiteSource GraphServiceClient.Compliance.Ediscovery public class Utils |
I am currently using 4.36 and still having the issue.
I believe this is expected behavior, but I have noticed the Custodian ID for all active users is an alphanumeric sequence, but the inactive custodians appear to just be numeric only. This appears to be true when adding the inactive custodians through either the SDK or UX. I point it out only as it may pertain to some sort of validation checking that may be occurring in the SDK perhaps?
Joshua Schmidt
Epiq | Forensic Senior Consultant
Office: +1 213 892 9000
Mobile: +1 530 209 6979
***@***.******@***.***>
…________________________________
From: Seungin Lyu ***@***.***>
Sent: Thursday, March 31, 2022 1:43 PM
To: microsoftgraph/msgraph-beta-sdk-dotnet ***@***.***>
Cc: Schmidt, Joshua ***@***.***>; Mention ***@***.***>
Subject: Re: [microsoftgraph/msgraph-beta-sdk-dotnet] Inactive Custodian Not Adding Correctly (Issue #418)
CAUTION: This email originated from outside of Epiq. Do not click links or open attachments unless you recognize the sender and know the content is safe. Report phishing by using the "Phish Alert Report" button above.
Previously we did below experiments to find that C# SDK and graph explorer both are working fine for our Apis for adding sitesources to custodian.
We suspect it is VB.net SDK generation issue. Can you check if your SDK version is greater than or equal to our SDK experiment version.
Also if you can use C# SDK and see if it works.
Experiments:
1. We tried from graph explorer for test tenant in same region and it is working. Public Documentation https://docs.microsoft.com/en-us/graph/api/ediscovery-custodian-post-sitesources?view=graph-rest-beta&tabs=http<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fediscovery-custodian-post-sitesources%3Fview%3Dgraph-rest-beta%26tabs%3Dhttp&data=04%7C01%7CJSchmidt%40epiqglobal.com%7Cdd96572af78a4640f53108da13571953%7C2a9f86a929e744bd8863849373d53db8%7C0%7C0%7C637843562077294927%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=d1mY9vjJnrBOMN7KEmuEhVaB7IXWIG%2FrE5QbFgbp0uw%3D&reserved=0>
2. We tried to add siteSource in custodian using below C# code and it is working.
Graph SDK Nuget Version: 4.32.0-preview
Newtonsoft.Json: 13.0.1
Azure.Identity: 14.0
var siteSource = new SiteSource
{
AdditionalData = Utils.GetSiteAdditionalData(siteUrl),
};
GraphServiceClient.Compliance.Ediscovery
.Cases[eCase.Id]
.Custodians[custodian.Id]
.SiteSources.Request()
.AddAsync(siteSource).Result;
public class Utils
{
public static Dictionary<string, object> GetSiteAdditionalData(string siteUrl)
{
Dictionary<string, object> additionalData = new Dictionary<string, object>();
additionalData.Add("site", new { webUrl = $"{siteUrl}" });
return additionalData;
}
}
—
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.luolix.top%2Fmicrosoftgraph%2Fmsgraph-beta-sdk-dotnet%2Fissues%2F418%23issuecomment-1085087877&data=04%7C01%7CJSchmidt%40epiqglobal.com%7Cdd96572af78a4640f53108da13571953%7C2a9f86a929e744bd8863849373d53db8%7C0%7C0%7C637843562077294927%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=JyIgg7%2BkHDgo4GZYDQ%2BDpG3K4GkdHm0CXDH9EIBS3JI%3D&reserved=0>, or unsubscribe<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.luolix.top%2Fnotifications%2Funsubscribe-auth%2FATM5O2WVRKQHYSVW6EOYU6TVCYE6XANCNFSM5RSDP5XQ&data=04%7C01%7CJSchmidt%40epiqglobal.com%7Cdd96572af78a4640f53108da13571953%7C2a9f86a929e744bd8863849373d53db8%7C0%7C0%7C637843562077294927%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=kMtPashfB%2B09XbMjNRHjgNZd8UAibVNrkqLvXS5wXm4%3D&reserved=0>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The SDK doesn't perform this validation. But builds the requests based on input parameters and makes the call to the API.
@SeunginLyu Any chance you are able to look up the requestId provided by @JoshuaSchmidt-Epiq from your end to confirm that the error is indeed a 404 and not an incorrect URI being built as the error returned to the client suggests? |
Regarding this 404, Advanced eDiscovery logs are indicating that the site source |
Summarizing the discussion & issues so far :
|
@JoshuaSchmidt-Epiq, meanwhile I see v.4.37 has just been released, could you update the SDK to this version and try again? SDK v4.37: NuGet Gallery | Microsoft.Graph.Beta 4.37.0-preview |
@JoshuaSchmidt-Epiq version 4.40 was released 2 days ago. Can you validate? Also, there is a new version of the SDK out, 5.x. You can check more for information and how to upgrade here. @SeunginLyu any updates? |
Per my last conversation with @SeunginLyu , the eDiscovery team has fixed this. Closing this. |
I have been working with Microsoft on the AeD APIs for over a year. Originally the API required placing a "." before an email address to signify it was an inactive user. A change was made in the API to check passed email addresses so the "." was no longer required. This worked and I have been able to add inactive custodians without issue. About a month or two ago, inactive custodians began experiencing issues. In some situations the custodian would be added as an Active user where other times the same user (different AeD case) would be added as Inactive. In either case once the custodian is created, I am no longer able to add data sources to the custodian.
A couple weeks ago the AeD API was updated to include some OneAPI changes. This further broke inactive custodians that they now displayed with a blank name. This issue was fixed by the API team but I am still having the previous issues where Inactive custodians are not being added correctly. The API team has come to the conclusion the issue is in the SDK not the API.
I am using VB.Net 2019 and my MSGraph library (Standard 2.0) is using the Beta 4.29 version. I have a WinForm program (4.6.2) that references my MSGraph library.
The process I use to add custodians is as follows:
Pass 1: I attempt to add a custodian
-If this returns successful I move to adding sources
Pass 2: If Pass1 reports an I try to add the custodian again. Basically I just re-try the call. This was due to some custodians not correctly adding during the first attempt which I believe are due to buffer issues in the Graph API.
-If this returns successful I move on to adding sources
Pass 3: If the previous to attempts failed I insert a “.” at the start of the email address. This covers custodians which are actually inactive but were not identified as such by GSK. Previously, I believe Microsoft had made a change to check for this so it should be caught by the first pass but my code still makes this last attempt.
-If this returns successful I move on to adding sources. If this still returns an error, then I assume the custodian can’t be added and mark it as such. No further work is done with this custodian.
The error reported is either:
MSGraph.AddCustodian : Code: NotFound
Message: Custodian not found
Inner error:
AdditionalData:
date: 2022-03-10T19:13:49
......
or
MSGraph.AddCustodian : Code: Conflict
Message: Custodian creation failed {"BatchResponses":[{"Id":"####","ErrorMessage":"Failed to create","ErrorCode":"BadRequest"}]}
Inner error:
AdditionalData:
date: 2022-03-10T19:14:01
.....
The API team looked into the logs at Microsoft and found the following:
'https://substrate.office.com:444/complianceworkbench/compliance/ediscovery/cases('####')/custodians('userSources')'."
URI 'https://substrate.office.com:444/complianceworkbench/compliance/ediscovery/cases('####')/custodians('siteSources')'
Above request URI should be in format : /custodians('id’)/userSources or /custodians('id’)/siteSources
This indicates the call begin made is not passing the correct CustodianID when adding sources. We have verified my code IS passing the IDs in the correct manner but the actual web call is not being made correctly by the SDK.
It was suggested by the API team to update my SDK version. I updated from 4.29 to 4.34. In doing so I now get the following error when making any Graph Calls:
{"Only HTTP/1.0 and HTTP/1.1 version requests are currently supported." "Parameter name: value"
When I downgraded back to 4.29 the code works as normal.
The text was updated successfully, but these errors were encountered: