Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install ldap-auth plugin #206

Open
cobbjb opened this issue May 14, 2021 · 10 comments
Open

Cannot install ldap-auth plugin #206

cobbjb opened this issue May 14, 2021 · 10 comments

Comments

@cobbjb
Copy link

cobbjb commented May 14, 2021

The documentation refers to using phar to unpack files, but the files are already unpacked in the git repository. I have tried using php make.php hydrate anyway, and get the following error on Debian Buster:

root@hostname:/var/www/html/osTicket/include/plugins# php make.php hydrate


  [RuntimeException]
  The PEAR repository has been removed from Composer 2.0


Exception trace:
 () at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Repository/PearRepository.php:30
 Composer\Repository\PearRepository->__construct() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Repository/RepositoryManager.php:144
 Composer\Repository\RepositoryManager->createRepository() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Repository/RepositoryFactory.php:164
 Composer\Repository\RepositoryFactory::createRepos() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Repository/RepositoryFactory.php:110
 Composer\Repository\RepositoryFactory::defaultRepos() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Package/Loader/RootPackageLoader.php:165
 Composer\Package\Loader\RootPackageLoader->load() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Factory.php:368
 Composer\Factory->createComposer() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Factory.php:595
 Composer\Factory::create() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Console/Application.php:409
 Composer\Console\Application->getComposer() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Console/Application.php:527
 Composer\Console\Application->getPluginCommands() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Console/Application.php:187
 Composer\Console\Application->doRun() at phar:///var/www/html/osTicket/include/plugins/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///var/www/html/osTicket/include/plugins/composer.phar/src/Composer/Console/Application.php:122
 Composer\Console\Application->run() at phar:///var/www/html/osTicket/include/plugins/composer.phar/bin/composer:63
 require() at /var/www/html/osTicket/include/plugins/composer.phar:24

Hydrating :: lib/pear-pear.php.net/net_ldap2 => auth-ldap/include
PHP Fatal error:  Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/www/html/osTicket/include/plugins/lib/pear-pear.php.net/net_ldap2): failed to open dir: No such file or directory in /var/www/html/osTicket/include/plugins/make.php:481
Stack trace:
#0 /var/www/html/osTicket/include/plugins/make.php(481): RecursiveDirectoryIterator->__construct('/var/www/html/o...', 4096)
#1 /var/www/html/osTicket/include/plugins/make.php(340): PluginBuilder->_hydrate(Array)
#2 /var/www/html/osTicket/include/plugins/make.php(240): PluginBuilder->run(Array, Array)
#3 /var/www/html/osTicket/include/plugins/make.php(704): Module->_run('make.php')
#4 {main}
  thrown in /var/www/html/osTicket/include/plugins/make.php on line 481

There are 3 files in include/plugins/auth-ldap:

root@hostname:/var/www/html/osTicket/include/plugins# ls -alh auth-ldap
total 44K
drwxr-xr-x  2 www-data www-data 4.0K May 13 22:14 .
drwxr-xr-x 10 www-data www-data 4.0K May 13 21:54 ..
-rw-r--r--  1 www-data www-data  17K May 13 21:51 authentication.php
-rw-r--r--  1 www-data www-data 9.5K May 13 21:51 config.php
-rw-r--r--  1 www-data www-data  824 May 13 21:51 plugin.php

After enabling the plugin and filling out the form to configure it, a 500 error is thrown. Here is the relevant Apache error.log entry:

[Thu May 13 22:35:13.008253 2021] [php7:error] [pid 24696] [client 192.168.3.142:63962] PHP Fatal error:  require_once(): Failed opening required 'include/Net/LDAP2.php' (include_path='./:/var/www/html/osTicket/include/:/var/www/html/osTicket/include/pear/:/var/www/html/osTicket/include/plugins/auth-ldap/include') in /var/www/html/osTicket/include/plugins/auth-ldap/config.php on line 133, referer: https://helpdesk.domain.com/osTicket/scp/plugins.php?id=5
@JediKev
Copy link
Contributor

JediKev commented May 14, 2021

@cobbjb

Seems like your issue is Composer 2. Use Composer 1 and retry.

Cheers.

@cobbjb
Copy link
Author

cobbjb commented May 14, 2021

@JediKev Sorry, I'm not familiar with composer. Googled ways to downgrade it, but none of the ways I've read work. I downloaded composer 1.0.22 from HERE, and now php make.php hydrate does something, but I still get an error at the end.

root@hostname:/var/www/html/osTicket/include/plugins# php make.php hydrate
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Initializing PEAR repository https://pear.php.net
Could not load Auth 1.3.0r5: Invalid version string "1.3.0r5"
Could not load Auth 1.3.0r4: Invalid version string "1.3.0r4"
Could not load Auth 1.3.0r3: Invalid version string "1.3.0r3"
Could not load Auth 1.3.0r2: Invalid version string "1.3.0r2"
Could not load Auth 1.3.0r1: Invalid version string "1.3.0r1"
Could not load Auth_PrefManager2 2.0.0dev1: Invalid version string "2.0.0dev1"
Could not load Contact_AddressBook 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Gtk_ScrollingLabel 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Image_Graph 0.3.0dev4: Invalid version string "0.3.0dev4"
Could not load Image_Graph 0.3.0dev3: Invalid version string "0.3.0dev3"
Could not load Image_Graph 0.3.0dev2: Invalid version string "0.3.0dev2"
Could not load Image_Graph 0.3.0dev1: Invalid version string "0.3.0dev1"
Could not load Net_MPD 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load PEAR 1.10.0dev3: Invalid version string "1.10.0dev3"
Could not load PEAR 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load PEAR 1.10.0dev1: Invalid version string "1.10.0dev1"
Could not load PEAR 1.9.5dev1: Invalid version string "1.9.5dev1"
Could not load PEAR_Manpages 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load Structures_DataGrid 0.9.1dev1: Invalid version string "0.9.1dev1"
Could not load Structures_DataGrid_DataSource_Array 0.2.0dev1: Invalid version string "0.2.0dev1"
Could not load Structures_DataGrid_DataSource_DataObject 0.2.2dev1: Invalid version string "0.2.2dev1"
Could not load Structures_DataGrid_DataSource_XML 0.2.1dev1: Invalid version string "0.2.1dev1"
Could not load Structures_DataGrid_Renderer_CSV 0.1.5dev1: Invalid version string "0.1.5dev1"
Could not load Structures_DataGrid_Renderer_XML 0.1.4dev1: Invalid version string "0.1.4dev1"
Could not load Structures_Form 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_Form_Gtk2 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_DataGrid_DataSource_PDO 0.1.1dev1: Invalid version string "0.1.1dev1"
Could not load Text_PathNavigator 0.1.0dev2: Invalid version string "0.1.0dev2"
Could not load Text_PathNavigator 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Services_Pingback 0.2.0dev2: Invalid version string "0.2.0dev2"
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Dependency resolution completed in 0.095 seconds
Analyzed 8285 packages to resolve dependencies
Analyzed 95001 rules to resolve dependencies
Package operations: 7 installs, 0 updates, 0 removals
Installs: jasig/phpcas:1.3.3, sonata-project/google-authenticator:2.3.1, pear-pear.php.net/Net_LDAP2:2.0.7, ohmy/auth:0.0.7, symfony/event-dispatcher:v2.8.52, guzzle/guzzle:v3.9.3, aws/aws-sdk-php:2.8.31
  - Installing jasig/phpcas (1.3.3): Downloading (100%)
 Extracting archive  - Installing sonata-project/google-authenticator (2.3.1): Downloading (100%)
 Extracting archive  - Installing pear-pear.php.net/net_ldap2 (2.0.7): Downloading (100%)
    Cleaning up
  - Installing ohmy/auth (0.0.7): Downloading (100%)
 Extracting archive  - Installing symfony/event-dispatcher (v2.8.52): Downloading (100%)
 Extracting archive  - Installing guzzle/guzzle (v3.9.3): Downloading (100%)
 Extracting archive  - Installing aws/aws-sdk-php (2.8.31): Downloading (100%)
 Extracting archivesymfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/event-dispatcher suggests installing symfony/http-kernel
guzzle/guzzle suggests installing guzzlehttp/guzzle (Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated.)
aws/aws-sdk-php suggests installing doctrine/cache (Adds support for caching of credentials and responses)
aws/aws-sdk-php suggests installing monolog/monolog (Adds support for logging HTTP requests and responses)
aws/aws-sdk-php suggests installing symfony/yaml (Eases the ability to write manifests for creating jobs in AWS Import/Export)
Package ohmy/auth is abandoned, you should avoid using it. No replacement was suggested.
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Writing lock file
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!
Hydrating :: lib/sonata-project/google-authenticator/src => auth-2fa/lib/Sonata/GoogleAuthenticator
Hydrating :: lib/jasig/phpcas/source => auth-cas/lib/jasig/phpcas
Hydrating :: lib/pear-pear.php.net/net_ldap2 => auth-ldap/include
PHP Fatal error:  Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/var/www/html/osTicket/include/plugins/lib/pear-pear.php.net/net_ldap2): failed to open dir: No such file or directory in /var/www/html/osTicket/include/plugins/make.php:481
Stack trace:
#0 /var/www/html/osTicket/include/plugins/make.php(481): RecursiveDirectoryIterator->__construct('/var/www/html/o...', 4096)
#1 /var/www/html/osTicket/include/plugins/make.php(340): PluginBuilder->_hydrate(Array)
#2 /var/www/html/osTicket/include/plugins/make.php(240): PluginBuilder->run(Array, Array)
#3 /var/www/html/osTicket/include/plugins/make.php(704): Module->_run('make.php')
#4 {main}
  thrown in /var/www/html/osTicket/include/plugins/make.php on line 481

@cobbjb
Copy link
Author

cobbjb commented May 14, 2021

I moved /var/www/html/osTicket/include/plugins/lib/pear-pear.php.net/Net_LDAP2 to /var/www/html/osTicket/include/plugins/lib/pear-pear.php.net/net_ldap2 and the build completed, but I still get a 500 error when trying to configure the plugin.

root@hostname:/var/www/html/osTicket/include/plugins# php make.php hydrate
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Initializing PEAR repository https://pear.php.net
Could not load Auth 1.3.0r5: Invalid version string "1.3.0r5"
Could not load Auth 1.3.0r4: Invalid version string "1.3.0r4"
Could not load Auth 1.3.0r3: Invalid version string "1.3.0r3"
Could not load Auth 1.3.0r2: Invalid version string "1.3.0r2"
Could not load Auth 1.3.0r1: Invalid version string "1.3.0r1"
Could not load Auth_PrefManager2 2.0.0dev1: Invalid version string "2.0.0dev1"
Could not load Contact_AddressBook 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Gtk_ScrollingLabel 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Image_Graph 0.3.0dev4: Invalid version string "0.3.0dev4"
Could not load Image_Graph 0.3.0dev3: Invalid version string "0.3.0dev3"
Could not load Image_Graph 0.3.0dev2: Invalid version string "0.3.0dev2"
Could not load Image_Graph 0.3.0dev1: Invalid version string "0.3.0dev1"
Could not load Net_MPD 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load PEAR 1.10.0dev3: Invalid version string "1.10.0dev3"
Could not load PEAR 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load PEAR 1.10.0dev1: Invalid version string "1.10.0dev1"
Could not load PEAR 1.9.5dev1: Invalid version string "1.9.5dev1"
Could not load PEAR_Manpages 1.10.0dev2: Invalid version string "1.10.0dev2"
Could not load Structures_DataGrid 0.9.1dev1: Invalid version string "0.9.1dev1"
Could not load Structures_DataGrid_DataSource_Array 0.2.0dev1: Invalid version string "0.2.0dev1"
Could not load Structures_DataGrid_DataSource_DataObject 0.2.2dev1: Invalid version string "0.2.2dev1"
Could not load Structures_DataGrid_DataSource_XML 0.2.1dev1: Invalid version string "0.2.1dev1"
Could not load Structures_DataGrid_Renderer_CSV 0.1.5dev1: Invalid version string "0.1.5dev1"
Could not load Structures_DataGrid_Renderer_XML 0.1.4dev1: Invalid version string "0.1.4dev1"
Could not load Structures_Form 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_Form_Gtk2 0.8.0devel: Invalid version string "0.8.0devel"
Could not load Structures_DataGrid_DataSource_PDO 0.1.1dev1: Invalid version string "0.1.1dev1"
Could not load Text_PathNavigator 0.1.0dev2: Invalid version string "0.1.0dev2"
Could not load Text_PathNavigator 0.1.0dev1: Invalid version string "0.1.0dev1"
Could not load Services_Pingback 0.2.0dev2: Invalid version string "0.2.0dev2"
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Dependency resolution completed in 0.036 seconds
Analyzed 8291 packages to resolve dependencies
Analyzed 95581 rules to resolve dependencies
Package operations: 1 install, 0 updates, 0 removals
Installs: pear-pear.php.net/Net_LDAP2:2.0.7
  - Installing pear-pear.php.net/net_ldap2 (2.0.7): Loading from cache
    Cleaning up
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Package ohmy/auth is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
1 package you are using is looking for funding.
Use the `composer fund` command to find out more!
Hydrating :: lib/sonata-project/google-authenticator/src => auth-2fa/lib/Sonata/GoogleAuthenticator
Hydrating :: lib/jasig/phpcas/source => auth-cas/lib/jasig/phpcas
Hydrating :: lib/pear-pear.php.net/net_ldap2 => auth-ldap/include
Hydrating :: lib/ohmy/auth/src => auth-oauth/lib
Hydrating :: lib/aws/aws-sdk-php/src/Aws/S3 => storage-s3/lib/Aws/S3
Hydrating :: lib/aws/aws-sdk-php/src/Aws/Common => storage-s3/lib/Aws/Common
Hydrating :: lib/guzzle/guzzle/src/Guzzle => storage-s3/lib/Guzzle
Hydrating :: lib/symfony/event-dispatcher => storage-s3/lib/Symfony/Component/EventDispatcher

@JediKev
Copy link
Contributor

JediKev commented May 14, 2021

@cobbjb

You would need to check your error logs for any related errors.

Cheers.

@ntozier
Copy link
Contributor

ntozier commented May 14, 2021

You might want to consider just downloading the already hydrated plugin from the official download site.
https://osticket.com/download

@cobbjb
Copy link
Author

cobbjb commented May 14, 2021

The download link target points to the github plugins project. I'm not familiar with PHP or phar files, but after I ran the hydration, a new "include" directory showed up in auth-ldap with some subfolders and files.

@ntozier
Copy link
Contributor

ntozier commented May 14, 2021

2021-05-14_11-31-49

@cobbjb
Copy link
Author

cobbjb commented May 15, 2021

Thanks, that download method did provide the .phar file. I'm up and running with LDAP.

@JediKev
Copy link
Contributor

JediKev commented May 15, 2021

@cobbjb

My apologies, I would’ve suggested that sooner if I knew you were just trying to install it to use it normally. From the sound of your OP I thought you were trying to use the unpackaged plugin to debug or do custom development.

Cheers.

@cobbjb
Copy link
Author

cobbjb commented May 15, 2021

No worries. I think what makes things more confusing is that the plugin selections when going through the download options don't result in a workable environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants