Recently, I spent some time trying to find why I can not push my just-from-the-own image into the GitLab project registry. The message "illegal base64 data at input" is a bit confusing, but the solution is simple.

I'm messing around with a small pet project. Like any new endeavor, it hits a lot of buzz-bells: Kubernetes, Docker, Containers, you name it. The project itself is in the embryo phase and I'm jigsawing a combination of languages, tools, and optimal practices. Anyway, I tried to login into GitLab project's contained registry and received a rather unusual error message.

[mmikhail@localhost build-site]$ podman login registry.gitlab.com/my-docker-prj/container_registry --username user@example.com --password $MY_TOKEN
Error: get credentials for repository: 1 error occurred:
        * illegal base64 data at input byte 11
Get Credentials Error Message

The error assumes that I have a string encoding issue of some sort, but I have no clue where, because none of my strings in the command line are base-64 encoded. After checking a few options from unavailable GitLab (well, Google and Facebook have set some bad examples), reissuing access tokens and a score of login fails, I have found a root cause - broken auth.json. This file is a residual from the previous configuration and has authentication details, that my container tools can't decipher and use for authentication.  if you will see this message on your system, check file ~/.config/containers/auth.json. I have dropped it completely, but you may want to review its content and remove only the line related to a particular registry.