fiskaltrust / product-de-bring-your-own-datacenter

Information about the fiskaltrust "Bring your own Data Center" product, which enables hosting the fiskaltrust.Middleware in data centers.
5 stars 2 forks source link

cashboxid not provided #34

Closed mgbarnech closed 3 years ago

mgbarnech commented 3 years ago

Describe the bug

We are trying to deploy local BYODC version 1.3.12-rc1-buster with the sandbox-helipad We have followed the instructions in https://github.com/fiskaltrust/product-de-bring-your-own-datacenter/blob/master/QuickStart.md with some changes. The "Test reachability in the Browser" was right but when we try to reach the endpoint /api/Echo with Postman the response is "cashboxid not provided"

To Reproduce

mysql: enabled: true

redis:

enable redis

enabled: true

ambassador:

installs ambassador

install: false config:

tls config. see https://www.getambassador.io/docs/latest/howtos/tls-termination/#create-a-self-signed-certificate for information about cert and key files.

# you can use `--set-file ambassador.config.tls.crt="./cert.pem"` to pass files to the helm command. please make sure the files start with `-----BEGIN [...]`.
# the cert file may also contain intermediate certificates
tls:
  # enables tls
  enabled: false
  # set cert as base64 encoded file contents
  crtBase64: null
  # set key as base64 encoded file contents
  keyBase64: null
  # set cert as file contents
  crt: null
  # set key as file contents
  key: null
# hostname by which ambasador is reachable
hostname: localhost

controls the replicacount of ambassador

replicaCount: 2


### Expected behaviour
Get the Echo response

### Screenshots

### Log file from all BYODC pods
#### Pods
`kubectl logs -l app=byodc -n bring-your-own-datacenter`

info: Microsoft.Hosting.Lifetime[0] Now listening on: http://[::]:80 info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /app warn: Microsoft.AspNetCore.HttpsPolicy.HttpsRedirectionMiddleware[3] Failed to determine the https port for redirect.


#### Cluster
`kubectl get all -n bring-your-own-datacenter`

NAME READY STATUS RESTARTS AGE pod/byodc-764f7c7b5c-mfcvq 1/1 Running 0 2d23h pod/byodc-764f7c7b5c-xld4c 1/1 Running 0 2d23h pod/mysql-5fcbd966bf-7ctjh 1/1 Running 0 2d23h pod/byodc-764f7c7b5c-5k6fl 1/1 Running 0 2d23h pod/byodc-764f7c7b5c-m6ms9 1/1 Running 0 2d23h pod/redis-69d445ff55-fjlfj 1/1 Running 0 2d23h pod/whoami-deployment-844cd9768c-fcj67 1/1 Running 0 3h13m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/byodc ClusterIP 10.43.218.181 80/TCP,443/TCP 2d23h service/mysql ClusterIP 10.43.115.8 3306/TCP 2d23h service/redis ClusterIP 10.43.80.62 6379/TCP 2d23h service/whoami-service ClusterIP 10.43.89.86 80/TCP 3h24m

NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/mysql 1/1 1 1 2d23h deployment.apps/byodc 4/4 4 4 2d23h deployment.apps/redis 1/1 1 1 2d23h deployment.apps/whoami-deployment 1/1 1 1 3h24m

NAME DESIRED CURRENT READY AGE replicaset.apps/mysql-5fcbd966bf 1 1 1 2d23h replicaset.apps/byodc-764f7c7b5c 4 4 4 2d23h replicaset.apps/redis-69d445ff55 1 1 1 2d23h replicaset.apps/whoami-deployment-844cd9768c 1 1 1 3h13m


### POSSystem (please complete the following information):

### Cashbox Information (please complete the following information):

    5e1ebae1-2635-47f4-8779-b1fcd1f1147c

### Additional context

#### Echo Endpoint

curl request to the /api/Echo Endpoint
`curl --location --request POST 'http://localhost:80/api/Echo' \--header 'cashboxid: 5e1ebae1-2635-47f4-8779-b1fcd1f1147c' \--header 'accesstoken: BPTSxxujC+XQvwfKkpeyXIHwR3A1e49HaXUtM6b5ZC8WzRtozpvZ5rAq867vALoQMAMbKJXkdkWRvQJcOxPlbBI=' \--header 'Content-Type: application/json' \--data-raw '{ "message": "hola"}'`

"cashboxid not provided"


#### Whoami Endpoint

We have our Echo Service behind the same LoadBalancer and when we request it all the headers are there
`curl --location --request POST 'http://localhost:80/whoami' \--header 'cashboxid: 5e1ebae1-2635-47f4-8779-b1fcd1f1147c' \--header 'accesstoken: BPTSxxujC+XQvwfKkpeyXIHwR3A1e49HaXUtM6b5ZC8WzRtozpvZ5rAq867vALoQMAMbKJXkdkWRvQJcOxPlbBI=' \--header 'Content-Type: application/json' \--data-raw '{ "message": "hola"}'`

Hostname: whoami-deployment-844cd9768c-fcj67 IP: 127.0.0.1 IP: ::1 IP: 10.42.0.149 IP: fe80::10e0:41ff:fe74:498b POST /whoami HTTP/1.1 Host: localhost User-Agent: curl/7.68.0 Content-Length: 20 Accept: / Accept-Encoding: gzip Accesstoken: BPTSxxujC+XQvwfKkpeyXIHwR3A1e49HaXUtM6b5ZC8WzRtozpvZ5rAq867vALoQMAMbKJXkdkWRvQJcOxPlbBI= Cashboxid: 5e1ebae1-2635-47f4-8779-b1fcd1f1147c Content-Type: application/json X-Forwarded-For: 10.42.0.139 X-Forwarded-Host: localhost X-Forwarded-Port: 80 X-Forwarded-Proto: http X-Forwarded-Server: traefik-7c5556d74c-w2hzf X-Real-Ip: 10.42.0.139

{ "message": "hola"}

fiskaltrust-ckr commented 3 years ago

Hi Martin, thanks for your inquiry. I tested your Cashbox in my Devenv and got a200 from the echo endpoint. So the configuration on our side seems to be ok. As I can see in your output, you are not using our loadbalancer. Keep in mind that you should be aware of header based routing (see our Operational Reference https://github.com/fiskaltrust/product-de-bring-your-own-datacenter/blob/master/OperationsReference.md#replace-abassador-loadbalancer) BR Christian

mgbarnech commented 3 years ago

Hi Christian ok, thanks for your answer