DEV Community

abbazs
abbazs

Posted on

1 1 1 1

A Hidden Character Mystery

This morning I was set out to refresh my geldata knowledge, I attempted to set up Geldata using Docker, following the official documentation. My initial Docker command was:

docker run --name gel -p 5650:5650 -e GEL_SERVER_PORT=5650 -e GEL_SERVER_PASSWORD=learn123 -e GEL_SERVER_TLS_CERT_MODE=generate_self_signed -e GEL_SERVER_USER​=learn -e GEL_SERVER_DEFAULT_BRANCH=learn geldata/gel
Enter fullscreen mode Exit fullscreen mode

However, I consistently encountered an authentication error:

ERROR gel_tokio::raw::connection] Connection error: AuthenticationError: authentication failed
gel error: Connection error: AuthenticationError: authentication failed
Enter fullscreen mode Exit fullscreen mode

After troubleshooting for 90 minutes, I experimented with a modified command, replacing GEL_SERVER with EDGEDB_SERVER:

docker run --name gel -p 5650:5650 -e EDGEDB_SERVER_PORT=5650 -e EDGEDB_SERVER_PASSWORD=learn123 -e EDGEDB_SERVER_TLS_CERT_MODE=generate_self_signed -e EDGEDB_SERVER_USER=learn -e EDGEDB_SERVER_DEFAULT_BRANCH=learn geldata/gel
Enter fullscreen mode Exit fullscreen mode

This command unexpectedly succeeded. I then reverted back to using GEL_SERVER with the same values:

docker run --name gel -p 5650:5650 -e GEL_SERVER_PORT=5650 -e GEL_SERVER_PASSWORD=learn123 -e GEL_SERVER_TLS_CERT_MODE=generate_self_signed -e GEL_SERVER_USER=learn -e GEL_SERVER_DEFAULT_BRANCH=learn geldata/gel
Enter fullscreen mode Exit fullscreen mode

This also worked, which was puzzling.

To understand the mystery, I asked ChatGPT. It identified a potential issue: a zero-width space character in the GEL_SERVER_USER environment variable of my initial command.

To visualize this, consider the following lines:

GEL_SERVER_USER=learn
GEL_SERVER_USER​=learn
Enter fullscreen mode Exit fullscreen mode

ChatGPT remommended using a extension like the Gremlins in vscode, the zero-width space in the second line becomes apparent. This hidden character was causing the authentication failure.

I knew that copying text from internet can have such issues, but it has been a very while since I last encountered such an issue, however zero-width space character is a new learning.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay