Sample Aptify Web/e-Business 6 Troubleshooting story

This page includes general steps for troubleshooting an Aptify Web or e-Business 6 site issue. Checklist for basic Aptify Web/e-Business 6 troubleshooting 

Below is a real use case of applying those steps to resolve an issue where neither Aptify Web nor e-Business 6 would load.

Problem

We deployed the Aptify Web and e-Business 6 websites for CAI on a new sandbox server running Windows 2019. This was done by copying the sites instead of running through the installers. However, neither site would start due to various issues.

This page (How to setup Aptify Web, Ebusiness 553, or Ebusiness 6 without using an installer (Internal Use Only)) includes detailed steps on using this method to move websites and contained steps/fixes to all the items located below.

There were two main lessons (Apart from using that documentation):

  • When setting up a new server, you may want to use the installers instead of just copying the site. The installers would have pointed out problems logging in as the App Pool User, the fact that SSRS Reports and MVC4 were both missing, etc. Note, all these steps are accounted for in the previous documentation
  • Check the Event Viewer of the web server and the CheckConnection endpoint of both sites, they will both give a lot of information.

Aptify Web troubleshooting steps

The first thing to check is the Services CheckConnection endpoint. This just tells you whether the basics of the site can initialize. In our case, we got a HTTP 503 unavailable response from https://aptify.sandbox19.charteredaccountants.ie:444/AptifyServicesAPI/services/checkconnection.

If that's the case, usually it means services cannot start at all. The next two places to check are IIS specifically the Application Pools and the Event Viewer. In IIS, we noticed immediately that both SOA App Pools (one powering Aptify Web SOA and the other, e-Business 6 SOA) were stopped:

We attempted to manually start the Aptify_SOAWeb app pool, but it would immediately stop as soon as we started it. Going into the Event Viewer logs of the web server, we saw these issues:

So the first problem is that the Application Pools cannot login to Aptify. In this case, we are using mirrored accounts for a DMZ or non-domain setup, so we have an Aptify_1 user on the web server mimicking the Aptify_1 user on the DB server. This link describes how to setup these accounts to work: 341706353 (One important item is they MUST have the same password)

I checked the vmweb2019001\Aptify_1 user in the Users table, and saw that it was active. One easy check here would be to RDP to the Web Server as that user (if it has login rights) and try to login to Aptify Desktop as an integrated user. We immediately got a no valid client access license error. I then ran these SQL scripts to check if it had any Licenses assigned to it or was part of any groups:


Select * from vwUserLicenseAssignment where UserID=509
Select * from vwGroupMembers where userID=509

Both returned blank. This is not uncommon when setting up mirrored accounts in a DMZ as the previous linked documentation spells out. One workaround is to manually add the user to an End-User and CRM Client Access License, and then navigate to the Groups entity and manually add the User to the AptifySOAAppPool group.

We then attempted to login via the Desktop client and confirmed we were able to get into Aptify. 


Aptify will display the mirrored account on the DB server as the login.

We then went back into IIS and attempted to manually start the App Pool. It still stopped. One common thing to test here is to re-enter the App Pool credentials. So we right-clicked on the App Pool, clicked Advanced Settings, clicked Identity, and attempted to re-enter the username and password. It worked, although when we clicked OK, we got an error "Value does not fall within the expected range."

We did some Googling and came across this page https://social.technet.microsoft.com/wiki/contents/articles/30344.custom-iis-app-pool-identity-value-does-not-fall-within-the-expected-range.aspx It told us that our ApplicationHost.config file had issues, which is not surprising since it was copied from another server. This answer, in particular, was our issue and resolution:

Just tracked down the source of our problem: I had this issue with a new IIS 10 deployment. Our network team copied over the applicationhost.config file from the older servers and this caused it. In IIS 10 there are two new settings that encrypt the password for the app pool identity. Since the IIS 7 config file didn't have those encryption settings then IIS threw this error when assigning a new user. I simply copied over the settings from a brand new server build and it started working fine. 

We stopped IIS and edited the applicationHost.config file found at C:\windows\system32\inetsrv\config\applicationHost.config. In the <providers> block within <configProtectedData> we added these two keys:

 <add name="IISCngProvider" type="Microsoft.ApplicationHost.CngProtectedConfigurationProvider" description="Uses Win32 Crypto CNG to encrypt and decrypt" keyContainerName="iisCngConfigurationKey" useMachineContainer="true" />

<add name="IISWASOnlyCngProvider" type="Microsoft.ApplicationHost.CngProtectedConfigurationProvider" description="(WAS Only) Uses Win32 Crypto CNG to encrypt and decrypt" keyContainerName="iisCngWasKey" useMachineContainer="true" />

We then went back into IIS and re-entered the Application Pool usernames and password. This time, it allowed us to save. We then started IIS back up and confirmed the Application Pools started and stayed running. Now, we went back to our CheckConnection endpoint.

It gave us this error:

This is a straightforward error telling us we do not have SQL Server Report viewer installed on this server, which is a requirement for Aptify Web. We first installed the Report Viewer's pre-requisite, SQLSysCLRTypes_64bit.msi, then ReportViewer_64bit.msi:

We then went back to our CheckConnection endpoint again. This time, we saw a different error: 

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


You can find this by googling the missing assembly, but we'd observed this previously. This means that MVC4 is not installed on this Web Server, also an Aptify Web pre-requisite. We installed it and went back to the CheckConnection endpoint. It now loaded, which means we can check the Aptify site:

The Aptify site loaded until we got to the select login method screen, whether we chose Domain or SQL, it did nothing. Reloading the page with the Chrome Console open (F12) we saw we were getting a 500 internal server error on either the SQL or Domain login pages. Fortunately, we'd seen this before too when transferring websites, and the resolution is the Anonymous Authentication identity for our site must be the app pool user.

Selecting our website in IIS and clicking Authentication, we then selected Anonymous Authentication and the Edit button in the far right corner.

It showed us that the Anonymous identity our site was trying to use was Specific User, IUSR. Both Aptify Web and E-Business 6 require it to be set to the Application pool identity. We changed it for both sites and restarted IIS.

After that, we confirmed the CheckConnection endpoint was still working, and attempted to login again. Now both the SQL and Domain pages would load, and we were able to get into Aptify Web:

e-Business 6 troubleshooting steps

During the Aptify Web troubleshooting, we had already resolved the login issue for the E-Business App Pool user (in this environment, it is same as Aptify Web SOA) we'd already changed the Anonymous Authentication to the App Pool user, and resolved issues with our ApplicationHost.config file. After that, we tried the E-Business 6 Check Connection endpoint.

In our case, we got a HTTP 503 unavailable response from the site. Going back to IIS, we looked at the Application Pools and noticed Aptify_EbusinessSOAWeb was still stopped, though the same user was running Aptify_SOAWeb fine:

Previously, once we resolved the ApplicationHost.config issue, we'd re-entered the Aptify_SOAWeb username/password but had not done so on the E-business 6 app pool. We did so and started it up, and it remained running.

We returned to our CheckConnection endpoint and it successfully resolved:

However, when we went to the UI site, the UI elements loaded, but the SOA items did not. This can be seen if you go to the UI site and it never loads the blue e-Business 6.0 banner at the top, like this:

Opening our Chrome Console (F12) and reloading the page, we saw an error calling the ShoppingCarts page at the very bottom right:

It didn't tell us much, so we checked the web server's Event Viewer. This gave us the answer. There were 4-5 exceptions similar to this, all with one critical error highlighted in red below:

The description for Event ID 0 from source Aptify.ExceptionManagerPublishedException 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.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

There was a problem compiling the script of Process Flow Steps : [Check User Identifier Type] , Process Flow Steps ID: 1053.

StackTrace Information

*********************************************

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.ExecuteScriptRule(AptifyApplication Application, ProcessFlowStepInfo StepInfo, String Script, AptifyContext Context, DataAction DataAction, String TransactionID)

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.get_RunProcessStepRule(ProcessFlowStepInfo StepInfo, ProcessFlowDebugInfo DebugInfo, StepExecutionLog DebugCurrentStep, AptifyContext Context, AptifyApplication Application, DataAction DataAction, String TransactionID)

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.get_RunProcessStep(ProcessFlowStepInfo StepInfo, ProcessFlowDebugInfo DebugInfo, AptifyContext Context, AptifyApplication Application, DataAction DataAction, String TransactionID)

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.get_RunProcessStep(Int64 StepID, ProcessFlowDebugInfo DebugInfo, AptifyContext Context, AptifyApplication Application, DataAction DataAction, String TransactionID)

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.OnRun(AptifyApplication Application, DataAction DataAction, Int64 ProcessFlowID, ProcessFlowDebugInfo DebugInfo, AptifyContext Context, Boolean ForceSynchronousExecution, String TransactionID)

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.ValidateExecutionRuleAndRun(AptifyApplication Application, DataAction DataAction, Int64 ProcessFlowID, ProcessFlowDebugInfo DebugInfo, AptifyContext Context, Boolean ForceSynchronousExecution, String TransactionID)


Properties

*********************************************

  Type: Aptify.Framework.BusinessLogic.GenericEntity.AptifyGenericEntityException

  MachineName: vmweb2019001

  CreatedDateTime: 9/3/2020 11:42:30 PM

  AppDomainName: /LM/W3SVC/3/ROOT/SOA-1-132436500510175893

  ThreadIdentityName:

  WindowsIdentityName: vmweb2019001\Aptify_1

  Severity: 0

  ErrorNumber: 0

  TargetSite: System.String ExecuteScriptRule(Aptify.Framework.Application.AptifyApplication, Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowStepInfo, System.String, Aptify.Framework.Application.AptifyContext, Aptify.Framework.DataServices.DataAction, System.String)

  Source: AptifyProcessFlowEngine

  HResult: -2146232832


Additional Information

*********************************************

Script Type: Process Pipeline


Inner Exception #1

*********************************************

There was a problem compiling the script. Please refer to the Exception Log.


StackTrace Information

*********************************************

   at Aptify.Framework.Scripting.ScriptEngine.CompileExecutable()

   at Aptify.Framework.BusinessLogic.ProcessPipeline.ProcessFlowEngine.ExecuteScriptRule(AptifyApplication Application, ProcessFlowStepInfo StepInfo, String Script, AptifyContext Context, DataAction DataAction, String TransactionID)


Properties

*********************************************

  Type: System.Exception

  TargetSite: Void CompileExecutable()

  Source: AptifyScriptEngine

  HResult: -2146233088


Inner Exception #2

*********************************************

  vbc : Command line (0,0) : error BC2017: could not find library 'C:\Program Files\Aptify 5.0\Bootfiles\IAptifyDataServices.dll'

  vbc : Fatal (0,0) : error BC2000: compiler initialization failed unexpectedly: The filename, directory name, or volume label syntax is incorrect.


Properties

*********************************************

  Type: System.Exception

  HResult: -2146233088Additional Info:

responseIdentifier: f285cf80-c859-412a-82b6-26ed7934920e

The message resource is present but the message was not found in the message table


This means either e-Business 6 could not access C:\Program Files\Aptify 5.0\Bootfiles\IAptifyDataServices.dll due to permissions issues or something, or it doesn't exist. In our case, it did not exist. This new server had the Aptify desktop client setup under the Aptify 6.1 folder, but our site was still looking for Aptify 5.0:

We simply copied the Aptify 6.1 folder and renamed it Aptify 5.0, and then restarted IIS. Now, our ShoppingCart endpoint loaded fine and our SOA loaded the menu properly: