Kipjr/Ldap_Login

mysql error ...

Closed this issue · 10 comments

Warning:  [mysql error 1146] Table 'piwigo.piwigo_ldap_login_config' doesn't exist
select 1 from `piwigo_ldap_login_config` LIMIT 1 in /gallery/include/dblayer/functions_mysqli.inc.php on line 864
Kipjr commented

Can you reinstall the plugin?
https://github.com/Kipjr/ldap_login/blob/44f225d183b0aafd4f2583bf80d6b9d8820f5914/maintain.inc.php#L50
It should be created after installation

I reinstall plugin some times, it doesnt work

same here:

piwigo.piwigo_ldap_login_config' doesn't exist
select 1 from `piwigo_ldap_login_config` LIMIT 1 in /gallery/include/dblayer/functions_mysqli.inc.php on line 864

Reinstall doesnt solve the issue

Hi, same problem here.
I've try
apt install php-ldap
uncomment ldap extension in php.ini
restart apache2
and same error again.

+1
Happy to try suggestions if I can help diagnose.

Other active plugins:
Admin Tools
Language Switch
Menalto2Piwigo

Environment details:
Piwigo 11.5.0
Operating system: Linux (running in Proxmox container)
PHP: 7.3.29-1~deb10u1 [2021-09-14 21:43:30]
MySQL: 5.5.5-10.3.29-MariaDB-0+deb10u1 [2021-09-14 21:43:30]
Graphics Library: GD 2.2.5

Kipjr commented

Sorry, I'm still looking for additional developers to help me with some issues. Time is very limited the past months.
What I do know is that it should create a table due to this while installing.
https://github.com/Kipjr/ldap_login/blob/44f225d183b0aafd4f2583bf80d6b9d8820f5914/maintain.inc.php#L71
Using PhpMyAdmin / mysql , you could create this table yourself:

CREATE TABLE IF NOT EXISTS `piwigo_ldap_login_config` (`param` varchar(40) CHARACTER SET utf8 NOT NULL,`value` text CHARACTER SET utf8,`comment` varchar(255) CHARACTER SET utf8 DEFAULT NULL,UNIQUE KEY `param` (`param`)) ENGINE = MyISAM CHARSET=utf8 COLLATE utf8_general_ci;"

Thanks for the suggestion. I created that table from the mysql command line and mysql reported "Query OK, 0 rows affected". This seems to have progressed past the original error message so it's a good work around.

I then see errors like:
Undefined index: ld_user_filter in /var/www/gallery/plugins/piwigoplugin_ldap_login/admin/configuration.php on line 160
... also on lines 163, 178 and 179

So I guess there are some row inserts missed too.

To work around this I changed those lines to use check_config instead of indexing config and the errors went away. Will explore more later...

It appears that the root cause could be that the directory name under plugins was wrong. After renaming it from piwigoplugin_ldap_login to Ldap_Login it seems to be activating properly.
FYI, I initially chose to Install it from the Piwigo plugins UI.

Kipjr commented

I will look into it today. Finally managed to get my development environment up and running and immediately got the same issue:

Piwigo encountered a non recoverable error
[mysql error 1146] Table 'piwigo.piwigo_ldap_login_config' doesn't exist
select 1 from `piwigo_ldap_login_config` LIMIT 1

#1	my_error /var/www/html/piwigo/include/dblayer/functions_mysqli.inc.php(132)
#2	pwg_query /var/www/html/piwigo/plugins/piwigoplugin_ldap_login/functions_sql.inc.php(20)
#3	ld_table_exist /var/www/html/piwigo/plugins/piwigoplugin_ldap_login/functions_sql.inc.php(78)
#4	ld_sql /var/www/html/piwigo/plugins/piwigoplugin_ldap_login/class.ldap.php(120)
#5	Ldap::load_config /var/www/html/piwigo/plugins/piwigoplugin_ldap_login/main.inc.php(42)
#6	include_once /var/www/html/piwigo/include/functions_plugins.inc.php(350)
#7	load_plugin /var/www/html/piwigo/include/functions_plugins.inc.php(430)
#8	load_plugins /var/www/html/piwigo/include/common.inc.php(142)
#9	include_once /var/www/html/piwigo/admin.php(16)
Kipjr commented

It appears that the root cause could be that the directory name under plugins was wrong. After renaming it from piwigoplugin_ldap_login to Ldap_Login it seems to be activating properly.
FYI, I initially chose to Install it from the Piwigo plugins UI.

Initially I was not sure how this occured. My original folder is Ldap_Login and not piwigoplugin_ldap_login. But then this issue occured when I installed the ldap_login for v11 version, which is not developed by me.