Skip to content

[Bug]: HTTP Basic Authentication password fails for passwords longer than 31 characters (encrypted value overflows varchar(255)) #9643

Description

@Jared87

Error Message and Logs

SQLSTATE[22001]: String data, right truncated: 7
ERROR: value too long for type character varying(255)
(Connection: pgsql, Host: coolify-db, Port: 5432, Database: coolify,
 SQL: update "applications"
      set "custom_labels" = <base64 label block>,
          "http_basic_auth_username" = <username>,
          "http_basic_auth_password" = <encrypted, base64 ciphertext>,
          "updated_at" = 2026-04-18 22:29:44
      where "id" = <id>)

The value stored in http_basic_auth_password is Laravel-encrypted (eyJpdiI6... format — JSON with IV, ciphertext, MAC, base64-wrapped). The encryption overhead pushes even short passwords past the 255 character column limit. Confirmed by testing: a 31-character password saves successfully, a 32-character password fails with the error above.

Steps to Reproduce

  1. Open any standard application in Coolify.
  2. Go to Configuration → General → HTTP Basic Authentication.
  3. Enable it, set a username, and set a password of 32 characters (e.g. 32 × a).
  4. Click Save.
  5. Observe HTTP 500 with the SQL error above.
  6. Repeat with 31 characters — saves successfully.

Example Repository URL

No response

Coolify Version

v4.0.0-beta.473

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 24.04

Additional Information

This is a follow-up to #6683. That issue was closed because the maintainer clarified that the HTTP Basic Authentication field is not intended for protecting Docker image pulls but for protecting the deployed app via the proxy. However, the underlying SQL error in that report is still reproducible — even when using the field for its intended purpose, any password longer than 31 characters fails to save.

Related: #6048, #4732 — same root cause in different columns.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions