Docker login fails with error message: “Error saving credentials: error storing credentials - err: exit status 1, out: `error getting credentials - err: exit status 1, out: `no usernames for https://index.docker.io/v1/`”

I am unable to perform any docker login actions on Ubuntu 22.04.3 LTS. When I try, I get the following message:

Error saving credentials: error storing credentials - err: exit status 1, out: error getting credentials - err: exit status 1, out: no usernames for https://index.docker.io/v1/

Also, I am not able to log in via Docker Desktop.
I can log in perfectly when using Windows 11.

Here is my Docker version info:

Client: Docker Engine - Community
Cloud integration: v1.0.35+desktop.5
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Context: desktop-linux

Any help resolving this issue would be greatly appreciated. Thanks for taking the time to read.