seaweedfs / seaweedfs-csi-driver

SeaweedFS CSI Driver https://github.com/seaweedfs/seaweedfs
Apache License 2.0
207 stars 49 forks source link

openldap wont start #162

Open psychomantys opened 4 months ago

psychomantys commented 4 months ago

I'm trying to use the openldap helm chart with a seaweed volume, but the ldap server is not starting. I've checked the logs and seen that the helm chart is successfully installed and configured, but the ldap server is not being started. The strange thing is that when I use a volume that's not from seaweed, the LDAP server starts without any issues.

I'm starting to think that the issue might be related to the seaweedfs volume, perhaps with the way the mdb is being used on top of the volume. However, I can't seem to find any logs or references that point to the root cause of the problem.

Has anyone else encountered this issue? Any help would be greatly appreciated.

Here are the logs from the LDAP server:

660e3a1e.3ad9cf10 0x7fd057985740 >>> dnNormalize: <cn=Uptime>
660e3a1e.3ad9db22 0x7fd057985740 <<< dnNormalize: <cn=uptime>
660e3a1e.3ad9f698 0x7fd057985740 >>> dnNormalize: <cn=Read>
660e3a1e.3ada01e2 0x7fd057985740 <<< dnNormalize: <cn=read>
660e3a1e.3ada1538 0x7fd057985740 >>> dnNormalize: <cn=Write>
660e3a1e.3ada1e20 0x7fd057985740 <<< dnNormalize: <cn=write>
660e3a1e.3ada31f8 0x7fd057985740 backend_startup_one: starting "dc=my-domain,dc=com"
660e3a1e.3ada3a05 0x7fd057985740 mdb_db_open: "dc=my-domain,dc=com"
660e3a1e.3add4a58 0x7fd057985740 mdb_db_open: database "dc=my-domain,dc=com": dbenv_open(/bitnami/openldap/data).

And here are the kustomize with the values.yaml for the helm chart of ldap:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - releaseName: openldap-stack-ha
    name: openldap-stack-ha
    version: 4.2.2
    repo: 'https://jp-gouin.github.io/helm-openldap/'
    includeCRDs: true
    namespace: openldap
    valuesInline:
      global:
        existingSecret: openldap-secret
        adminUser: ldapadmin
        configUser: ldapadminconfig
      env:
        LDAP_LOGLEVEL: "-1"
      persistence:
        enabled: true
      podAntiAffinityPreset: soft
chrislusf commented 4 months ago

could you make some docker compose file to reproduce this?

psychomantys commented 4 months ago

I can certainly provide access to the Kubernetes logs if that would be helpful for troubleshooting. Just let me know if you require any specific logs and I can ensure you get the necessary access on kubernetes.

For the docker-compose example, I can generate one for you. If you could provide an initial example to get the CSI initialized? That would be a great starting point. Any specific requirements or configurations you have in mind would also be useful to know.

psychomantys commented 3 months ago

I was trying to make a working example on a docker that demonstrates the integration of seaweed with openldap. The project's repository can be found here: poc-seaweedfs-openldap.

To get the proof of concept up and running, please refer to the init.sh script located at: init.sh.

In this setup, there are two different ldap containers being used:

Each of these stacks features two services:

I run some tests with strace and debug mode on ldap, and set ulimit -n 4000. As i can see, there is a great memory and CPU usage after a mmap, and some times a warning msg abount killed by SIGBUS (core dumped) Bus error (core dumped) and X ch_calloc of Y elems of Z bytes failed slapd: ch_malloc.c:107: ch_calloc: Assertion '0' failed..

I'd appreciate any insights or advice on resolving the issue with the fail service. If there's any additional information you require to assist me, please let me know, and I'd be more than happy to provide it.