Jenkins shows kafka agent as connected even when the "Remote root directory" is not accessible
As a result, jobs get assigned to that node and jobs fail with:
It would be preferable that if the node/user does not have access to the "Remote root directory" it shows the node as offline and no jobs get assigned to it. Bonus if it shows a clear message saying that it does not have access to the folder.
To repro, just create a folder that is no access to the user that is running the process, or put a non-existent folder in the "Remote root directory", start the remoting agent process, the nodes page will show the node as online, running a job in that node will fail with the stack trace shown above
One possible solution will be to append the value of "Remote root directory" to the line
java -jar remoting-kafka-agent.jar -name planet -master http://jenkinssecure:8081/ -secret aa56ec7e376f2b66927 -kafkaURL kafka:9092 -noauth -remoteRootDir /var/kafka
Then the check can be done in the agent and fail the startup if the folder can not be accessed.