Unknown Rest Exception Not Found

Our tech partner moved functions to Production and we are getting the following error.

The weird part is - they work if I demote them.

The other strange part is we are now getting the same error in Production and Pilot - they work if I demote them which makes no sense. We are on prem and the server has not been changed.

Application Error

Exception caught in: Epicor.Ice.Lib.RestClient

Error Detail

Message: Unknown REST exception:
Not Found
Program: Epicor.Ice.Lib.RestClient.dll
Method: MoveNext

Client Stack Trace

at Ice.Lib.RestClient.ResilientCaller.d__10.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Ice.Lib.RestClient.ResilientCaller.d__6.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Ice.Lib.RestClient.AsyncToSyncHelper.DoSynchronous[TResult](Task1 task) at Ice.Lib.RestClient.RestClient.Ice.Lib.RestClient.IRestFunctionCaller.Post(String library, String function, RestContent content, Boolean published, IEnumerable1 headers)
at Script.btnPKExport_Click(Object sender, ToolClickEventArgs e)
at Infragistics.Win.UltraWinToolbars.ToolBase.OnToolClick(ToolClickEventArgs e)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnToolClick(ToolClickEventArgs e)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.FireEvent(ToolbarEventIds id, EventArgs e)
at Infragistics.Win.UltraWinToolbars.ToolBase.OnToolClick()
at Infragistics.Win.UltraWinToolbars.ToolMenuItem.OnClick()
at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.DoClickProcessing(MouseEventArgs e)
at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.OnMouseUp(MouseEventArgs e)
at Infragistics.Win.TextUIElementBase.OnMouseUp(MouseEventArgs e)
at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e)
at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e)
at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
at Infragistics.Win.UltraWinToolbars.PopupControlBase.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

If they work demoted that means that the invokation of them is using the /staging/ url. How are these being invoked?/ Called

They are calling it through C# code - I can confirm that it matches the code that was working last week but it is very odd to see a function invoked this way. I changed the ApiKey and credentials to protect the credentials

It is a one company setup

using (var client = new RestClientBuilder().SetAppServerUrl(oTrans.CoreSession.AppServer).SetCompanyId(oTrans.CoreSession.CompanyID).SetDefaultApiKey(“xxxAPIkey”).UseBasicAuthentication(“UserID”, “password”).Build()){

If it works while its demoted its casue the system is invoking the staging endpoint. Though I don’t see anything in your code that says it.

Is Company Security Tab setup?

The bad part is that I did not write it. By company security do you mean in the function yeah. The owner is the tech partner and it shares with the admin group. I’m frankly puzzled it was working on Friday and now it is not. On Friday the tech partner moved the function to production and it is no longer working and they are stating that they did nothing wrong.

We figured it out. The code invoking the function is asking it to not run promoted. Once that lightbulb went off it was crystal clear. I’ve been using cloud for 6 years and never thought of not promoting things or running them any other way.