Skip to content

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

Closed

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

Activity

  1. dosubot commented on Jun 14, 2026

    @dosubot

    Hi @arontech-co! I'm Dosu and I'm helping the Dokploy team.

    This is a valid conflict between two requirements. The .toLowerCase() transformation was intentionally added in PR #4382 to fix a different issue — Docker registries like GHCR and Docker Hub require image namespaces to be lowercase. Without it, usernames with capital letters caused deployment failures like:

    Error parsing reference: "ghcr.io/Baker/dnsbuddy-frontend-pamcuy" is not a valid repository/tag:
    repository name (Baker/dnsbuddy-frontend-pamcuy) must be lowercase
    

    The comment in the code explains this intent [1]:

    // Image references require a lowercase namespace (e.g. Docker Hub username).
    const registryUsernameSchema = z
      .string()
      .trim()
      .min(1)
      .transform((s) => s.toLowerCase());

    However, for AWS ECR the username AWS is used for authentication only — it's not part of the image namespace path. So the fix likely needs to be more nuanced: lowercase the username when constructing image references/tags, but preserve the original case when performing docker login. The tag generation in packages/server/src/utils/cluster/upload.ts already does its own lowercasing independently via (imagePrefix || username).toLowerCase() [2], so removing the schema-level transform might be safe.

    It's also worth noting there are open PRs (#4141, #2660) working on dedicated AWS ECR support using credential-based authentication rather than the standard username/password flow [3] [4], which would be the longer-term solution for ECR.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dokploy with Dosu Add Dosu to your team

  2. zexxitywave commented on Jun 14, 2026

    @zexxitywave

    I've submitted PR #4635 which addresses this issue.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions