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

40408 error on /config/subject instead of 40401 cause AKHQ to break #763

Closed
twobeeb opened this issue Jul 20, 2021 · 4 comments
Closed

40408 error on /config/subject instead of 40401 cause AKHQ to break #763

twobeeb opened this issue Jul 20, 2021 · 4 comments

Comments

@twobeeb
Copy link
Contributor

twobeeb commented Jul 20, 2021

When running AKHQ against recent version of Schema Registry, the schema registry is throwing different errors codes than previous versions when calling /config/subject (which is allowed to return 404).

Because the error is not ignored, the SchemaRegistry page completely fails on AKHQ :
image

This is the failing part, which requires specifically 40401 :
https://github.com/tchiotludo/akhq/blob/dev/src/main/java/org/akhq/repositories/SchemaRegistryRepository.java#L222-L235

Change on Confluent side :
confluentinc/schema-registry#1920

@twobeeb twobeeb changed the title 404 40408 error on /config/subject instead of 40401 cause AKHQ to break Jul 20, 2021
@twobeeb
Copy link
Contributor Author

twobeeb commented Jul 20, 2021

I suggest replacing the above code with :

public Schema.Config getConfig(String clusterId, String subject) throws IOException, RestClientException {
        try {
            return new Schema.Config(this.kafkaModule
                .getRegistryRestClient(clusterId)
                .getConfig(subject)
            );
        } catch (RestClientException exception) {
            // before
            // if (exception.getErrorCode() != ERROR_NOT_FOUND) {
            if (exception.getStatus() != 404) {
                throw exception;
            }

            return this.getDefaultConfig(clusterId);
        }
    }

What's your opinion ?

chgl pushed a commit to chgl/akhq that referenced this issue Aug 9, 2021
tchiotludo pushed a commit that referenced this issue Oct 24, 2021
@pantaoran
Copy link

After upgrading Schema Registry we also observe this problem.
Any chance we could see a release with this fix?

@tchiotludo
Copy link
Owner

Will do, seems to have a lot of people waiting for a new release 😄

@tchiotludo
Copy link
Owner

Release happen 😄

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