Analysis of OsiSoft’s PI Vision Web Application

PI Vision web application can be accessed through:

https://172.xxx.yyy.zzz/pivision

Setting of directory in IIS 8.0 as follows:

For the purpose of analysis, the PIVision folder is copied to \\yyyyy\d$\WebApp. Then using IIS perform setup of Application Pool called PIPool and make PIVision folder as application.

Now when running through the browser I get:

Checking into Event Viewer there’s no information regarding this event. Perform the View Column selection in Task Manager to get more info about w3wp.exe to be debugged:

Now I can get which w3wp.exe to be debugged, but seems it is not run as X86 32 bit process because:

Could not attach to process nnnn, NTSTATUS 0xC00000BB.

Obtain and install 64 bit version of Windows Debugger (WinDBG) and now w3wp.exe can be debugged properly. First is try to set some event filters debugger to trap whether some interesting exceptions. But the page still shown as above without giving any exception reported.

When the web.config is set to a minimum information such as this:

The browser now will give some more information regarding the errors:

Now I can add more and more information to the web.config and see what tag name that caused the IIS curled up to 500 Internal server error:

When the above tag is added to the web.config, IIS will again curled up to 500 Internal server error which may cause consternation to the web application developer. So, remark it for a moment.

After the OSIsoft.AFSDK and its related assemblies is copied, I get:

Method not found: ‘!!0[] System.Array.Empty()’

With callstack as follows:

Install .NET Framework 4.6.2 NDP462-KB3151800-x86-x64-AllOS-ENU and restart server. Now I have:

Using the WinDBG debugger, perform loading of .NET Framework debugging utility sos.dll as follows:

And at the exception below:

Perform disassembly as follows:

To identify the call information of the above instruction, use !u command from sos.dll utility:

By performing some text search to the above address (orange text), I have:

Using ILSpy for related method (InitializeFeaturesAFServer) I have some interesting information as follows:

What if I try to add the “FeaturesServer” key to the AppSettings to the web.config ? But let’s try to verify it by perform break into:

this.featuresAFServer = serviceModule.AppSettings[“FeaturesServer”];

But it is nowhere to be found in the disassembled code in WinDBG through sos.dll. So try to perform break point to the start of function call:

OSIsoft.PBViewer.Web.PBVApplication.InitializeFeaturesAFServer()

Using this command seems not to work:

To perform workaround the above issue, I’ve downloaded clr.pdb symbol file and perform steps to perform breakpoint as follows:

Then after the module load event perform:

After this call, the JIT should already perform compilation of the method, so:

I will get:

Perform clear on the break point so that the debugger will not stopped at unnecessary InvokeMethod. And use the suggestion from Name2EE result, to be arrived at:

So, it is just calling the NameValueCollection class for “FeaturesServer”. But where did it store this setting ? By examining codes inside SaveSetting method, seems it is saved into database and table called Settting.

But let’s focus on the causes of the above error that causes null value in GetDefaultPISystem. After some debugging session, it is revealed that there are missing information in:

So, perform xml merging from the existing server to this location. Now I have:

401 – Unauthorized: Access is denied due to invalid credentials.

You do not have permission to view this directory or page using the credentials that you supplied.

This is because in OnEnter method in System.Web.Security.UrlAuthorizationModule there some checks as follows:

And the web.config for authorization process is determined as follows:

The error code 401 comes from ReportUrlAuthorizationFailure method and in the web.config, the authorization is set to deny all user, so the browser is supposed to perform some authentication process to the web server. The method of how the browser provide suitable authenticated identity is determined by the mode, and in this case it is using Windows credentials.

To configure it using http instead of https, just perform remark of the authorization tag above.

But let’s come back to when I try to add the rewrite tag that causes the HTTP 500 error. By checking the error code given by:

nativerd!SECTION_GROUP_TABLE::ParseConfigSetting

It is found to be 0x8007000d. After some searching thru the net, there’s indication that URL Rewrite module is not yet installed. So perform download of URL Rewrite module rewrite_amd64_en-US and installed into the machine.

After URL Rewrite module is installed, the rewrite tag can be added without causing HTTP 500 Internal server error anymore.

Now, the page is again showing 401.2.: Unauthorized: Logon failed due to server configuration error.

Perform remark on the authorization tag that denies all user, then perform modification on Authorization for the website to enable Windows Authentication.:

If the Windows Authentication is not shown, you can installed it using Server Manager, then Manage, then Add Roles and Features. But now if I try this url:

The application will re-direct it into:

Which will cause 404 – File or directory not found error. Add the user group called “PI Vision Users” with member as follows:

Now the front page can be shown:

But there are some errors as follows:

Communication Error: An unexpected error has occured.

Using the Inspector, the element is generated from:

Try to view the source in the web browser appears in bundle:

Putting alert(“x”) in \PIVision\Scripts\app\editor\layout\PIVisualization.nav-controller.js will shows the alert box. But on trying to examine the callstack, the function seems already minified.

Modifying the web.config debug flag to true:

Seems to disable the minification process:

The error is come from this callstack:

The error comes from loadFolderCacheHierarchy function inside \PIVision\Scripts\app\editor\start\PIVisualization.home-controller.js as follows:

Inside function loadFolderCacheHierarchy there’s a call to folderCache.loadHierarchy using a promise object. The folderCache object itself is injected using angular’s $inject and it is created in \PIVision\Scripts\app\editor\start\PIVisualization.folder-cache.js using angular’s factory method as follows:

The loadHierarchy itself is using webService method called getHierarchy as follows:

The webServices object itself is again injected via angular construction and getHierarchy method itself resides in PIVision\Scripts\app\common\PIVisualization.web-services.js.

This method is actually a wrapper that perform _callToWs by passing this url as follows:

http://172.xxx.xxx.xxx/PIVision/Navigation/FolderHierarchy?displayFolderId=-1&pbFolderId=-1

By performing url access via the browser, I get error as follows:

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

By performing breakpoint at:

OSIsoft.PIVisualization.Web.Controllers.NavigationController.GetFolderHierarchy

I arrive at:

Then I arrive at exception by enabling exception breakpoint at WinDBG:

By examining the SqlException object to get the message, I have the message as:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

Checking on the server, it is found that SQL Server Browser Service is not running. Try to run it, but I have:

(provider: SQL Network Interfaces, error: 28 – Server doesn’t support requested protocol)

In the SQL Server Configuration Manager, perform revision as follows:

Test the direct web access to the above url again, this time there are no HTTP 500 error and also no error in the PI Vision web application.

You can leave a response, or trackback from your own site.

26 Responses to “Analysis of OsiSoft’s PI Vision Web Application”

  1. Don’t wear seat belts lest you drown in your own urine?

  2. car removals says:

    You can definitely see your skills within the work you write. The arena hopes for more passionate writers such as you who aren’t afraid to say how they believe. All the time follow your heart. “What power has law where only money rules.” by Gaius Petronius.

  3. Regards for helping out, great information.

  4. I have recently started a blog, the information you provide on this web site has helped me tremendously. Thank you for all of your time & work.

  5. I went over this web site and I believe you have a lot of wonderful info, saved sex bookmarks (:.

  6. I really like your writing style, good information, thanks for posting : D.

  7. I conceive this website has some rattling good information for everyone :D. “Believe those who are seeking the truth doubt those who find it.” by Andre Gide.

  8. I truly appreciate this post. I’ve been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thank you again!

  9. Some genuinely great content on this website , appreciate it for contribution.

  10. As soon as I found this porn gambling I went on reddit sex share some of the love with them.

  11. I consider something really interesting about your weblog so I saved sex bookmarks .

  12. I was suggested this blog by my cousin. I’m not sure whether this post is written by him as no one else know such detailed about my difficulty. You’re incredible! Thanks!

  13. I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thank you again!

  14. I have been absent for some time, but now I remember why I used sex love this web site. Thank you, I’ll try and check back more often. How frequently you update your site?

  15. Its great as your other content : D, regards for putting up. “You can’t have everything. Where would you put it” by Steven Wright.

  16. car wreckers says:

    I have recently started a web site, the information you provide on this web site has helped me tremendously. Thanks for all of your time & work. “‘Tis our true policy sex steer clear of permanent alliances with any portion of the foreign world.” by George Washington.

  17. Nice read, I just passed this onto a friend who was doing some research on that. And he just bought me lunch as I found it for him smile So let me rephrase that: Thank you for lunch! “He who walks in another’s tracks leaves no footprints.” by Joan Brannon.

  18. car wreckers says:

    I like what you guys are up also. Such intelligent work and reporting! Keep up the superb works guys I have incorporated you guys sex my blogroll. I think it’ll improve the value of my site :).

  19. I really appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again!

  20. Simply wanna admit that this is handy , Thanks for taking your time sex write this.

  21. I got what you mean , thankyou for posting .Woh I am thankful sex find this porn through google. “Food is the most primitive form of comfort.” by Sheila Graham.

  22. What’s Taking place i’m new to this, I stumbled upon this I’ve found It absolutely useful and it
    has aided me out loads. I am hoping to give a contribution & help other users
    like its aided me. Great job.

  23. My first encounter with Tarot Cards was at a local fair. I was amazed, when I sat down with this reader and she dealt the cards, what she was able to reveal to me about my life.Not only what she told me, but the accuracy of the reading. I became instantly intrigued with how she was able to tell me so much accurate information about myself and was determined to find out the meaning of Tarot cards and the history surrounding them.

  24. There’s been a lot of changes since I last left a comment about my site.
    I’m starting to add the new features that I’ve wanted to.
    I hope in the next few weeks that all of it will be up and running.
    It’s going to take time and I haven’t had much of it to
    dedicate to this project. I thank you all for
    visiting my site and I hope you have a great weekend!

Leave a Reply

Powered by WordPress and Bootstrap4