IBM / event-streams

IBM Event Streams issues repository. For more details, see the website:
https://ibm.github.io/event-streams/
Apache License 2.0
12 stars 16 forks source link

Applications failed to produce and consume after a period of time #15

Closed EmmaHumber closed 5 years ago

EmmaHumber commented 5 years ago

Issue Description

After a period of time a connected application which could previously produce messages to a topic writes an error similar to the following:

Connection to node -2 terminated during authentication. This may indicate that authentication failed due to invalid credentials

The API key has not been revoked and is still valid, but the application is no longer able to produce messages.

The Kafka logs show:

[2019-01-03 12:56:12,916] ERROR Access Controller error outcome in transaction 'eventstreams.2.1544346578761.68755' for ApiKey 'xxxxxxxxx...' (com.ibm.eventstreams.security.auth.AuthService

and the transaction id can be found in the access controller logs with the following error:

{"error":"401 UNAUTHORIZED","message":"Unable to check authorization","mh_file":"checker.go","mh_line":243,"mh_ts":"Jan  3 12:56:12.915","transaction_id":"eventstreams.2.1544346578761.68755"}

Issue Resolution

Event Streams was caching an access token, which was not being recreated when it expired. This token is now regenerated at the appropriate time.

The issue affects both producers and consumers.

Workaround

Create a new API key and use this with the application.

Fix details

IBM Internal issue number - 2273 Fix target - 2019.1.1

iFence commented 4 years ago

my application occurs similar problem when java application consumes kafka topic with kerberos.but I don't understand what you said. could you tell me more?

dalelane commented 4 years ago

@iFence I suspect that's a different problem, as this issue describes something that would happen after running successfully after a while, and that was resolved earlier this year.

The Event Streams UI generates code snippets for connecting a Java application to your Event Streams Kafka topics, so you can use that (click on "Connect to this cluster") to get the correct configuration to use.

If your application still gets authentication errors when using those settings, please do raise a new issue and we can investigate further.