OSTicket version 1.16.3
PHP version 8.0.20
Apache version 2.4.37
MySQL version 10.3.32

I have the LDAP Authentication and Lookup 0.6.2 plugin installed. When I try to check the TLS box and save the settings, I get a 500 server error. I read a bunch of the forums of similar issues and have tried pretty much everything in them and it still fails out. Saving the settings without the TLS checkbox checked works with no issue.

The error message in my php error log is as follows:

PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367

This issue still persists. I have downloaded the latest LDAP Authentication and Lookup plugin from here -- https://osticket.com/download -- and dropped it in my /var/www/osticket/upload/include/plugins folder.

This is happening on both a RHEL8 VM and a RHEL7 VM. Below is the full stack trace.

What am I missing here?

PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367
Stack trace:
#0 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()
#1 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()
#2 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->construct()
#3 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()
#4 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()
#5 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()
#6 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Schema.php(136): Net_LDAP2->rootDse()
#7 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1563): Net_LDAP2_Schema::fetch()
#8 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(360): Net_LDAP2->schema()
#9 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()
#10 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->
construct()
#11 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()
#12 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()
#13 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(1505): Net_LDAP2_RootDSE::fetch()
#14 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(620): Net_LDAP2->rootDse()
#15 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(444): Net_LDAP2->startTLS()
#16 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2.php(339): Net_LDAP2->performConnect()
#17 phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/config.php(189): Net_LDAP2->bind()
#18 /var/www/osticket/upload/include/class.plugin.php(77): LdapConfig->pre_save()
#19 /var/www/osticket/upload/include/class.plugin.php(67): PluginConfig->commitForm()
#20 /var/www/osticket/upload/scp/plugins.php(13): PluginConfig->commit()
#21 {main}
thrown in phar:///var/www/osticket/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php on line 367

This is the only post on the forums that I can find with this error in it.
So I would think that the issue is with your environment.
Are you sure that you are running a non PHP 8.1 version of PHP 8?

Yes, I am sure. I am running PHP version 8.0.20.

I found this commit -- https://github.com/osTicket/osTicket-plugins/tree/develop/auth-ldap -- that shows support for PHP 8. But the master branch has not been updated in 9 years -- https://github.com/osTicket/osTicket-plugins/tree/master/auth-ldap. The changes made in that above commit are the fixes to my errors.

Why is that version not available at https://osticket.com/download?

    ekondor22

    We aren’t your typical repo; we don’t go off of master for the plugins nor the core code.

    The changes you referenced are in fact merged and available in the current version of the plugin available for download on our website.

    Cheers.

    I visited -- https://osticket.com/download -- clicked on Plugins, dropped down osticket version to 1.16.3 and those changes were not in the version that was downloaded. So I would double check that the plugin version available for download is the updated version.

    We extracted the phar, made the changes to authentication.php and the Entry.php and it's now working as expected.

    This can be marked as resolved.

      ekondor22

      It's probably an issue with our downloader as we recently changed this to support "versioned" plugins. We will take a look at this.

      Cheers.

      I just went to the website and downloaded the LDAP plug in. When I try to login with LDAP I get a 500 error and I still get 500 error when I enable TLS. I did also delete the plug in and removed the phar file and reuploaded it and tried fresh again but it still gives me the following 500 error. I do have LDAP PHP extension installed and enabled that I can see in my PHP information file. I am also running PHP 8.0 and on Version. Is there anything else I can check? Is it possible that the new version of the LDAP plugin is not uploaded to the download site?

      [Wed Jun 22 17:15:41.874983 2022] [proxy_fcgi:error] [pid 1554] [client 192.168.1.13:59173] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367\nStack trace:\n#0 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()\n#1 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#2 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->__construct()\n#3 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#4 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#5 phar:///var/www/html/...', referer: https://helpdesk.shookhome.org/scp/plugins.php?id=5

      Hello,
      just want so say that I get an similar issue after upgrading from 1.16.2 to 1.16.3 today.
      The ldap agent login was not possible, so i have to login with the local admin.
      After disabling the TLS checkbox the agent login was possible again, but the user login not. (Error 500 appears)
      Further the LDAP search doesn't work anymore, so i did an downgrade to 1.16.2

      My Config: IIS / PHP 8.0.20

      best regards

        @joshw12 Garasul

        That's odd as I tested the download yesterday and it included the updated code. Did you go to the Plugins tab, select 1.16.x, and download the LDAP plugin?

        Cheers.

          KevinTheJedi I did yes and I even removed the plug in files compeltely from our server and installed it fresh and configured the information from scratch.

          AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ArgumentCountError: ldap_first_attribute() expects exactly 2 arguments, 3 given in phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php:367\nStack trace:\n#0 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(367): ldap_first_attribute()\n#1 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(179): Net_LDAP2_Entry->setAttributes()\n#2 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Entry.php(242): Net_LDAP2_Entry->__construct()\n#3 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/Search.php(190): Net_LDAP2_Entry::createConnected()\n#4 phar:///var/www/html/helpdesk/public_html/upload/include/plugins/auth-ldap.phar/include/Net/LDAP2/RootDSE.php(81): Net_LDAP2_Search->shiftEntry()\n#5 phar:///var/www/html/...', referer: https://helpdesk.shookhome.org/login.php

          Write a Reply...