Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic auth in Docker causes CONNECTIVITY ERROR #73

Open
pajel opened this issue Oct 1, 2018 · 2 comments
Open

Basic auth in Docker causes CONNECTIVITY ERROR #73

pajel opened this issue Oct 1, 2018 · 2 comments

Comments

@pajel
Copy link

pajel commented Oct 1, 2018

When using the following command to run your official docker image everything works fine:
docker run --rm -p 8080:8080 -e "SCHEMAREGISTRY_URL=https://user:xxx@url:port" -e "ALLOW_GLOBAL=1" -e "ALLOW_TRANSITIVE=1" -e "ALLOW_DELETION=0" -e "PROXY=1" -e "PORT=8080" landoop/schema-registry-ui:0.9.5

When I add basic auth like this:
docker run --rm -p 8080:8080 -e "SCHEMAREGISTRY_URL=https://user:xxx@url:port" -e "ALLOW_GLOBAL=1" -e "ALLOW_TRANSITIVE=1" -e "ALLOW_DELETION=0" -e "PROXY=1" -e "PORT=8080" -e "CADDY_OPTIONS=basicauth / admin admin" landoop/schema-registry-ui:0.9.5

Suddenly I get Url : /api/schema-registry CONNECTIVITY ERROR after I log in with admin/admin.
The container logs the following:

172.17.0.1 - - [01/Oct/2018:09:38:29 +0000] "GET /api/schema-registry/config HTTP/1.1" 502 16
172.17.0.1 - - [01/Oct/2018:09:38:30 +0000] "GET /api/schema-registry/subjects/ HTTP/1.1" 502 16

Also, I have noticed the requests actually never hit our Kafka cluster.

After removing the basic auth env var from the docker start command I have to clear my browser cache to make the schema-registry-ui work again.

@andmarios
Copy link
Contributor

Hi @pajel. I think the problem is that you use double basic auth.
One is set at the schema-registry-ui docker (at the caddy server) and the other at your schema registry.
Now, this is just a guess but as you access the localhost with basic auth headers of admin/admin, caddy has no option but to forward them to the schema registry too, where of course they are wrong.

Unfortunately I can't think of an easy fix right now. Maybe you can try to use the same creds for both Schema Registry and Schema Registry UI. So instead of admin:admin, set user:xxx.

@mattmadhavan-gmail
Copy link

Hello, any resolution on this issue?

Thanks
Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants