The following error might occur when you run an installable cloud app: Session creation failed.
Cause:
-
The Web APIs has not been deployed to the specified website or the Web APIs has not started.
Solution: Make sure the Web APIs has been deployed and started.
Take the URL in the above error as an example, you can input http://localhost:5001/health-ui/ to verify the Web APIs has been deployed and started. If the page displays successfully, then the Web APIs has been deployed and started, otherwise, you will have to deploy and start the Web APIs.
-
The Web APIs is not on the same server as the client app.
Solution: If the Web APIs is not on the same server as the client app, then you cannot use "localhost"; you should use the IP address or host name of the server hosting Web APIs.
-
If the host server connects to Internet via a proxy server, then PowerServer Web APIs has to be configured with the proxy server as well.
Solution:
Open the PowerServer Web APIs > UserConfig.json file, and configure the proxy server settings in the "ProxyOptions" block. The password for the proxy server (if any) must be an encrypted value (encrypted by the CustomizeDeploy.dll tool).
... "ProxyOptions": { "Server": "", "Username": "", "Password": "" }, ...
Publish the PowerServer Web APIs to the server.
-
The version of ASP.NET Core Hosting Bundle does not match with the version of .NET framework used by Web APIs (which is 6.0 by default in PowerServer 2022 R3).
Solution:
Download and install ASP.NET Core Hosting Bundle 6.0.
Error:
Cause 1 & solution:
The Web API URL is incorrect. For example, there is redundant slash ("/") after the port number; correct: http://172.88.88.88:5000/..., incorrect: http://172.88.88.88:5000//....
Cause 2 & solution:
If using IIS, make sure 1) the web.config file exists under the web root or app base path; and 2) the handler path in the web.config file is incorrect.
If you create a new site (or sub-app), map the new site (or sub-app) to the site where web.config and Web APIs are deployed, and specify the URL of the new site (or sub-app) as the Web API URL, then you must also make sure the handler path includes the new site (or sub-app).
For example, you may have to change the path from
<handlers> <add name="aspNetCore" path="/api" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> <add name="aspNetCore2" path="/health-*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> <add name="aspNetCore3" path="/connect/token" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers>
To
<handlers> <add name="aspNetCore" path="/powerserver/ReportApiExample/api" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> <add name="aspNetCore2" path="/powerserver/ReportApiExample/health-*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> <add name="aspNetCore3" path="/powerserver/ReportApiExample/connect/token" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers>
The leading forward slash (/) indicates the root of the website, and the directory or virtual directory name is specified thereafter.
Error:
Cause:
Two applications under the same IIS website cannot use the same application pool.
Solution:
Step 1: Configure the two Web APIs to use different application pools. (Refer to this section for how to create and configure the application pool.)
Step 2: Restart the website.
Step 3: Double check that the Web API URL includes the API sub-folder name. (Refer to this section for detailed instructions.)
Error:
Cause:
The host name of the Web API does not match with the host name in the SSL server certificate. For example, if the server certificate is a self-signed certificate which works for "localhost" only, then you cannot use IP address or domain name in the Web API URL; you can only use "localhost" in the Web API URL.
Solution:
Make sure the host name of the Web API matches with the host name in the server certificate.
In the local development environment, if a self-signed certificate is used, you can change the Web API URL to use "localhost" instead of IP address or domain name; or if you want to use IP address or domain name, you can consider selecting the Ignore PowerServer Certificate option to ignore the error. For more, refer to Support HTTPS.
In the production environment, you should create a trusted CA signed certificate (instead of using a self-signed certificate).