I have a PowerShell module with a number of scripts that do REST calls to Epicor Functions so they can perform updates on a newly restored PILOT or TEST environment, the REST calls to these Functions do successfully trigger them run. I am now trying to call Ice.LIB.ClientFunctionSvc/SetIsProductionInstance and I get a error I cannot get past. I am able to successfully make the REST call using both Swagger and Postman and it update the Environment’s Production status.
Here is the PowerShell Script, the $pass and $user variables are set as global in the module and used for all other REST call that are working
function Remove-ProductionStatus {
[CmdletBinding()]
param(
[string] $AppEnv
)
$secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
$params = @{
'Uri' = 'https://[Epicor Server URL]/' + $AppEnv + '/api/v2/odata/GRC/Ice.LIB.ClientFunctionSvc/SetIsProductionInstance'
'Method' = 'POST'
'ContentType' = 'application/json'
'Headers' = @{'X-Api-key' = $token
'Accept'='application/json'}`
}
$body = @{ 'isProduction' = $false } | ConvertTo-Json
Invoke-WebRequest @params -Body $body -Credential $cred
Write-Host ' * Production status removed from Environment'
}
and I receive this
HTTP Error 500.0 - Internal Server Error
Internal Server ErrorMost likely causes:
IIS received the request; however, an internal error occurred during the processing o
f the request. The root cause of this error depends on which module handles the reque
st and what was happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site or application. This
can occur if the NTFS permissions are set incorrectly.
IIS was not able to process configuration for the Web site or application.
The authenticated user does not have permission to use this DLL.
The request is mapped to a managed handler but the .NET Extensibility Feature is not
installed.
Things you can try:
Ensure that the NTFS permissions for the web.config file are correct and allow access
to the Web server’s machine account.
Check the event logs to see if any additional information was logged.
Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped to a managed handler.
Create a tracing rule to track failed requests for this HTTP status code. For more in
formation about creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x800703e9
Requested URL https://epicortask.grandrapidschair.com:443/EpicorTest10/api/v2/odata
/GRC/Ice.LIB.ClientFunctionSvc/SetIsProductionInstance
Physical Path D:\Epicor\Websites\EpicorTest10\Server\api\v2\odata\GRC\Ice.LIB.Clien
tFunctionSvc\SetIsProductionInstance
Logon Method Anonymous
Logon User Anonymous
More Information:
This error means that there was a problem while processing the request. The request w
as received by the Web server, but during processing a fatal error occurred, causing
the 500 error.
View more information »
Microsoft Knowledge Base Articles:
294807
I did do a Failed Request Trace but I do not see anything that stands out to me on why it fails.
Thanks for any assistance.