Epicor function failing - "Can't find function '{FunctionName}' in '{FunctionLibrary}' library"

Has anyone seen this before? I’m executing a valid function. The library is promoted, and it compiles just fine. But then it fails if called from an App, and fails when run through Schedule Epicor Function.

Steps I have tried:

  • demoting / promoting
  • demoting > change the function > save > re-promote
  • Export library > re-import with Force Upgrade selected

Error:

Exception executing library ‘rob-appfunctions’ function ‘GetNetWeight’:
System.InvalidOperationException: Can’t find function ‘GetNetWeight’ in ‘rob-appfunctions’ library
at Epicor.Functions.Runtime.EfxRuntimeExtensions.GetFunctionInfo(IFunctionsCatalog functionsCatalog, FunctionRefId refId, String forCompany) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Customization\Epicor.Functions.Runtime\EfxRuntimeExtensions.cs:line 35
at Ice.Internal.Task.ScheduledFunction.ExecuteFunction.GetFunctionAdapter(String libraryId, String functionId) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Internal\Task\ScheduledFunction\ExecuteFunction.cs:line 117
at Ice.Internal.Task.ScheduledFunction.ExecuteFunction.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ICE\ICE5.0.100.0\Source\Server\Internal\Task\ScheduledFunction\ExecuteFunction.cs:line 52

Just tested another function in the same library, and it executed without any issue.

1 Like

Is the function marked as internal?

You have an internal flag at library and function level. When selected it stops it from being run ‘externally’ which includes the API which app studio uses.

Makes it available to BPMs, other functions and schedules.

1 Like

Neither the function nor the Library are marked as Internal only.

Additionally, all companies are authorized, my user is the owner, and it’s shared with EFx Power Developer.

Recycle your app pool (restart site)

If that works, i’ll find the case/prb for you to reference.. whee!

PRB0288709 .. now over a year old! I even ran into this error on a call with daniel @ epicor cs.. i had to find the prb and inform him to recycle the app pool on his local instance to import a function in one of my cases.

I asked him to follow up on that, since he was able to replicate it himself without even trying (we were working on an unrelated case)

My favorite line from that PRB: “This issue is not always reproducible. But it has been reported by many customers, we do not know what causes it, but we know that an app restart fixes it.”

3 Likes

Apologies I missed that you had already tried scheduling it.

Only other time I have seen
something like this is when the app servers got out of sync. Which an app server recycle could fix either through Epicor support or the CMP

Yep, App Pool Recycle did the job. Thank you Gabe!

I know of at least one customer, that has to restart it EVERY time they edit a function…

:dumpster_fire:

1 Like

I never had the issue before today. Now I’m terrified it’s going to do the same thing.

1 Like

Please open a case for it and reference the PRB, you never know, it might get somewhere everyone else’s didn’t! So far, I’ve only run into the issue on my environment twice in 6 months, fingers crossed it doesnt happen again.

It’s much more insidious if you are editing an existing function, because it saves without error, it will just execute the old code. so you’ll be pulling your hair out for a while before you make it change some logging output and realize nothing is taking effect. quite fun!

1 Like