Help with using sendMessage to remote gateway

I am getting an error when trying to use the system.util.sendMessage() function with remote gateway. When I try to send message from GW1 to GW2 I get following error:

Gateway script MessageHandlerException, project ‘projectA’, message handler ‘projectAHandler’: com.inductiveautomation.ignition.common.script.message.MessageHandlerException: MessageHandlerManager is null in ScriptConfig!

I have checked the following:

  • I have outgoing gw network connection between GW1 and GW2
  • I added ‘projectAHandler’ to GW2 gateway message handlers

Am I missing another configuration?

How are you targeting the remote gateway? Going backwards from the error you’re getting, it looks like the identified class (MessageHandlerManager) is only created if there are message handler scripts present - so maybe you’re trying to send to GW2, where you’ve created the message handlers, but actually your message is hitting GW1?

Ooh, or, actually, explaining it out loud, I bet there’s a bug here - we’re lazily initializing the ‘message handler manager’ - but if you don’t have any local message handlers, we don’t create one, so it can’t be used to send messages to a remote gateway. Oops. I bet if you create a local message handler, even with a different name than anything you’re using, it’ll start working.

I double checked and I actually do have local message handler on GW1. And I confirmed I am sending to GW2 since the error message appears in log of GW2.

Even with the local message handler it gives same error. I am not sure if this matters but the project is identical on both GW1 and GW2

We are trying to use message to send the gateway backup. This particular setup uses identical redundant pairs at two sites.

Hmm, I’m out of ideas, then - you should get in contact with support, if you haven’t already.

@kcabatic @PGriffith

Having the same issue. Was this resolved?

Same problem here, but projects are different.
Any new idea?

EDIT
Solved by me: I was defining the message handler in the Template project. Now it’s working ok, after moving definition to a real project.