Software⏱️ 2 min read📅 2026-05-29

How to Fix: Docker login fails with "error storing credentials... The stub receive

Docker login fails with error storing credentials due to bad data in Docker Desktop on Ubuntu WSL2.

Quick Answer: Try deleting the existing ~/.docker/config.json file and then run docker login again.

To resolve the "error storing credentials... The stub received bad data" issue when logging in to a Docker registry on Ubuntu WSL2 with Docker Desktop, first ensure that your Docker Desktop settings are correct and configured for the WSL2 environment. You can do this by going to Preferences >Docker >General, and make sure that Use WSL 2 container runtime is enabled.

🔧 Proven Troubleshooting Steps

Method 1: Update Docker Configuration File

  1. Step 1: Open the .docker/config.json file in a text editor and remove any existing credentials or invalid data.

Method 2: Update Docker Desktop Settings

  1. Step 1: Go to Preferences >Docker >General, and click on the Clear all data button next to Docker config.json.

💡 Conclusion

By following these steps, you should be able to resolve the "error storing credentials... The stub received bad data" issue and successfully log in to your Docker registry.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions