wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Cannot create new user from Google - String or binary data would be truncated.

Open ccolella-mdc opened this issue 6 years ago • 3 comments

Describe the bug Some of us were able to create users through google just fine but the third person to try got this error after selecting their google account.

To Reproduce Steps to reproduce the behavior:

  1. Go to the login page
  2. Click on 'Google'
  3. Pick a google account
  4. See error: insert into [users] ([createdAt], [email], [isActive], [isSystem], [isVerified], [localeCode], [name], [pictureUrl], [providerld], [providerKey], [tfalsActive], [updatedAt]) output inserted.[id] values (@p0,@pl, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @pl O, @p11) - String or binary data would be truncated.

Expected behavior The user gets created.

Screenshots image

Host Info (please complete the following information):

  • OS: Windows Server 2012 R2
  • Wiki.js version: [e.g. 2.0.12]
  • Database engine: MS SQL Server 2016

Additional context Add any other context about the problem here.

ccolella-mdc avatar Dec 13 '19 19:12 ccolella-mdc

I found the issue. The pictureUrl it was trying to insert was 808 characters and the column in the DB is only 255.

Is it a bad idea to modify this column in my database? is it likely to cause issues elsewhere?

ccolella-mdc avatar Dec 13 '19 20:12 ccolella-mdc

Fixed by 4698afdaeb422b39479a20900c0bbdbb9587684e

You can modify the column. The only issue that could arise is if the login token (which contains the picture url) becomes too large to be stored by the browser.

NGPixel avatar Jan 03 '20 21:01 NGPixel

I have changed it to 1000 characters in my DB. And it hasn't caused any issues for me. Thanks for the reassurance

ccolella-mdc avatar Jan 03 '20 21:01 ccolella-mdc