Link tile with a URL over 255 characters returns a 500 with raw SQL in the log
Problem
The link tile URL validator allows 2048 characters but services.custom_url is varchar(255), so any URL between 256 and 2048 characters fails at the database. The user gets a generic error page, and the server log records the raw MySQL error along with the full INSERT statement.
The URL input in the add-link-tile modal has no maxLength, so nothing catches it client-side either.
This is reachable by pasting an ordinary long URL — a Grafana dashboard link, a Nextcloud share link, any signed URL.
Steps to reproduce
- Dashboard → add a link tile.
- Paste a URL longer than 255 characters.
- Submit.
Expected vs actual
Expected: 422 with a readable message, e.g. "URL must be 255 characters or fewer."
Actual: HTTP 500 and an Inertia error page. The log records:
ER_DATA_TOO_LONG (errno 1406): Data too long for column 'custom_url' at row 1followed by the complete INSERT statement.
Boundary probe, identical on two servers:
| URL length | Result |
|---|---|
| 200 chars | 201 Created |
| 260 chars | 500 |
| 325 chars | 500 |
| 600 chars | 500 |
Root cause
Validator/column mismatch in admin/app/validators/system.ts:
export const createLinkTileValidator = vine.compile(vine.object({
friendly_name: vine.string().trim().minLength(1).maxLength(60),
url: vine.string().trim().minLength(1).maxLength(2048), // column is varchar(255)
...
}));The same mismatch is present in updateLinkTileValidator.
Suggested fix
Align the validator with the column (maxLength(255)) on both create and update, and add maxLength to the modal's URL input. Alternatively widen the column, though 255 seems reasonable for a dashboard tile.
Worth noting this release fixed the same class of bug one table over — map marker notes are now capped server-side at 500 characters and return a clean 422.
Files involved
admin/app/validators/system.ts—createLinkTileValidator,updateLinkTileValidator- the add/edit link tile modal — URL input needs
maxLength services.custom_urlcolumn definition
Source: Crosstalk-Solutions/project-nomad