Bitbucket Server logs getting filled up by the error java.lang.NullPointerException: null
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Sometimes you might observe that the log directory is growing big in size and upon checking you could see that the atlassian-bitbucket.log is filling up with entries similar to the below one.
2022-04-04 07:11:41,685 ERROR [https-jsse-nio-443-exec-16] o.apache.tomcat.util.net.NioEndpoint Error running socket processor
java.lang.NullPointerException: null
2022-04-04 07:11:41,685 ERROR [https-jsse-nio-443-exec-16] o.apache.tomcat.util.net.NioEndpoint Error running socket processor
java.lang.NullPointerException: null
Environment
Bitbucket Server/Data Center with OpenJDK 1.8.0_272 or lower.
Diagnosis
Check the bitbucket.properties file to confirm if the instance is running on TLS version 1.3.
Cause
The instance is probably running into the JDK bug JDK-8241248. According to the tomcat developers, this is related to TLSv1.3 clients and the instance needs to use only TLSv1.2.
Workaround
Add the following to the bitbucket.properties file and restart the server. This would define all the TLS protocols Bitbucket can use for encryption.
server.ssl.enabled-protocols=SSLv2Hello,TLSv1,TLSv1.1,TLSv1.2
Please note that even if you set server.ssl.protocol=TLSv1.2
in the bitbucket.properties file, it only defines the default and does not disable TLSv1.3. So if that line exists in your bitbucket.properties file, you can remove it.
Solution
The permanent solution for this issue would be to upgrade your JDK to a version which contains the bug fix. Please refer to the bug report for more information and the fixed version details.
If it still doesn't fix the issue, please get in touch with Atlassian support.