[2024-06-06T00:16:32,277][ERROR][o.e.b.Elasticsearch ] [server.domain.co.uk] fatal exception while booting Elasticsearch java.lang.NullPointerException: Cannot invoke "org.elasticsearch.nativeaccess.Systemd.notify_ready()" because "this.systemd" is

It looks like findLibSystemd() walks through all directories passed by java.library.path when starting elasticsearch, e.g. /usr/lib which has a lot of files (Debian 12)...
I had a lot of __pycache__ folders in there which I just deleted with find /usr/lib | grep -E "/__pycache__$" | xargs rm -rf.
To find other files/directories without world read permissions:

  • List them: find /usr/lib ! -perm -o+r
  • Set the permissions: find /usr/lib -type d ! -perm -o+r -exec chmod o+rx {} \; && find /usr/lib -type f ! -perm -o+r -exec chmod o+r {} \;