[ 
https://issues.apache.org/jira/browse/KAFKA-6659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410517#comment-16410517
 ] 

ASF GitHub Bot commented on KAFKA-6659:
---------------------------------------

mjsax closed pull request #4732: KAFKA-6659: Improve error message if state 
store is not found
URL: https://github.com/apache/kafka/pull/4732
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java
 
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java
index 3761bfb0ee6..44a25c1213f 100644
--- 
a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java
+++ 
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorContextImpl.java
@@ -72,7 +72,13 @@ public StateStore getStateStore(final String name) {
         }
 
         if (!currentNode().stateStores.contains(name)) {
-            throw new StreamsException("Processor " + currentNode().name() + " 
has no access to StateStore " + name);
+            throw new StreamsException("Processor " + currentNode().name() + " 
has no access to StateStore " + name +
+                    " as the store is not connected to the processor. If you 
add stores manually via '.addStateStore()' " +
+                    "make sure to connect the added store to the processor by 
providing the processor name to " +
+                    "'.addStateStore()' or connect them via 
'.connectProcessorAndStateStores()'. " +
+                    "DSL users need to provide the store name to '.process()', 
'.transform()', or '.transformValues()' " +
+                    "to connect the store to the corresponding operator. If 
you do not add stores manually, " +
+                    "please file a bug report at 
https://issues.apache.org/jira/projects/KAFKA.";);
         }
 
         return stateManager.getStore(name);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Improve error message if state store is not found
> -------------------------------------------------
>
>                 Key: KAFKA-6659
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6659
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>            Reporter: Matthias J. Sax
>            Assignee: Stuart Perks
>            Priority: Trivial
>              Labels: beginner, easy-fix, newbie
>
> If a processor tries to access a store but the store is not connected to the 
> processor, Streams fails with
> {quote}Caused by: org.apache.kafka.streams.errors.TopologyBuilderException: 
> Invalid topology building: Processor KSTREAM-TRANSFORM-0000000036 has no 
> access to StateStore questions-awaiting-answers-store
> {quote}
> We should improve this error message and give a hint to the user how to fix 
> the issues.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to