License errors

Failed to call the license server API

When running the installable cloud app, the Web API console displays the following error:

2021-01-27 01:28:32,094 ERROR PowerServer.Client.PowerServerClient.LogMessage [0] - MESSAGE: Failed to call the license server Api. 
(Error connecting to https://apipsoatest.appeon.com/.well-known/openid-configuration. A connection attempt failed because the 
connected party did not properly respond after a period of time, or established connection failed because connected host has failed 
to respond..)

Cause & Solution:

First, please note that it is possible that the PowerServer console may output the following error information but the application is still running properly. That is because the system allows a grace period in cases when PowerServer fails to validate the license. After the grace period, PowerServer will stop responding the requests from the application.

The error here indicates that PowerServer cannot connect to https://apipsoatest.appeon.com. However, according to the latest information in PB Help, PowerServer is required to connect to https://apips.appeon.com, https://apipsoa.appeon.com, https://apipsinfo.appeon.com, and https://api.appeon.com. The cause of the error must be, the PowerServer Runtime version is too old. You shall manually update the PowerServer.Core and PowerServer.Api NuGet packages to the latest version.

Failed to login the license server

When running the installable cloud app, the Web API console displays the following error:

2021-01-27 01:28:32,240 ERROR PowerServer.Client.PowerServerClient.LogMessage [0] - MESSAGE: License Exception: Failed to login the 
license server. (Invalid_client) at PowerServer.SessionFacade.CreateSessionIdAsync(String appName, String clientEncryptString, 
CancellationToken cancellationToken))

Cause & Solution:

The "invalid-client" error occurs because the license code is invalid or the license code cached in the system has expired. Please try the following:

  1. Check the license code included in the PowerServer project matches the one you obtained from the Appeon website;

  2. Clear the PowerServer cache and then build and run the Web APIs again;

    To clear the PowerServer cache, go to %SystemDrive%\Users\[username]\.nuget\packages, and delete the folders starting with "dwnet", "powerserver", "snapobjects", and "powerscript".

  3. Make sure that PowerServer is connecting to the correct license servers: https://apips.appeon.com, https://apipsoa.appeon.com, https://apipsinfo.appeon.com, and https://api.appeon.com. If not, update the PowerServer.Core and PowerServer.Api NuGet packages to the latest version.

Cannot access License.json

When the application is deployed to a subfolder under the IIS Web root, the first access to the application always failed while the subsequent access is successful.

Cause:

When tracking the request using Fiddler, the CreatedSession failed at the first access to the application, and the following error message is returned: errmsg=Access to the path 'C:\inetpub\wwwroot\App\AppConfig\License.json' is denied.

Solution 1:

Grant Internet Guest Account and IIS Process Account proper rights to manipulate the Web Root folder. Below are the detailed steps:

  1. Right-click on the C:\Inetpub\wwwroot folder. Select the Properties item and select the Security tab page;

  2. Add IIS_ISERS(or NETWORK SERVICE) if it is not listed in the box "Group or usernames";

  3. Grant Full Control permission to the IIS_ISERS (or NETWORK SERVICE).

  4. Restart the IIS server (iisreset.exe).

  5. If the issue persists, please try granting "everyone" user full control permission on the C:\inetpub\wwwroot\[appname] folder.

Solution 2:

Refer to the article below to set an account in the administrator group to the Identity property for DefaultAppPool: https://campuslogicinc.freshdesk.com/support/solutions/articles/5000713210-changing-identity-user-for-iis-application-pool.

Restart the IIS server (iisreset.exe).