We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

"Response to preflight request doesn't pass access control check" error

Resolved
Yosef asked on March 21, 2022

I'm trying to make a connection to our OLAP via /msmdpump.dll and getting a CORS error:  

Access to XMLHttpRequest at 'https://*/msmdpump.dll' from origin 'https://<localmachine>' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.  

I'm able to connect to the /msmdpump.dll endpoint fine through Excel and through the browser I get a 500 error.  

What I've tried:
 - Allowed OPTIONS request in IIS as instructed here: https://www.flexmonster.com/doc/configuring-authentication-process-for-ssas-xmla/
 
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
<windowsAuthentication enabled="true" />
</authentication>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="?" verbs="OPTIONS" />
<add accessType="Allow" users="" roles="USERS" />
</authorization>

9 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 22, 2022

Hello, Yosef,
 
Thank you for reaching out to us.
 
Firstly, please note that 500 error means something has gone wrong on the server. We recommend checking if your server works properly.
 
You have mentioned our tutorial on configuring the authentication process. Could you please clarify if you also want to manage the authentication?
If you want to configure the authentication process:

Please let us know if it works for you. Looking forward to your response.
 
Kind regards,
Nadia

Public
Yosef March 24, 2022

Hi Nadia,
Thanks so much for the info.

I tried setting up a second msmdpump.dll from scratch, and configured CORS in web.config but I'm still getting the same error.

Regarding the 500 error with msmdpump.dll, I read that happens in the browser because the endpoint doesn't support GET requests only POST. It works fine in Excel and SQL S Management Studio. I did find Event Viewer errors when executed from Javascript:

The description for Event ID 25 from source MSOLAP ISAPI Extension: \\?\c:\inetpub\wwwroot\olap_test\msmdpump.dll cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

I found it can be reproduced with pure Javascript as well just by sending a request to /msmdpump.dll:

var xhr = new XMLHttpRequest();
xhr.open("POST", "https://serverName/OLAP/msmdpump.dll", true);

xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.setRequestHeader("Access-Control-Allow-Origin", "https://localhost");
xhr.setRequestHeader("Access-Control-Allow-Headers", "Content-Type");
xhr.setRequestHeader("Access-Control-Allow-Methods", "OPTIONS");

xhr.withCredentials = true;

xhr.send("<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" flexmonster="true"><SOAP-ENV:Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>DISCOVER_DATASOURCES</RequestType><Restrictions/><Properties/></Discover></SOAP-ENV:Body></SOAP-ENV:Envelope>");

I also get this error in the event viewer for msmdpump.dll

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 24, 2022

Hello, Yosef,
 
Thank you for providing us with the details.
 
In your case, we would like to recommend you a different approach that our customers consider to be easier than configuring msmdpump.dll. 
Try connecting to your OLAP cube via Flexmonster Accelerator for Microsoft Analysis Services cubes - a special server-side utility developed by Flexmonster. 
Kindly note that Accelerator and cube should be located on the same local network, and your current Windows user should have access permissions for the database and cube. For now, we suggest skipping the authentication part entirely and also connecting via HTTP (not HTTPS).
The detailed guide you can find in our documentation: https://www.flexmonster.com/doc/getting-started-with-accelerator-ssas/
 
Please let us know if the described approach works for you. Looking forward to hearing from you.
 
Kind regards,
Nadia

Public
Yosef March 28, 2022

Thanks Nadia, I'm investigating the problem with our msmdpump.dll endpoint - we would prefer to use it. I'll let you know when I get results.

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster March 28, 2022

Hello, Yosef,
 
Thank you for the response.
 
If you would like to use the msmdpump.dll endpoint, we still recommend starting the configuration without the authentication and HTTPS connection.
Regarding the absence of authentication, make sure that your endpoint can receive all requests, including those from unauthorized users. Please check this guide for reference, but note that in step 5, you should configure credentials for Anonymous authentication.
On the client side you should:

  • Remove withCredentials: true from the constructor. 
  • If you do not configure an HTTPS connection, ensure there's http in your URL. For example,
    proxyUrl: "http://localhost/OLAP/msmdpump.dll",

 
As always, you are welcome to write to us in case further questions arise.
 
Kind regards,
Nadia

Public
Yosef April 4, 2022

Hi Nadia,

I tried using anonymous authentication with a manual POST request and the preflight authentication passed but the response returned XMLAnalysisError.0xc1270004. Microsoft advised this is because msmdpump.dll isn't designed for a direct call - so I'm back to the FlexMonster execution.

I've enabled anonymous authentication in IIS, removed withCredentials: true, and used a http url: http://localhost/OLAP/msmdpump.dll.
This is failing again with a 500 error with the OPTIONS preflight request:

500 CORS Preflight Did Not Succeed 

Also to note is I tried this with on two different machines and two different Analysis Services cubes with the same result.
I can access msmdpump from Excel and Sql Server Management Studio just fine. I wonder if there's a working example to compare against? The Flexmonster demo msmdpump.dll does work so what does it do differently?

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 5, 2022

Hello, Yosef,
 
Thank you for your response.
 
We suppose that the issue is caused by the wrong configuration of CORS in IIS. Here are some resources on configuring CORS that you might find helpful:

Please note, that our msmdpump.dll sample will not help you since the necessary configurations should be done in IIS. The msmdpump.dll file itself does not need any modifications.
CORS technology is a browser protection mechanism. The browser makes a "preflight" request to the server to check that the server will permit the actual request. You will not face such thing when accessing msmdpump from Excel and SQL Server Management Studio since they use the direct connection through ADOMD.NET library.
It is also possible to temporally skip this step by disabling CORS in Chrome. This can help to make further testing.
With all this in mind, we would like to recommend considering connecting to your cube using Flexmonster Accelerator - it also uses ADOMD.NET.
The Accelerator is not only the easiest way of connecting Flexmonster to Microsoft Analysis Services, but it also: 

  • transfers big data from the server to the browser incredibly fast,
  • reduces the load on the browser memory.

There are two ways to use Flexmonster Accelerator:

 
We hope it helps. You are welcome to write to us in case further questions arise.
 
Kind regards,
Nadia

Public
Yosef April 12, 2022

Hi Nadia,
After many hours searching I seem to finally have it working.
The missing piece was the OPTIONSVerbHandler in the IIS configuration, something not mentioned in the msmdpump.dll or CORS configuration docs. It needed to:

  • Be at the top of the handler list
  • Allow read access

I found it here:
https://www.flexmonster.com/question/stream-error-occurred-while-loading-httplocalhost8080olapmsmdpump-dll/
 

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster April 12, 2022

Hello, Yosef,
 
Thank you for your feedback.
 
We are glad to hear that you have managed to resolve the issue.
 
As always, feel free to contact us in case further questions arise.
 
Kind regards,
Nadia

Please login or Register to Submit Answer