# Problems installing direct payment app locally

**URL:** <https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941>\
**Category:** Questions\
**Tags:** litium-8\
**Created:** [May 9, 2023, 11:58am UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941 "2023-05-09T11:58:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 9, 2023, 11:58am UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/1 "2023-05-09T11:58:14Z")

</div>

I’m having problems installing the direct-payment app locally. Web is running without problems on local IIS.

Docker images are setup like suggested in [Shared dependencies (litium.com)](https://docs.litium.com/platform/get-started/shared-dependencies). Dnsresolver dns is changed to 192.168.65.7 as I’m running latest Docker (4.19.0).

Payment app Docker image is setup by this:

> direct-payment:  
> image: registry.litium.cloud/apps/direct-payment:1.3.0  
> dns:  
> - 192.168.65.2  
> restart: unless-stopped  
> ports:  
> - “10010:80”  
> - “10011:443”  
> environment:  
> # Enable HTTPS binding  
> - ASPNETCORE\_URLS=https://+;http://+  
> - ASPNETCORE\_HTTPS\_PORT=10011  
> # Configuration for HTTPS inside the container, exported dotnet dev-certs with corresponding password  
> - ASPNETCORE\_Kestrel\_\_Certificates\_\_Default\_\_Password=xxx  
> - ASPNETCORE\_Kestrel\_\_Certificates\_\_Default\_\_Path=/https/localhost.pfx  
> # Folder for the configuraiton, this is volume-mapped  
> - CONFIG\_PATH=/app\_config  
> # Folder where logfiles should be placed, this is volume-mapped  
> - APP\_LOG\_PATH=/logs  
> # Don’t validate certificates  
> - AppConfiguration\_\_ValidateCertificate=false  
> # Url to this app  
> - AppMetadata\_\_AppUrl=[https://direct-payment.localtest.me:10011](https://direct-payment.localtest.me:10011)  
> # Url to the litium installation  
> - LitiumApi\_\_ApiUrl=[https://softubelitium8.localtest.me](https://softubelitium8.localtest.me)  
> volumes:  
> - ./data/direct-payment/config:/app\_config  
> - ./data/direct-payment/data:/app\_data  
> - ./data/direct-payment/logs:/logs  
> - ./data/direct-payment/DataProtection-Keys:/root/.aspnet/DataProtection-Keys  
> - ./data/https:/https:ro

When running [https://direct-payment.localtest.me:10011](https://direct-payment.localtest.me:10011) as a logged in backoffice user with all permissions I get “The app could not be installed” message in backoffice and errors in the logs.

Payment app Docker image log says:

> 2023-05-09 11:25:18.6550 [App:01] [5f9e913c2206d1880406ce52c9280874] [ERROR] [.NET ThreadPool Worker] Microsoft.AspNetCore.Server.Kestrel - Connection id “0HMQGG05LFTC4”, Request id “0HMQGG05LFTC4:00000002”: An unhandled exception was thrown by the application. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘System.String’.  
> —\> System.IO.IOException: IDX20804: Unable to retrieve document from: ‘System.String’.  
> —\> System.Net.Http.HttpRequestException: Resource temporarily unavailable ([softubelitium8.localtest.me:443](http://softubelitium8.localtest.me:443))

Web log says:

> 2023-05-09 13:25:08.4650 [App:01] [5f9e913c2206d1880406ce52c9280874] [INFO] [.NET ThreadPool Worker] System.Net.Http.HttpClient.Default.LogicalHandler - Start processing HTTP request GET [https://direct-payment.localtest.me:10011/api/litium-app/metadata](https://direct-payment.localtest.me:10011/api/litium-app/metadata)  
> 2023-05-09 13:25:08.4650 [App:01] [5f9e913c2206d1880406ce52c9280874] [TRACE] [.NET ThreadPool Worker] System.Net.Http.HttpClient.Default.LogicalHandler - Request Headers:  
> Authorization: \*
> 
> 2023-05-09 13:25:08.4650 [App:01] [5f9e913c2206d1880406ce52c9280874] [INFO] [.NET ThreadPool Worker] System.Net.Http.HttpClient.Default.ClientHandler - Sending HTTP request GET [https://direct-payment.localtest.me:10011/api/litium-app/metadata](https://direct-payment.localtest.me:10011/api/litium-app/metadata)  
> 2023-05-09 13:25:08.4650 [App:01] [5f9e913c2206d1880406ce52c9280874] [TRACE] [.NET ThreadPool Worker] System.Net.Http.HttpClient.Default.ClientHandler - Request Headers:  
> Authorization: \*
> 
> 2023-05-09 13:25:16.9661 [App:01] [c4403b8a1d57a0c7babb3618571d7e62] [DEBUG] [.NET ThreadPool Worker] Quartz.Core.QuartzSchedulerThread - Batch acquisition of 0 triggers  
> 2023-05-09 13:25:18.6612 [App:01] [5f9e913c2206d1880406ce52c9280874] [INFO] System.Net.Http.HttpClient.Default.ClientHandler - Received HTTP response headers after 10189.6351ms - 500  
> 2023-05-09 13:25:18.6612 [App:01] [5f9e913c2206d1880406ce52c9280874] [TRACE] System.Net.Http.HttpClient.Default.ClientHandler - Response Headers:  
> Date: Tue, 09 May 2023 11:25:17 GMT  
> Server: Kestrel  
> Content-Length: 0
> 
> 2023-05-09 13:25:18.6612 [App:01] [5f9e913c2206d1880406ce52c9280874] [INFO] System.Net.Http.HttpClient.Default.LogicalHandler - End processing HTTP request after 10224.4769ms - 500  
> 2023-05-09 13:25:18.6612 [App:01] [5f9e913c2206d1880406ce52c9280874] [TRACE] System.Net.Http.HttpClient.Default.LogicalHandler - Response Headers:  
> Date: Tue, 09 May 2023 11:25:17 GMT  
> Server: Kestrel  
> Content-Length: 0
> 
> 2023-05-09 13:25:18.6684 [App:01] [5f9e913c2206d1880406ce52c9280874] [ERROR] Litium.Web.Administration.WebApi.Settings.Controllers.AppManagementController - Could fetch app metadata ‘[https://direct-payment.localtest.me:10011/api/litium-app/metadata](https://direct-payment.localtest.me:10011/api/litium-app/metadata)’. System.ArgumentException: Was not able to fetch app metadata from [https://direct-payment.localtest.me:10011/api/litium-app/metadata](https://direct-payment.localtest.me:10011/api/litium-app/metadata)  
> at Litium.Application.AppManagement.AppManagementServiceImpl.GetMetadataAsync(String url)  
> at Litium.Web.Administration.WebApi.Settings.Controllers.AppManagementController.InstallGet(String url)

Anyone who has an idea of what’s wrong?

Litium version: 8.9.0

---

<div class="post-metadata">

**Author:** ![joelS](https://avatars.discourse-cdn.com/v4/letter/j/c68b51/32.png) [@joelS](https://forum.litium.com/u/joelS)\
**Post date:** [May 9, 2023, 12:37pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/2 "2023-05-09T12:37:38Z")

</div>

I am on 8.9.1. I’m doing the tutorial.

Not sure if I had the same issue, but required changes for me was:

- dns in shipment & payment to 192.168.65.7
- LitiumApi\_\_ApiUrl in shipment & payment to [https://host.docker.internal:5001](https://host.docker.internal:5001)
- Windows hosts file added 127.0.0.1 host.docker.internal

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 9, 2023, 1:49pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/3 "2023-05-09T13:49:26Z")

</div>

Thanks, I guess that might work if you’re running the Litium website on localhost:5001 but I’m not.

LitiumApi\_\_ApiUrl should, if I understand correctly, point to the url of the website. That seems to work fine since I’m redirected from the app to backoffice of my website when going to the url in AppMetadata\_\_AppUrl.  
The problem seems to be that the app doesn’t serve the metadata because of an error that’s seen in the app log.

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 9, 2023, 2:08pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/4 "2023-05-09T14:08:49Z")

</div>

I’ve also tried it on a 8.8.0 standard Litium Accelerator, also running on IIS, and I get the exact same thing on that.

---

<div class="post-metadata">

**Author:** ![dan.bergman](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dan.bergman](https://forum.litium.com/u/dan.bergman)\
**Post date:** [May 9, 2023, 2:51pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/5 "2023-05-09T14:51:08Z")

</div>

Follow Martins “guide” here

> [@The app could not be installed - again (DirectPay)](https://forum.litium.com/t/the-app-could-not-be-installed-again-directpay/2906):
>
> From time to time, we still get the issue as described in this thread: [The app could not be installed - still](https://forum.litium.com/t/the-app-could-not-be-installed-still/2864) The solution I posted did not work for another project, so it must have been a coincidence. The list of solutions we’ve tried from the other thread still applies: Using a clean docker-compose.yaml file from the docs Only defining dnsresolver together with the DirectPay app in docker compose Changing the dnsresolver ip from 192.168.65.5 to 192.168.65.7 as per the docs Tried with both [l…](http://localtest.me/)

and , the apps are dependant on the litium versions… the latest klarna app will not work with litium 8.8 so you need to modify the compose file…

---

<div class="post-metadata">

**Author:** ![Spotonkastebo](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/spotonkastebo/32/717_2.png) [@Spotonkastebo](https://forum.litium.com/u/Spotonkastebo)\
**Post date:** [May 10, 2023, 8:25am UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/6 "2023-05-10T08:25:51Z")

</div>

That is a important point. Making sure that the app version works with your Litium version is important because neither Litium nor the app will tell you this in the error messages.

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 10, 2023, 11:41am UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/7 "2023-05-10T11:41:49Z")

</div>

I’ve tried 1. Removed/commented out the DNS-entry completely, didn’t make any difference.

Can’t do 2. since my solution is running in local IIS.

I’ve done the reinstall/install steps so many times now, trying different things, I can’t even count them. No progress.

I get that that there are dependencies between versions. I’m trying to install the latest version of the Direct Payment app, 1.3.0 and I haven’t found anywhere what Litium version it works with. But I assume that since that was released in October 2022 and the versions of Litium I’ve tried install it on, standard Litium Accelerator 8.8 and our own solution based on 8.9, are both released in 2023, that they would work together.

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 10, 2023, 12:25pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/8 "2023-05-10T12:25:04Z")

</div>

Would be great with some input from the Litium people here. What inside the Direct Payment app triggers these errors to be thrown? @patric.forsgard @utku @anusha.ganegoda or anyone else? Looks to be something with Authentication but it’s not clear what.

> 2023-05-10 07:05:22.5132 [App:01] [55fcb3fd3f570894582149e53de0e008] [ERROR] [.NET ThreadPool Worker] Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler - Exception occurred while processing message. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘System.String’.  
> —\> System.IO.IOException: IDX20807: Unable to retrieve document from: ‘System.String’. HttpResponseMessage: ‘System.Net.Http.HttpResponseMessage’, HttpResponseMessage.Content: ‘System.String’.  
> at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)  
> at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)  
> at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)  
> at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()

> 2023-05-10 07:05:22.5271 [App:01] [55fcb3fd3f570894582149e53de0e008] [ERROR] [.NET ThreadPool Worker] Microsoft.AspNetCore.Server.Kestrel - Connection id “0HMQH4JLQF9HL”, Request id “0HMQH4JLQF9HL:00000002”: An unhandled exception was thrown by the application. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘System.String’.  
> —\> System.IO.IOException: IDX20807: Unable to retrieve document from: ‘System.String’. HttpResponseMessage: ‘System.Net.Http.HttpResponseMessage’, HttpResponseMessage.Content: ‘System.String’.  
> at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)  
> at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)  
> at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel) --- End of inner exception stack trace --- at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)  
> at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()  
> at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()  
> at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync() at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme) at Microsoft.AspNetCore.Authorization.Policy.PolicyEvaluator.AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

---

<div class="post-metadata">

**Author:** ![dan.bergman](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dan.bergman](https://forum.litium.com/u/dan.bergman)\
**Post date:** [May 10, 2023, 12:39pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/9 "2023-05-10T12:39:19Z")

</div>

I have starting to get the same errors , and it doesnt matte if its direct pay/shipment or klarna… all logs basicaly the same thing… All have that strange Unable to obtain configuration from: ‘System.String’ message…

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 10, 2023, 12:48pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/10 "2023-05-10T12:48:29Z")

</div>

Interesting. How are you running your web application on your development machine?

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [May 10, 2023, 12:57pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/12 "2023-05-10T12:57:40Z")

</div>

Can you run “nslookup [softubelitium8.localtest.me](http://softubelitium8.localtest.me/) 127.0.0.1” in a command window and see what ip you get for your host.docker.internal?

---

<div class="post-metadata">

**Author:** ![dan.bergman](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@dan.bergman](https://forum.litium.com/u/dan.bergman)\
**Post date:** [May 10, 2023, 1:04pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/13 "2023-05-10T13:04:52Z")

</div>

We found it… or neriks did actually, the docker compose file needs the dns record again… atleast when you run the site in IIS

add the two lines  
dns:  
- 192.168.65.254  
Directly under Image for both payment and shipment…

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [May 10, 2023, 1:08pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/14 "2023-05-10T13:08:07Z")

</div>

Change all 192.168.65.2 to 192.168.65.254 in that case. This works if your nslookup returns 192.168.65.254 for your host.docker internal. Otherwise use the ip that nslookup returns for your host.docker.internal

---

<div class="post-metadata">

**Author:** ![niklas\_rove](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@niklas\_rove](https://forum.litium.com/u/niklas_rove)\
**Post date:** [May 10, 2023, 1:12pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/15 "2023-05-10T13:12:35Z")

</div>

> [@utku](#):
>
> 192.168.65.254

Also maybe worth checking the IP in case you have some different company policy changing the DNS like it did for us.

We ran (for the local IIS binding [litium.localtest.me](http://litium.localtest.me)):  
PS C:\> nslookup [litium.localtest.me](http://litium.localtest.me) 127.0.0.1  
Server: localhost  
Address: 127.0.0.1

Non-authoritative answer:  
Name: host.docker.internal  
Address: 192.168.65.254  
Aliases: [litium.localtest.me](http://litium.localtest.me)

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 10, 2023, 1:14pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/16 "2023-05-10T13:14:37Z")

</div>

I get this.

> Server: localhost  
> Address: 127.0.0.1
> 
> Non-authoritative answer:  
> Name: host.docker.internal  
> Address: 192.168.65.254  
> Aliases: [softubelitium8.localtest.me](http://softubelitium8.localtest.me)

No idea what 192.168.65.254 is. I get “Request timed out” when I ping it.

---

<div class="post-metadata">

**Author:** ![niklas\_rove](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@niklas\_rove](https://forum.litium.com/u/niklas_rove)\
**Post date:** [May 10, 2023, 1:24pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/17 "2023-05-10T13:24:54Z")

</div>

Same for me, but it works when you use it to install these apps 🙂

---

<div class="post-metadata">

**Author:** ![samuel](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/samuel/32/479_2.png) [@samuel](https://forum.litium.com/u/samuel)\
**Post date:** [May 10, 2023, 1:31pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/18 "2023-05-10T13:31:55Z")

</div>

Ok, that seems to work. I notice that my elasticsearch also has dns: 192.168.65.2 but that seems to be working fine. Not sure if I need to change that as well and recreate the Docker container for that?

Anyway, thanks @utku for the solution.

---

<div class="post-metadata">

**Author:** ![niklas\_rove](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@niklas\_rove](https://forum.litium.com/u/niklas_rove)\
**Post date:** [May 10, 2023, 1:37pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/19 "2023-05-10T13:37:13Z")

</div>

I needed to make the same change for ElasticSearch as well. It threw an exception when trying to rebuild the indices offline. Complaining about some Synonym key. But works as intended after the dns change.

---

<div class="post-metadata">

**Author:** ![utku](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/utku/32/62_2.png) [@utku](https://forum.litium.com/u/utku)\
**Post date:** [May 10, 2023, 1:39pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/20 "2023-05-10T13:39:02Z")

</div>

As I wrote before, change all 198.168.65.2 to 192.168.65.254 and recreate the containers. Elastic search works probably since there is no call to Litium from elasticsearch.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [June 7, 2023, 1:39pm UTC](https://forum.litium.com/t/problems-installing-direct-payment-app-locally/2941/21 "2023-06-07T13:39:44Z")

</div>

Closed on June 7, 2023, 1:39pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
