anyx / LoginGateBundle

59 stars 23 forks source link

MySQL ip out of range #7

Closed martijnhartlief closed 7 years ago

martijnhartlief commented 7 years ago

When saving I get the following exception:

An exception occurred while executing 'INSERT INTO failure_login_attempt (ip, created_at, data) VALUES (?, ?, ?)' with params [3232238081, "2017-07-13 15:39:52", "a:4:{s:9:\"exception\";s:16:\"Bad credentials.\";s:8:\"clientIp\";s:12:\"192.168.10.1\";s:9:\"sessionId\";s:26:\"dav5ga8j8k54v8kos10afjlh51\";s:4:\"user\";s:18:\"removed\";}"]:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'ip' at row 1

It's probably fixed by making the field unsigned. But according to comments on StackOverflow this is not recommended due to portability issues. Source: https://stackoverflow.com/questions/7692686/doctrine-2-unsigned-value

Perhaps we should save it as a string instead?

anyx commented 7 years ago

@martijnhartlief thanks for a report. I just merged #8 and published 0.4 version

martijnhartlief commented 7 years ago

Thank you!