I have configured a GatewaySMS to send the tokens, but when I try to test the shipment for a specific user I get the error message
The PIN was correct, but the SMS could not be sent: KeyError(u’user’,)

The module of the selected provider in the PrivacyIDEA server is:
sms.Provider: privacyidea.lib.smsprovider.HttpSMSProvider.HttpSMSProvider

I use POST method for the call to the gateway and I send the additional parameters:
mensaje Su clave de acceso al sistema de la UAM es: {otp} . Por favor introduzcalo en el sistema junto con su password habitual
telefono {phone}

These are the lines of the log file where the error messages are displayed
[2018-06-14 13:09:01,544][31704][139753359812416][INFO][privacyidea.lib.user:230] user u’’ found in resolver u’OID-Pruebas’
[2018-06-14 13:09:01,544][31704][139753359812416][INFO][privacyidea.lib.user:231] userid resolved to u’,cn=users, dc=uam, dc=es’
[2018-06-14 13:09:04,558][31704][139753359812416][INFO][privacyidea.lib.user:346] User u’’ from realm u’realm-oidpruebas’ tries to authenticate
[2018-06-14 13:09:04,621][31704][139753359812416][WARNING][privacyidea.lib.tokens.smstoken:301] The PIN was correct, but the SMS could not be sent: KeyError(u’user’,)
[2018-06-14 13:09:04,642][31704][139753359812416][ERROR][privacyidea.lib.auditmodules.sqlaudit:240] exception DataError(’(_mysql_exceptions.DataError) (1406, “Data too long for column ‘info’ at row 1”)’,)
[2018-06-14 13:09:04,642][31704][139753359812416][ERROR][privacyidea.lib.auditmodules.sqlaudit:241] DATA: {‘info’: “The PIN was correct, but the SMS could not be sent: KeyError(u’user’,)”, ‘realm’: ‘’, ‘tokentype’: None, ‘success’: False, ‘privacyidea_server’: ‘’, ‘client_user_agent’: ‘firefox’, ‘client’: ‘’, ‘user’: ‘’, ‘resolver’: ‘’, ‘action_detail’: ‘’, ‘action’: ‘POST /validate/check’, ‘serial’: u’PISM00016230’}

Probably your configuration is wrong.

You see this line?

You can configure the log level “debug” in your pi.cfg and return retry the atempt. The log file will then contain a traceback of the exception, which will give you more insight.

I know where the error was. There was an error in the text of the message sent to the gateway, it had included in the text the variable {user}, in smstext (policiy. authentication)
Thanks and sorry for the inconvenience

1 Like