Skip to content

Magento 2 password upgrade command “bin/magento customer:hash:upgrade” Returns error: str_pad(): Argument #3 ($pad_string) must be a non-empty string

After migrating from Magento 1 to Magento 2.4.5 using the official migration-tool i’m having trouble logging in to customer accounts. Attempting to force the hash upgrade using the command “bin/magento customer:hash:upgrade” results in the following error:

str_pad(): Argument #3 ($pad_string) must be a non-empty string#0 /public_html/vendor/magento/framework/Encryption/Encryptor.php(583): str_pad('', 16, '')
#1 /public_html/vendor/magento/framework/Encryption/Encryptor.php(225): MagentoFrameworkEncryptionEncryptor->getArgonHash('00fd5ee4bf02ec5...', 32, 2, 67108864, '')
#2 /public_html/vendor/magento/module-customer/Console/Command/UpgradeHashAlgorithmCommand.php(71): MagentoFrameworkEncryptionEncryptor->getHash('00fd5ee4bf02ec5...', '', '3_32_2_67108864')
#3 /public_html/vendor/symfony/console/Command/Command.php(255): MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#4 /public_html/vendor/magento/framework/Interception/Interceptor.php(58): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#5 /public_html/vendor/magento/framework/Interception/Interceptor.php(138): MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommandInterceptor->___callParent('run', Array)
#6 /public_html/vendor/magento/framework/Interception/Interceptor.php(153): MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommandInterceptor->MagentoFrameworkInterception{closure}(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#7 /public_html/generated/code/Magento/Customer/Console/Command/UpgradeHashAlgorithmCommand/Interceptor.php(77): MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommandInterceptor->___callPlugins('run', Array, Array)
#8 /public_html/vendor/symfony/console/Application.php(1009): MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommandInterceptor->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#9 /public_html/vendor/symfony/console/Application.php(273): SymfonyComponentConsoleApplication->doRunCommand(Object(MagentoCustomerConsoleCommandUpgradeHashAlgorithmCommandInterceptor), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#10 /public_html/vendor/magento/framework/Console/Cli.php(116): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#11 /public_html/vendor/symfony/console/Application.php(149): MagentoFrameworkConsoleCli->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#12 /public_html/bin/magento(23): SymfonyComponentConsoleApplication->run()
#13 {main}