fix: expand avatar column length from 1024 to 2048#1463
Merged
LinkinStars merged 3 commits intoapache:devfrom Dec 29, 2025
Merged
fix: expand avatar column length from 1024 to 2048#1463LinkinStars merged 3 commits intoapache:devfrom
LinkinStars merged 3 commits intoapache:devfrom
Conversation
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.
LinkinStars
requested changes
Dec 25, 2025
internal/migrations/migrations.go
Outdated
| NewMigration("v1.5.1", "add plugin kv storage", addPluginKVStorage, true), | ||
| NewMigration("v1.6.0", "move user config to interface", moveUserConfigToInterface, true), | ||
| NewMigration("v1.7.0", "add optional tags", addOptionalTags, true), | ||
| NewMigration("v1.7.1", "expand avatar column length", expandAvatarColumnLength, false), |
Member
There was a problem hiding this comment.
Please update to version 1.7.2. We will release this in this version.
Contributor
Author
There was a problem hiding this comment.
Thank you for the review! I've updated the migration version to v1.7.2.
LinkinStars
approved these changes
Dec 29, 2025
Member
LinkinStars
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expand the
avatarcolumn length fromVARCHAR(1024)toVARCHAR(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:
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
avatarcolumn fromVARCHAR(1024)toVARCHAR(2048)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 definitioninternal/migrations/v29.go: Add migration for existing databasesinternal/migrations/migrations.go: Register new migration