Cannot save LDAP Resolver

Hi,

Just setting up a test server and I’m trying to run a trial migration from an old LinOTP2 server, but I’m not able to save an LDAP Resolver. I entered all the config and ran a test, and it was successful. However when I click ‘Save’ I get this:

sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1062, "Duplicate entry '0' for key 'PRIMARY'")
[SQL: INSERT INTO machineresolverconfig (resolver_id, `Key`, `Value`, `Type`, `Description`) VALUES (%(resolver_id)s, %(Key)s, %(Value)s, %(Type)s, %(Description)s)]
[parameters: {'resolver_id': None, 'Key': 'TLS_VERIFY', 'Value': 'False', 'Type': 'bool', 'Description': ''}]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
ERROR:privacyidea.lib.auditmodules.sqlaudit:exception IntegrityError('(pymysql.err.IntegrityError) (1062, "Duplicate entry \\'0\\' for key \\'PRIMARY\\'")')

And in MySQL I see this:

MariaDB [pi]> select * from machineresolverconfig;
+----+-------------+----------+--------+--------+-------------+
| id | resolver_id | Key      | Value  | Type   | Description |
+----+-------------+----------+--------+--------+-------------+
|  0 |        NULL | AUTHTYPE | Simple | string |             |
+----+-------------+----------+--------+--------+-------------+
1 row in set (0.001 sec)

If I truncate the table and try again it recreates the same entry.

I can’t find any similar issues here, any ideas?

Thanks,

Greg

Looking at this, 'resolver_id': None looks wrong! I wonder why it’s not carrying the name forward from the form field?

Are you sure, you need a machineresolver?

Ah, no, I don’t. I’ve discovered I should be making a User resolver. However, I’m getting the same error there:

sqlalchemy.exc.IntegrityError: (pymysql.err.IntegrityError) (1062, "Duplicate entry '0' for key 'PRIMARY'")
[SQL: INSERT INTO resolverconfig (resolver_id, `Key`, `Value`, `Type`, `Description`) VALUES (%(resolver_id)s, %(Key)s, %(Value)s, %(Type)s, %(Description)s)]
[parameters: {'resolver_id': None, 'Key': 'TIMEOUT', 'Value': '5', 'Type': 'int', 'Description': ''}]
(Background on this error at: http://sqlalche.me/e/13/gkpj)

This is probably some MariaDB configuration that needs applying, but I can’t find anyone else who’s had this issue, so that’s weird.

Alright, it doesn’t like something about the latest version of MariaDB. I have no idea what, but I span up a MySQL 5.7 RDS instance instead and it’s happy. So that’s good. I guess I’ll raise an issue over in GitHub for the MariaDB thing.

Cross-posting for completeness. :slight_smile:

1 Like

Thanks for opening an issue at github. We will take it from there - if we can reproduce it.