Wednesday, March 28, 2012


Amalga Dialogs Broken due to Sync Parser not Starting


The other day when developing components in Amalga I found that I was unable to checkout dialogues which had been created and was also unable to create any new dialogues.


The first step when encountering unexpected issues in Amalga is to check the azyxxi logs table (or use your handy log viewer).  In this instance I found a log entry reading:

[Service=Amalga.ScriptEngine.Sync ] Amalga.PackageCountIsZero:  cause=No packages for service instance name [Amalga.ScriptEngine.Sync] on machine FOO

Ok so there's something wrong with the sync parser.  I went to window's services (I know you're supposed to use the management console but this was in dev) and tried to cycle the sync parser.


Services:  Windows could not stop the Amalga.ScriptEngine.Sync service on Local Computer.
Error 0xffffffff: 0xffffffff


Pretty common error.  It means that the parser service you just tried to shut down was never running in the first place.  Whenever seeing this error always check the windows event log:




[Amalga.ScriptEngine.Sync]
PID: [5004]
eventID: [Parser_EVENTID_10]: (10)
type: [Error]
resourceID: [262154]
 ScriptEngine: [Amalga.ScriptEngine.Sync] Package or service error.  An error occurred with the package or the service. Messages will no longer be processed. PackageName: [_ASE_Initialization] PackageID: [00000000-0000-0000-0000-000000000000] MessageID: [(unknown)] ErrorID: [Stop] Amalga.PackageCountIsZero:
cause=No packages for service instance name [Amalga.ScriptEngine.Sync] on machine FOO;
mitigation=No packages for the service instance were found. The likeliest reason might be that an upload needs to be done using Script Engine Explorer, or a package needs to be added to this service instance. It can also happen if a third-party dll was not found. All scripts should be derived from the appropriate base class. A message script needs to derive from ParserMessageBase. Table scripts must derive from TableScriptBase, and Key scripts must derive from KeyScriptBase.;
exceptionerrorResponse=Stop;

Ok pretty straightforward.  There are no packages uploaded for the Sync Parser to run.  I then went into ScriptEngineExplorer to find the missing package.  Except there is no default package named "SyncParser".  WTFs ensure for about 2 days.  Checking the Amalga forums I stumble across this post detailing several error messages concerning both dialogues and the sync parser.  Which lead to this little tidbit:  "UM_USER package is not subscribed to the ScriptEngine service."  Wierd.  I checked out our prod system where (usually) things are running a little smoother and took a look at the ScriptEngine DB and what packages were subscribed to which services with this query:


SELECT parserservice.*, package.*, parser.*
  FROM [ScriptEngine].[dbo].[ParserServicePackageDef] parserservicepackage
  inner join ScriptEngine.dbo.PackageDef package
  on parserservicepackage.PackageDefID = package.packagedefid
  inner join ScriptEngine.dbo.PackageDefParserDef packageparser
  on parserservicepackage.PackageDefID = packageparser.PackageDefID
  inner join ScriptEngine.dbo.ParserDef parser
  on packageparser.ParserDefID = parser.ParserDefID
  inner join ScriptEngine.dbo.parserservice parserservice
  on parserservice.parserserviceid = parserservicepackage.ParserServiceID
  and parserservice.serviceinstancename like '%Sync%'

Lo and freaking behold in our prod system there were 3 packages subscribed to the SyncParser service:  UM_USER, rnVitals and QuickEdit, and on our dev box there were none.  Log into Amalga Management Shell with Admin rights.  Run the following command:

SubscribeToPackages Amalga.ScriptEngine.Sync UM_USER
Bam.  Sync parser service starts working.  Dialog manager is able to checkout and create things.  This is just my experience.  Not sure why the dialog manager depends on the UM_USER package and this will probably be the next thing to investigate.