Skip to content

AWS ECR authentication fails because registry usernames are forcibly lowercased #4632

@arontech-co

Description

@arontech-co

To Reproduce

To Reproduce
Create an AWS ECR repository.
Generate an ECR authentication token:
aws ecr get-login-password --region
In Dokploy, navigate to Settings → Registry.
Click Add Registry.
Enter:
Registry Name: AWS ECR
Username: AWS
Password: Output from aws ecr get-login-password
Registry URL: .dkr.ecr..amazonaws.com
Click Test Registry or Create.
Observe the authentication failure.
Additional Information

The issue is caused by the username being transformed to lowercase in:

packages/server/src/db/schema/registry.ts

Current code:

const registryUsernameSchema = z
.string()
.trim()
.min(1)
.transform((s) => s.toLowerCase());

Removing the .toLowerCase() transformation resolves the issue and AWS ECR authentication works correctly.

Current vs. Expected behavior

Current behavior

When configuring an AWS ECR registry with:

Username: AWS
Password: Output of aws ecr get-login-password
Registry URL: .dkr.ecr..amazonaws.com

Dokploy converts the username to lowercase before executing the Docker login command:

printf %s '' | docker login '' -u 'aws' --password-stdin

This causes AWS ECR authentication to fail with:

Error response from daemon: login attempt to https:///v2/ failed with status: 401 Unauthorized
Expected behavior

Dokploy should preserve the username exactly as entered:

printf %s '' | docker login '' -u 'AWS' --password-stdin

AWS ECR authentication should succeed and the registry should be created successfully.

Provide environment information

Operating System:
Ubuntu 24.04

Arch:
x86_64

Dokploy version:
v0.29.8

Which area(s) are affected? (Select all that apply)

Application, Docker

Are you deploying the applications where Dokploy is installed or on a remote server?

Remote server

Additional context

No response

Will you send a PR to fix it?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions