Hi, my name is Andres Abril, Sr. Software Engineer at LeoSight, and I’m reaching out on behalf of my company, a public safety technology agency focused on providing investigative and analytical tools to support law enforcement and emergency response agencies . Our platform is designed to enhance situational awareness, streamline data access, and support critical decision-making in the field.
We are currently working with one of your/our customers: Pembroke Pines Police Department, where they use a multi recording server setup under different management servers.
For the integration with our platform and Milestone we are using the your Web APIs. Login, and get camera list are working just fine, but whenever we start to get the WebRTC session is when we are having problems. We are getting a “MultiUserEnvironment not initialized” error.
This part is critical for us to fulfill our customer’s needs, and I would appreciate your help in finding the root cause of this issue.
Andres Abril
aabril@leosight.com
Sr.Software Engineer
LeoSight LLC
https://www.leosight.com/
Which version of XProtect is this? Was it upgraded at any point in time, or full fresh install?
Is the XProtect API Gateway installed in the same server as the Management Server? (One server -all?) Or, is the XProtect API Gateway installed in a separate physical server?
Please let us see the XProtect API Gateway log (“[C:\ProgramData\Milestone\XProtect](file:C:/ProgramData/Milestone/XProtect) API Gateway\Logs\gateway.log”)
Hi. and sorry for the delayed response. Our customer was trying to gather the info for us.
This is what he sent:
We believe a registration might have gone wrong during installation. Could you please re-run the XProtect API Gateway installer? Actually, you will probably have installed it as part of the full Milestone XProtect VMS installer, now we propose that you run only the API Gateway part. You find the installer to use at [C:\Program](file:C:/Program) Files\Milestone\XProtect Download Manager\API Gateway Installer (file-system) or http://localhost/installation/admin/default-en-US.htm (browser)
We requested our customer to re-install the API Gateway, but unfortunately the problem persists.
The /cameraGroups request works as expected, but when trying to start the WebRTC session is when we get the “MultiUserEnvironment not initialized.”
Find attached some logs from our system.
We have been looking at the logs and the screenshot and we can see that the API Gateway is trying to communicate with http://pd-xprot-mgmt.ppines.local/IDP. Is the correct URL of the IDP or is the IDP actually running securely and require https? If this is the case, it would be possible to go into the config file of the API Gateway and modify it to use https instead of http.
If this is not the case, then we would like to get all the logs from the server to understand what goes wrong. I suggest you run the Diagnostic Tool to gather the logs.
Besides the logs, we would also like to see any appsettings files located in Program Files\Milestone\XProtect API Gateway.
The https change didn’t work, and it gave us the same results.
Find attached a folder with the logs provided from our customer. Please let me know if you need any other logs or information from our side.
We have struggled to reproduce, but have finally managed. We get exact same error as you do, if we change the RegistrationId found in appsettings.json. This has to be the same id which the API Gateway is registered towards the IDP. If this is the issue in your setup we need to figure out what has happened.
- If there is a appsettings.production.json in the same folder, then the registrationId in appsettings.production.json would be used instead of the one found in appsettings.json
- if appsettings.json has been copied from another machine
- if appsettings.json manually have been edited and the registrationId modified
That is the guesses we can come up with. Solutions to this can be to delete the appsettings.production.json if that is there. If that is not the case, then uninstall the API Gateway, manually delete the content of the “[C:\Program](file:C:/Program) Files\Milestone\XProtect API Gateway” and then reinstall.
The installation log shows that that registration with IDP is successfull (logs\installer\installer.log):
11/3/2025 4:36:48 PM Information Register Client to http://SECRET/IDP as Current User
11/3/2025 4:36:48 PM Information 'API Gateway Service - About to register client: “http://SECRET/IDP”
11/3/2025 4:36:50 PM Information 'API Gateway Service - register client finished
11/3/2025 4:36:50 PM Information 'API Gateway Service - write registration secret finished
11/3/2025 4:36:50 PM Information 'API Gateway Service - update config finished
11/3/2025 4:36:50 PM Information ‘GatewayServiceClientEndpointRegistrar.RegisterClient’ Status = Success
11/3/2025 4:36:52 PM Information ‘GatewayServiceClientEndpointRegistrar.PostRegisterClient’ Status = Success
11/3/2025 4:36:52 PM Information ‘GatewayServiceSetManagementServerRegistrar.PostSetServerAddress’ Status = Success
So, I’m almost certain that there is a appsettings.production.json file that is being used.
This is the reply from our customer:
I attempted to accomplish what they requested, by change the user in the JSON files. Since I am the one that installed the API I changed the USER GUID to mine. Same result. Here are logs before I uninstall the gateway, noticed one of the log entries mentioned invalid client.
The RegistrationId is not a USER GUID. It should not be changed by anyone besides the installer! This part should not be changed:
“ClientRegistration”: {
“RegistrationId”: “20d8655b-3808-4a2a-924b-c086d44406d9”
}
I’m having a hard time following what has been changed in the appsettings.json file and when that have happened. Can you explain what have been done to the file? Also can you explain what you mean by USER GUID, what is that and where is that put into the appsettings.json file?
Reply from our customer:
I have enclosed 4 appsettings. The files with new are what I changed the ID to. The line in question is the very last line.