Convert To Error with Kubernetes multi pods

Hello
We have a problem when saving documents from an iFrame, error 400 impossible to convert the file.
We are with a Kubernete and 5 pods behind.
When we have only one pod it works well, but since the load has increased we have this problem.
Someone to help us?

wsd-00001-00038 2022-11-07 16:45:51.636027 +0100 [ websrv_poll ] ERR  #76 Exception while processing incoming request: [GET /cool/https%3A%2F%2Fapi.MYDOMAIN.com%2Frestv3%2Fws%2Fwopi%2Ffiles%2FVEdWeklHUmxkbTlwY25NZ1EyeGhjM05sSURvZ05zT29iV1VnTXkxVWNtbHRaWE4wY21VZ01WOHlNREl5TVRFd056RTJORFV6TlE9PS54bHM%3D/download/PzaOWHbQDh5cQsoV2Q2KbFQJKu78lHuYKYeQ7cHTmcD8AElRZP3jTOrxMKFFpOYA?WOPISrc=https://api.MYDOMAIN.com/rest...]: DocKey [https://api.MYDOMAIN.com:443/restv3/ws/wopi/files/VEdWeklHUmxkbTlwY25NZ1EyeGhjM05sSURvZ05zT29iV1VnTXkxVWNtbHRaWE4wY21VZ01WOHlNREl5TVRFd056RTJORFV6TlE9PS54bHM=] is invalid.| wsd/COOLWSD.cpp:3757

Hello @pedro.silva
Do you know who can help me with Kubernetes ?
Tks

@lpranam Can you help me ?
I don’t know how to assigne wopisrc to the same pod ?
Tks

can you share more details about your configuration?

thanks

@lpranam Hello
We are testing with Kubernetes.
1 ingress and X pods depending on the load which are created automatically.
I have a wopisrc in my url.
When I have 2 - 3 or more pods created, I open my document and everything works, however if a second person tries to open it, sometimes they are not on the same pod and both people are not working on the same version. So when one saves, the other does not find its modifications and vice versa.
Also when I try to convert a .DOC to .PDF it happens that it works, and sometimes I get a 400 error.
Do you want me to share the conf of my ingress with you?
Thanks

yes if you could share that would be nice :slight_smile:

@lpranam

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-ssl-protocols: TLSv1.2 TLSv1.3
    nginx.ingress.kubernetes.io/affinity: cookie
    nginx.ingress.kubernetes.io/affinity-mode: persistent
  name: ingress
  namespace: libreoffice
spec:
  rules:
  - host: "libreoffice.mydomain.com"
    http:
      paths:
      - backend:
          service:
            name: libreoffice
            port:
              number: 9980
        path: /
        pathType: Prefix

I manage to save or print my documents, but sometimes two people are not on the same pod.
I think the wopisrc should be tracked in ingress, but I don’t see how to add it.

@lpranam
I just add this to the ingress-nginx, i’m testing it

    nginx.ingress.kubernetes.io/affinity: cookie
    nginx.ingress.kubernetes.io/affinity-mode: persistent
    nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"
    nginx.ingress.kubernetes.io/upstream-hash-by: "$request_uri$host"

I don’t know if it works yet.

in your case try

nginx.ingress.kubernetes.io/upstream-hash-by: "$arg_WOPISrc"

Thanks @lpranam
I’m testing this, and I’ll come back to report back.
Do you think it is important to reduce the lifetime of the cookie?
Thanks

@lpranam
Hello
I configured it as follows:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-ssl-protocols: TLSv1.2 TLSv1.3
    nginx.ingress.kubernetes.io/affinity: cookie
    nginx.ingress.kubernetes.io/session-cookie-max-age: "60"
    nginx.ingress.kubernetes.io/session-cookie-name: "LibreOffice"
#    nginx.ingress.kubernetes.io/session-cookie-samesite: "strict"
    nginx.ingress.kubernetes.io/affinity-mode: persistent
#    nginx.ingress.kubernetes.io/session-cookie-conditional-samesite-none: "true"
    nginx.ingress.kubernetes.io/upstream-hash-by: "$arg_WOPISrc"
#    nginx.ingress.kubernetes.io/upstream-hash-by-subset: "true"
#    nginx.ingress.kubernetes.io/upstream-hash-by-subset-size: "1"
  name: ingress
  namespace: collabora

But my cookie is configured with 2 arguments, the first changes and the second does not.
0e1a2df22555e7162d803b4470cc7e44|fe892daf2c71c7db8a54253a5e078490
I am sometimes on the same document, sometimes on a different one.
Do you have an idea ?
I turn around…

ideally, for nginx you don’t need cookies just the config which I pasted above is enough for routing correctly unless you are using cookies for something else.

Thank you, I just made the modification without COOKIE, and it seems to work correctly, I forced the creation of 4 pods and opened the same document with 6 people and they are all on the same document (so same pod), and I I opened another with 3 people and the same.
Again a big thank you.
On the other hand, is it possible to have information on the number of documents opened in full on all the pods?
Or way to know on which pod we are connected when we are in https://libreoffice.mydomain.combrowser/dist/admin/admin.html
Thanks in advance.