Skip to content

Conversation

@csouls
Copy link

@csouls csouls commented Dec 18, 2025

Summary

Expand the avatar column length from VARCHAR(1024) to VARCHAR(2048) to fix login failures when using external OAuth providers.

Problem

When users log in via the connector-google plugin, the Google profile picture URL can exceed 1024 characters, causing a database error:

Error 1406 (22001): Data too long for column 'avatar' at row 1 

Example of Affected Data

The actual data that caused the error (1168 characters total, exceeding 1024 limit):

{ "type": "custom", "gravatar": "", "custom": "https://lh3.googleusercontent.com/a-/ALV-UjUK6Q9fONacb_zlEtkCBHH6mH_FCRaZOEMMgpm0IPv8mullFBjetpocye17fKnJn4i1eH-w_nrpt3eSbEVpN3FfaBGPu7t9kAxkxJf7MBi8lRf8LnsaYudvXdS6l5L_3Ay9ZoP-C1lHvv-q_jdRVxME4uKOoZhLlFniuI9t6WV_gruIDPUxjw9yc7bFVIDwKVHRpeLLEKC2512ztK9ex-Pc-l--AXlQvj7d70iTKaDrKh9YZQo1XPa1ZJ2tMUoIDyCZp2rveEFrOYKIn8pVmNePmNriOi7tsz2-PkT9dQkWIoCrVGcsnDgWuZ3QENvc-CLGcVPp1tk_djWnT-aScua4AaxsfNd0JVtKA9Qxo3OFvINqDelnCA10X59szzjbReyEtYUbcVp75aohxWe_NyS0AYEWvmlSMhEoIpPYLd4PJT-HtUZNsmPIQvaI5n22oIIolz3mbPrrhLACkheDQ4FY480DpQNf7SJlbmjMxjrJoMI3Llnu9ILdwPOpBgpJ03h6ROUyvFgAOkTlnMrAierzVcfqPOnoWeH1ztSpuJtwTGDvczjYUpduhxFvnWmXnEZ_AHkv-qrFDFUEqQksNgVoUEJq3V2tbbtqT27WVojyLXAqIPhG0BGhytRnbzCqzfUDLtczdJzo5Rs-hE3C0K0uwnYTnRWfxHd6Xp1j6OuE8G8ijhh4PQXtHUxtxjYtZTVkGteQRzWAkmyPRbgY51sY5YVL89cx3HAsBGnSL0gFz0HPXJ_4HpJ4zoVJhwlQcPevnrScJvy6LNDziedWpO1gralK_Hxsp7Nf9Hc4am_0AFBzDwqX-zPj8eCQ_pofHfdjrC6sXvcgJ9s488IclEjDcTelZZNhabnPlT4gXSkW1tguJZtQO-6GO8qA1se_D_dQ04_h4PwKADj4y1Hiqo2TiB6tjSt01JyOaColdJ62GSBJbrdoX2SGogvGQn7bUU_dQGG7MK6OvU8OF-4vfdyOQrK-UVnUvAKcEHv90QaOYhgbr8Q8deiu2fNeK6ADlo5c1Qti2UiXvTbwhllNZvPV6k4peYXKy-xUq0msGDNlsFncndeTKw=s96-c" }

Note: The /a-/ALV-... URL format (used by some Google Workspace accounts) generates significantly longer URLs than the standard /a/ACg8oc... format (~120 characters).

Solution

  • Expand avatar column from VARCHAR(1024) to VARCHAR(2048)
  • Add migration (v1.7.1) to update existing databases

Notes

While URLs can technically exceed 2048 characters per specification, 2048 is the practical limit supported by most browsers and services. URLs longer than 2048 characters are extremely rare in real-world usage.

Changes

  • internal/entity/user_entity.go: Update avatar column definition
  • internal/migrations/v29.go: Add migration for existing databases
  • internal/migrations/migrations.go: Register new migration
The avatar column was too short to store long URLs from external OAuth providers. When users log in via connector-google plugin, the Google profile picture URL can exceed 1024 characters, causing a database error: Error 1406 (22001): Data too long for column 'avatar' at row 1 This change expands the avatar column from VARCHAR(1024) to VARCHAR(2048). Note: While URLs can technically exceed 2048 characters per specification, 2048 is the practical limit supported by most browsers and services. URLs longer than 2048 characters are extremely rare in real-world usage.
@csouls csouls marked this pull request as ready for review December 19, 2025 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant