Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unable to hash data" error occurs when trying to register a password that exceeds 72 characters. #10420

Open
2 tasks done
nexryai opened this issue Oct 5, 2023 · 4 comments
Labels

Comments

@nexryai
Copy link

nexryai commented Oct 5, 2023

Before you start please confirm the following.

Problem Description

"Unable to hash data" error occurs when trying to register a password that exceeds 72 characters on the initial setup page.
This error may be related to the limitation that bcrypt can only hash strings up to 72 bytes.

Expected Behavior

Password will be registered successfully

Actual Behavior

Unable to hash data error and cannot set password for admin account
image

Steps to Reproduce

  1. When Portainer is launched for the first time, the initial setup page will be displayed
  2. Enter a password of at least 73 characters

Portainer logs or screenshots

No response

Portainer version

2.19.1

Portainer Edition

Community Edition (CE)

Platform and Version

Docker version 24.0.6, build ed223bc

OS and Architecture

Debian12 amd64

Browser

Firefox 118.0.1

What command did you use to deploy Portainer?

docker-compose.yml

version: '3'
services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer
    ports:
      - 127.0.0.1:9000:9000
    restart: unless-stopped
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data:/data

Additional Information

No response

@nexryai nexryai changed the title "Unable to hash data" error occurs when trying to register a password that exceeds 73 characters. "Unable to hash data" error occurs when trying to register a password that exceeds 72 characters. Oct 5, 2023
@t3dium
Copy link

t3dium commented Jan 20, 2024

Just encountered the same issue, took me a great while to boil it down to the long password being the cause. A more specific error such as "password too long" or some sort of warning would be convenient.

image

@Cfrolich13
Copy link

I just ran into this. Is there a technical reason for the length limit?

@urda
Copy link

urda commented Aug 1, 2024

I also just encountered this. If there is a limit why does the UI not prevent it?

@urda
Copy link

urda commented Aug 1, 2024

It seems, to me, we should have warnings at these locations:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants