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

Fix basic authentication during schema registry init #369

Merged
merged 3 commits into from
Mar 20, 2024

Conversation

pvannierop
Copy link
Contributor

Problem

During initialization of schema registry the following error was thrown:

[2024-03-19 17:47:28,574] INFO  - Initializing SchemaRegistration with authentication... (SchemaRegistryCommand.kt:98)
[2024-03-19 17:47:29,631] ERROR - Schema registry https://psrc-4kk0p.westeurope.azure.confluent.cloud not ready, responded with HTTP 401 Unauthorized: REST call to <https://psrc-4kk0p.westeurope.azure.confluent.cloud/subjects> failed (HTTP code 401 Unauthorized): {"error_code":401,"message":"Unauthorized"} (Emitters.kt:231)
[2024-03-19 17:47:29,633] INFO  - Waiting 1.321031400s seconds to retry (KafkaTopics.kt:303)

The cause was that basic authentication headers were not sent during init where the schema registry requests the /subjects endpoint.

Solution

A basic auth header was added so that the request succeeds.

Note

Basic auth headers appeared to be set at a global scale for the Ktor HttpClient. However, these do not appear to work for the /subjects call during init. To make sure we do not run into problems elsewhere I added the sendWithoutRequest param to the global HttpClient config (see docs).

@pvannierop pvannierop self-assigned this Mar 19, 2024
@pvannierop pvannierop force-pushed the fix_schema_registry_basicauth branch 2 times, most recently from 6e3ce3b to 9437b4d Compare March 19, 2024 17:01
@Bdegraaf1234
Copy link
Member

Solves #368

Testing this on the dev server now :)

@Bdegraaf1234
Copy link
Member

We should merge to dev, and see how to release this asap. 0.8.7-hotfix or 0.8.8?

Copy link
Member

@Bdegraaf1234 Bdegraaf1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some style fixes needed

@Bdegraaf1234
Copy link
Member

I can't get the derived MorePlatform docker image to work unfortunately. This might be due to erroneous building, there is a script missing and I have seen it before.

> kt logs catalog-server-797f767db5-q29zd --container kafka-init 
exec /usr/bin/init.sh: no such file or directory

If you tested it locally I would be ok merging, releasing a hotfix from the dev branch and testing it that way

@Bdegraaf1234 Bdegraaf1234 changed the base branch from master to dev March 20, 2024 13:12
@Bdegraaf1234 Bdegraaf1234 merged commit d3b07b2 into dev Mar 20, 2024
3 checks passed
@Bdegraaf1234 Bdegraaf1234 deleted the fix_schema_registry_basicauth branch March 20, 2024 14:16
This was referenced Mar 20, 2024
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

Successfully merging this pull request may close these issues.

2 participants