# Message handler issue - reported as not found in the client console but triggered

**URL:** <https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 16, 2025, 11:13am UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965 "2025-01-16T11:13:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 11:13am UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/1 "2025-01-16T11:13:37Z")

</div>

[HandlerNotFound.txt](https://forum.inductiveautomation.com/uploads/short-url/yQ9tyXowdg6y8FAcr8HkEfmG1vs.txt) (6.7 KB)

Context:

- a parent project "P" inheritable
- a child project "C", having "P" as parent
- a message handler script called "PwdChangeRequest " defined in gateway events in "P"
- no override of gateway scripts/events in "C" (gateway events is grey in "C")
- I see the message handler script in the gateway status as belonging to project "C" (makes sense), also whenever triggered

A button in a vision popup is calling the handler using project name "C" and related handler name.

The script is perfectly triggered/working (logged via wrapper with "print" e triggering monitored via gateway page - sure 100%) and the script is also accomplishing its task. Indeed I get the error in the client console "handler not found" as per attachement.

So not a "real" issue because all seems working but not "cleared" and I do no like having unexplained error...Any explaination/fix?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2025, 1:07pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/2 "2025-01-16T13:07:14Z")

</div>

Do not put event handlers in inheritable projects. Such event handlers will run in duplicate in all leaf projects. Events cannot be overridden one-at-a-time. The entire set of events gets overridden, and further changes to the inheritable set will not propagate.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 1:26pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/3 "2025-01-16T13:26:01Z")

</div>

So, if I properly understand: timer scrips are ok in a parent project, tag change scripts (events) and message handler scripts (events) no? Or do you refer only msg handlers, being tags gateway-scoped?

In any case, clear that they are duplicated (as by manual in Project Inheritance page, on tag change example and 2 leaf projects). Not clear to me why "not found" and working

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2025, 1:52pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/4 "2025-01-16T13:52:04Z")

</div>

> [@e.cutino](#):
>
> timer scrips are ok in a parent project

No, not those either. Don't put **any** event scripts in a parent project. The **project library** function that is used as a one-liner can be in a parent project script, but the event itself, that calls the library function, must be in a leaf project to be reliable.

> [@e.cutino](#):
>
> Not clear to me why "not found" and working

Not clear to me either, and it probably only works by accident in your specific case, and is likely a bug. Which will break your kit when it is fixed.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 2:11pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/5 "2025-01-16T14:11:48Z")

</div>

Sorry Phil:

- the manual here [Project Inheritance | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/projects/project-inheritance) is doing the example exactly with tag change scripts. Clear the case with 2 leafs and the need to create a separate project. But with 1 leaf it seems (by manual) not being a problem having just 1 instance running. So: in any case not to be considered/to avoid?
- I don't understand what is related to "Project Library". The script (timer, tag, message, ..) can exist without any function in the project library (as in my case). So not clear to me, sorry again, what you mean about.  
In any case, I tried to "override" bringing all the script in the child project and I get the same error, still all working... Maybe I have to drop all the scripts from the parent (also if not runnable?)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2025, 3:13pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/6 "2025-01-16T15:13:11Z")

</div>

> [@e.cutino](#):
>
> doing the example exactly with tag change scripts

Right, they are showing that they won't run in the parents, and if allowed to propagate to leaf projects, will run \ ***in duplicate** in all such leaf projects.

And all gateway events in a project are a _ **single** _ resource. They inherit or not _ **all together** _. (Supposedly fixed in v8.3.) Which means it is utterly useless/actively harmful to define events in inheritable projects. Either they will be ignored, or will run more than expected.

> [@e.cutino](#):
>
> can exist without any function in the project library

That doesn't mean it is a good idea. Gateway events, in particular, have very odd legacy python scope issues that are likely to break large event scripts. (Also supposed to be fixed in v8.3.)

Write your event scripts as project library functions. Place constants and imports outside the functions, so they can be re-used instead of re-executed. Place all `def` statements outside other functions, except for short stubs used to capture values in _closures_.

Call your project library event functions from one-liners in the event definition. Far more efficient and maintainable. Do this especially for gateway events, but also for UI events, change scripts, and transforms.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 3:23pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/7 "2025-01-16T15:23:59Z")

</div>

Very clear now, thanks.

I leverage pleanty of functions in library. Indeed the specific message handler was 3 rows and not reusable.

In any case: I moved ALL the gateway scripts to a 3rd stand-alone (=not ineheritable) project and referenced the library in gateway settings for proper gateway event scope.

The message regarding the message handler is no longer present.

Many thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 16, 2025, 4:24pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/8 "2025-01-16T16:24:01Z")

</div>

Just here to confirm that both things Phil called out are definitely fixed in 8.3; event scripts are now distinct resource types with a more standard tabbed editor pattern, subject to inheritance/overriding individually, and follow modern scoping rules.

You will have to perform a one-time, semi-automatic "migration" process after upgrading that will convert your legacy event scripts to the modern format.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2738c0b716dfb816adeda493286405c03f6dee9.png)

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [January 16, 2025, 4:45pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/9 "2025-01-16T16:45:09Z")

</div>

Not having a popup and folders makes my heart happy!

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 5:22pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/10 "2025-01-16T17:22:24Z")

</div>

Tks both for your help.  
I have one more problem, in the following context:

- an inheritable project ‘P’, having its project library, with several functions
- a child ‘C’ project where all is working properly
- a standalone ‘SA’ project that is calling functions in the ‘P’ project.  
Despite having put the ‘P’ project in the gateway global scripting field (in the gateway setting page), whenever the ‘SA’ project is calling a function that is out of its scope, the script is going in error.  
Looking at the error, the ‘SA’ project is looking only in its scope and not in the ‘P’ project scope.  
Bottom line: the ‘SA’ project is not finding a function as indicated in the global scripting project field in the gateway settings.  
How can I fix that?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 16, 2025, 5:24pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/11 "2025-01-16T17:24:43Z")

</div>

> [@e.cutino](#):
>
> Bottom line: the ‘SA’ project is not finding a function as indicated in the global scripting project field in the gateway settings.  
> How can I fix that?

You can't, that's not what the setting does. It's not "global scripting project", it's _gateway_ scripting project. It's the project that things like tags can reference, because they don't belong to a project.

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 6:01pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/12 "2025-01-16T18:01:55Z")

</div>

So, if I properly understand, a timer script in a project ‘SA’ is not able to access functions in a project library of a project ‘P’, despite being the project ‘P’ referenced in the gateway script project (sorry, gateway scripting not global)?  
Therefore, is the gateway scripting field useful only for tags and not for other gateway events?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2025, 6:36pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/13 "2025-01-16T18:36:18Z")

</div>

> [@e.cutino](#):
>
> not for other gateway events?

Basically. There are miscellaneous uses, like IdP expressions that use `runScript()`, and I use it in my EtherNet/IP driver for communication event handling.

Any scripting where the origin call is inside a project strictly uses that project's inheritance chain for its library scripts. Arrange for "SA" to also inherit from "P". 🤷‍♂️

For more complex situations, consider something like this:

> [@Where do/should Gateway Scripts live with respect to an inherited project structure?](https://forum.inductiveautomation.com/t/where-do-should-gateway-scripts-live-with-respect-to-an-inherited-project-structure/83460/3):
>
> Put all of the logic in project library scripts, in the "universe" project at the root of your hierarchy, if you must. Then, in leaf projects, use one-line calls to the appropriate logic from event scripts and message handlers. (I don't agree with your desire, but this is what you must do to achieve it.) I recommend you not put all your scripts (eggs) in one inheritable project (basket). I recommend a hierarchy something like this: universe ├bg\_common │├gsp │├background1 │├background2 │└we…

For compatibility with v7.9 upgrades, the gateway scripting project is the only project that can be both inheritable and have runnable library functions. (Though it otherwise doesn't run.)

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [January 16, 2025, 11:12pm UTC](https://forum.inductiveautomation.com/t/message-handler-issue-reported-as-not-found-in-the-client-console-but-triggered/100965/14 "2025-01-16T23:12:06Z")

</div>

Crystal clear and really interesting.

I sorted out all the stuff.

Thx again
