heimrichhannot / contao-ldap-bundle

0 stars 0 forks source link

SQL Syntax Error #2

Open mxwendler opened 2 years ago

mxwendler commented 2 years ago

Hi, thank you very much for developing this bundle! When importing, we get the following error statement:

 [OK] Inserted new tl_user instance for LDAP person " (uid: bmxxsavi)".

20:13:33 CRITICAL  [console] Error thrown while running command "huh_ldap:sync_persons -vv". Message: "An exception occurred while executing 'INSERT INTO tl_user (ldapUidNumber,email,username,name,groups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('10005','xxx.xxx@xxx.net','bmxxsavi','','a:0:{}','',1665598413,1665598413,'$argon2id$v=19$m=65536,t=4,p=1$zaY5/GanJ+/6fehjGxxxxxxxxxCYwIOW1qE2hNWXvc6scC44dKZFsXk','de','flexible','DropZone')':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('' at line 1" ["exception" => Doctrine\DBAL\Exception\SyntaxErrorException^ { …},"command" => "huh_ldap:sync_persons -vv","message" => """  An exception occurred while executing 'INSERT INTO tl_user (ldapUidNumber,email,username,name,groups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('10005','xxx.xxx@xxx.net','bmxxsavi','','a:0:{}','',1665598413,1665598413,'$argon2id$v=19$m=65536,t=4,p=1$zaYxxxxxxJUStCYwIOW1qE2hNWXvc6scC44dKZFsXk','de','flexible','DropZone')':\n  \n  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('' at line 1  """]

In AbstractMySQLDriver.php line 98:

  [Doctrine\DBAL\Exception\SyntaxErrorException]
  An exception occurred while executing 'INSERT INTO tl_user (ldapUidNumber,email,username,name,groups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('10005','x.xx
  osavi@xx.net','bmxxsavi','','a:0:{}','',1665598413,1665598413,'$argon2id$v=19$m=65536,t=4,p=1$zaY5/xxxxxxxymryRFAJUStCYwIOW1qE2hNWXvc6scC44dKZFsXk','de','flexible','DropZo
  ne')':

  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'g
  roups,admin,dateAdded,tstamp,password,language,backendTheme,uploader) VALUES ('' at line 1

Exception trace:
  at /var/www/xxx/website/contao/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:98
 Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException() at /var/www/xxx/website/contao/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:182
 Doctrine\DBAL\DBALException::wrapException() at /var/www/xxx/website/contao/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:159
 Doctrine\DBAL\DBALException::driverExceptionDuringQuery() at /var/www/xxx/website/contao/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:2226
 Doctrine\DBAL\Connection->handleExceptionDuringQuery() at /var/www/xxx/website/contao/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:1313
 Doctrine\DBAL\Connection->executeQuery() at /var/www/xxx/website/contao/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:274
 Contao\Database\Statement->query() at /var/www/xxx/website/contao/vendor/contao/core-bundle/src/Resources/contao/library/Contao/Database/Statement.php:248
 Contao\Database\Statement->execute() at /var/www/xxx/website/contao/vendor/heimrichhannot/contao-utils-bundle/src/Database/DatabaseUtil.php:908
 HeimrichHannot\UtilsBundle\Database\DatabaseUtil->insert() at /var/www/xxx/website/contao/vendor/heimrichhannot/contao-ldap-bundle/src/Util/LdapUtil.php:494
 HeimrichHannot\LdapBundle\Util\LdapUtil->syncPersons() at /var/www/xxx/website/contao/vendor/heimrichhannot/contao-ldap-bundle/src/Command/SyncPersonsCommand.php:112
 HeimrichHannot\LdapBundle\Command\SyncPersonsCommand->execute() at /var/www/xxx/website/contao/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/xxx/website/contao/vendor/symfony/console/Application.php:1027
 Symfony\Component\Console\Application->doRunCommand() at /var/www/xxx/website/contao/vendor/symfony/framework-bundle/Console/Application.php:97
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /var/www/xxx/website/contao/vendor/symfony/console/Application.php:273
 Symfony\Component\Console\Application->doRun() at /var/www/xxx/website/contao/vendor/symfony/framework-bundle/Console/Application.php:83
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/xxx/website/contao/vendor/symfony/console/Application.php:149
 Symfony\Component\Console\Application->run() at /var/www/xxx/website/contao/vendor/contao/manager-bundle/bin/contao-console:38
 include() at /var/www/xxx/website/contao/vendor/bin/contao-console:115

Can you give us a hint what is going wrong here?

Best wishes!

mxwendler commented 2 years ago

please have a look here: https://community.contao.org/de/showthread.php?83896-huh_ldap-sql-syntax-error&p=563978#post563978

koertho commented 2 years ago

Hi, thanks for reporting. I didn't developed this bundle and have no ldap setup to test currently, so I just added the fix mentions in the contao forum and need you to test it :) Please use the fix/reserved_field_groups branch and give me some feedback