Forum Discussion

Sistemas_depo's avatar
Sistemas_depo
Copper Contributor
Jan 26, 2024

On MACP, (400 : HTTP/1.1 400 Bad Request) when enabling a user.

Hello everyone!

 

My problem is:

When enabling a user on the new MACP, IF the user has configured an email address gives the subjet error.

If the user doesn't have configured email address, user is enabled but not without a problem.

 

Viewing trough developer mode on the browser, the error lies in:

https://<sfbs-fe-pool-fqdn>/OcsPsws/Service.svc//$batch

The payload of the $batch:

--batch_1706182664593 
Content-Type: multipart/mixed; boundary=changeset_21.25566040805762
--batch_1706182664593
Content-Type: multipart/mixed; boundary=changeset_21.25566040805762
--changeset_21.25566040805762
Content-Type: application/http Content-Transfer-Encoding: binary
PATCH /OcsPsws/Service.svc/CsAdUser/fragments/2/<BLABLABLA>
HTTP/1.1
Content-Type: application/json
{"SipAddressType":"EmailAddress","SipDomain":"<domain.tld>","RegistrarPool":"<sfbs-fe-pool-fqdn>"}
--changeset_21.25566040805762--
--batch_1706182664593
Content-Type: multipart/mixed; boundary=changeset_21.25566040805762
--changeset_21.25566040805762
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH /OcsPsws/Service.svc/CsUser/fragments/2/<BLABLABLA>
HTTP/1.1
Content-Type: application/json {"AudioVideoDisabled":false,"EnterpriseVoiceEnabled":false,"RemoteCallControlTelephonyEnabled":false}
--changeset_21.25566040805762--
--batch_1706182664593--

 

Gives this error without regards of wich option i choose about the format of the sip address (email, UPN, etc.):

HTTP/1.1 400 Bad Request
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
Content-Type: application/xml;charset=utf-8
<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="es-ES">The request URI is not valid. Since the segment 'CsAdUser' refers to a collection, this must be the last segment in the request URI. All intermediate segments must refer to a single resource.</m:message></m:error>--changesetresponse_a677ace1-29ed-4549-b606-2b90d0a4d6d8--
--batchresponse_681cb375-bac7-4afe-a2fa-9ceb5f199d4aContent-Type: multipart/mixed; boundary=changesetresponse_608de08e-6dbe-4000-aab4-95c97c576d09
--changesetresponse_608de08e-6dbe-4000-aab4-95c97c576d09
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 400 Bad Request
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
Content-Type: application/xml;charset=utf-8
<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="es-ES">The request URI is not valid. Since the segment 'CsUser' refers to a collection, this must be the last segment in the request URI. All intermediate segments must refer to a single resource.</m:message></m:error>
--changesetresponse_608de08e-6dbe-4000-aab4-95c97c576d09--
--batchresponse_681cb375-bac7-4afe-a2fa-9ceb5f199d4a--

 

And, when enabling a user without a configured email address, the payload of $batch looks like this:

--batch_1706183087284 
Content-Type: multipart/mixed; boundary=changeset_3.9714624502973583
--batch_1706183087284
Content-Type: multipart/mixed; boundary=changeset_3.9714624502973583
--changeset_3.9714624502973583
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH /OcsPsws/Service.svc/CsAdUser('BLABLABLA')
HTTP/1.1
Content-Type: application/json
{"SipAddressType":"UserPrincipalName","SipDomain":"<domain.tld>","RegistrarPool":"<sfbs-fe-pool-fqdn>"} 
--changeset_3.9714624502973583--
--batch_1706183087284
Content-Type: multipart/mixed; boundary=changeset_3.9714624502973583
--changeset_3.9714624502973583
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH /OcsPsws/Service.svc/CsUser('<BLABLABLA>')
HTTP/1.1
Content-Type: application/json
{"AudioVideoDisabled":false,"EnterpriseVoiceEnabled":false,"RemoteCallControlTelephonyEnabled":false}
--changeset_3.9714624502973583--

 

On the MACP i get a spinning wheel, but if i go to users, it appears as enabled.

On the browser's developer tools the server gives this answer:

 

HTTP/1.1 500 Internal Server Error
X-Content-Type-Options: nosniff
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/xml;charset=utf-8

<?xml version="1.0" encoding="utf-8"?><m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><m:code /><m:message xml:lang="es-ES">An error occurred while processing this request.</m:message><m:innererror><m:message>No se pudo ejecutar el comando Set-CsUserDetails. Causa del problema: No se encontró ningún objeto de administración para la identidad "<ad user distinguished name>".</m:message><m:type>Microsoft.Management.Odata.CommandInvocationFailedException</m:type><m:stacktrace> en Microsoft.Management.Odata.PS.PSCommand.ExecutionCompletionHandler()&#xD;
en Microsoft.Management.Odata.PS.PSCommand.Invoke(Expression expression, Boolean noStreamingResponse)&#xD;
en Microsoft.Management.Odata.Core.PSOperationManager.InvokeCRUDCommand(CommandType commandType, String resourceTypeName, IEnumerable`1 properties)&#xD;
en Microsoft.Management.Odata.Core.PSOperationManager.Update(SenderInfo senderInfo, String resourceTypeName, IEnumerable`1 properties)&#xD;
en Microsoft.Management.Odata.Core.OperationManagerAdapter.FunctionInvoker`1.Invoke()&#xD;
en Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeMethod(IInvoker invoker, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException)&#xD;
en Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeOperationManagerFunction[T](Func`1 func, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException, T defaultResultForNotImplementedException)&#xD;
en Microsoft.Management.Odata.Core.OperationManagerAdapter.CUDRequest(CommandType commandType, ResourceType resourceType, Dictionary`2 properties, Dictionary`2 urlParams)&#xD;
en Microsoft.Management.Odata.Core.EntityUpdate.InvokeCommand()&#xD;
en System.Data.Services.DataService`1.BatchDataService.HandleBatchContent(Stream responseStream)</m:stacktrace><m:internalexception><m:message>No se encontró ningún objeto de administración para la identidad "CN=Carmen Morillo Rodriguez,OU=USUARIOS,OU=CUENTAS DESHABILITADAS,OU=OU _01_VARIOS,DC=depo,DC=es".</m:message><m:type>Microsoft.Rtc.Management.AD.ManagementException</m:type><m:stacktrace> en Microsoft.Rtc.Management.AD.ADTask`1.GetDataObject[TDataObject](IIdentity id, IDirectorySession session, ObjectId rootID)&#xD;
en Microsoft.Rtc.Management.AD.ADTask`1.GetDataObject(IIdentity id)&#xD;
en Microsoft.Rtc.Management.AD.SetPersonBase`2.ResolveDataObject()&#xD;
en Microsoft.Rtc.Management.AD.GenericSetADObjectIdentityTask`3.PrepareDataObject()&#xD;
en Microsoft.Rtc.Management.AD.GenericSetADTask`1.InternalValidate()&#xD;
en Microsoft.Rtc.Management.AD.ADTask`1.PrepareForScopeCheck()&#xD;
en Microsoft.Rtc.Management.OcsCmdlet.IsUserInScope()&#xD;
en Microsoft.Rtc.Management.OcsCmdlet.ProcessRecord()&#xD;
en System.Management.Automation.CommandProcessor.ProcessRecord()</m:stacktrace></m:internalexception></m:innererror></m:error>
--changesetresponse_42f57019-b938-47b1-a3f6-aaf2a7bb23c8--
--batchresponse_c7d33751-d003-448c-89db-4ebcda4bc6ae--

The only difference is that on the failing payload i see:

PATCH /OcsPsws/Service.svc/CsAdUser/fragments/2/<BLABLABLA>

 

And on the working payload:

PATCH /OcsPsws/Service.svc/CsAdUser('<BLABLABLA>')

 

Sounds like a bug? Configuration problem??

 

Edit: I forgot to mention the environment - SfBS 2019, patched to October 2023 level.

Three Win servers 2019 as front-ends, two win server 2019 as Edges.

 

Applied, as patch requested, the prerequisites without errors.

bootstrapper executed without errors.

 

🤷‍:male_sign:

No RepliesBe the first to reply

Resources