Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

NullPointerException when the Fluentd server is down

Open
#68 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java

Research direction

Start in RawSocketSender.java, especially flushBuffer around lines 152 and 158, and trace the server-down path that reaches the socket access. Reproduce the failure with the Fluentd server unavailable; done means that path no longer throws a NullPointerException and reports the send failure instead.

Written by the indexing model from the issue text.

Description

When We try to use the Fluentd java logger it throws the fellowing NullPointerException when the Fluentd server is down:

An exception occurred processing Appender fluentd java.lang.NullPointerException at org.fluentd.logger.sender.RawSocketSender.flushBuffer(RawSocketSender.java:158) at org.fluentd.logger.sender.RawSocketSender.send(RawSocketSender.java:168) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:149) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:131) at org.fluentd.logger.sender.RawSocketSender.emit(RawSocketSender.java:126) at org.fluentd.logger.FluentLogger.log(FluentLogger.java:101) at org.fluentd.logger.FluentLogger.log(FluentLogger.java:86)

The source of the problem is that when the Fluentd server is down the socket in the RawSocketSender object is null so the call to the method RawSocketSender.flushBuffer#Line:152 throws the null pointer exception when executing the fellowing instruction (RawSocketSender.flushBuffer#Line:158):
LOG.error("Cannot send logs to " + socket.getInetAddress().toString());

Dominant language
Java
Stars
210
Forks
86
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluent/fluent-logger-java

All issues in fluent/fluent-logger-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.