#1068865 gosa: Setup failure: "PHP Fatal error: Uncaught TypeError: ldap_get_entries()"

#1068865#5
Date:
2024-04-12 11:59:39 UTC
From:
To:
Dear Maintainer,

thank you for maintaining gosa!

I just run the web-based setup procedure of gosa in Debian Bookworm.
Quite early I received the following error:

PHP Fatal error:  Uncaught TypeError: ldap_get_entries(): Argument #2 ($result) must be of type LDAP\\Result, bool given in /usr/share/gosa/include/class_ldap.inc:1525\nStack trace:\n#0 /usr/share/gosa/include/class_ldap.inc(1525): ldap_get_entries()\n#1 /usr/share/gosa/setup/class_setupStep_Ldap.inc(73): LDAP::get_naming_contexts()\n#2 /usr/share/gosa/setup/class_setup.inc(79): Step_Ldap->execute()\n#3 /usr/share/gosa/setup/main.inc(29): setup->execute()\n#4 /usr/share/gosa/html/setup.php(123): require_once('...')\n#5 {main}\n  thrown in /usr/share/gosa/include/class_ldap.inc on line 1525, referer: https://accounts.silicann.systems/setup.php

According to the environment settings visible in the apache2 log, the
culprit seems to be the assumption, that a local LDAP server is
available:

  ldap_connect_to_host: TCP localhost:389

Maybe the setup procedure does not deal with a remote LDAP server gracefully?

My workaround was a temporary `ssh -R ...` port forwarding between the
remote LDAP server and the local host running gosa.
The following setup screen allowed me to configure the real LDAP URI.

Thanks for your time,
Lars