## TL;DR

Check your version of Elasticsearch first , maintainers often fix the underlying bug in a later release, and the thread may predate it.

## Steps

1. Issue elastic/elasticsearch#112694 (closed, 26 comments): An error occurred while calling the create inference API in the ES cluster after upgrade. Reporter showed the mappings_versions in GET _cluster/state looked right, and restarting the new master made the NPE disappear.

2. Create inference API throwing an NPE right after a cluster upgrade: root cause is that when the last 8.9 node leaves the cluster, the system index descriptors and their mappings versions are not updated to reflect what is now available. Workaround: restart the master, which forces the update and makes the NPE disappear. Proper fix: upgrade to 8.16.1 (backport PR #116646) or 8.17 (PR #115771), where it is fixed.

3. This comes from one real issue thread (https://github.com/elastic/elasticsearch/issues/112694); it is the verified fix or approach from that thread, not a general manual. Check your version of Elasticsearch first , maintainers often fix the underlying bug in a later release, and the thread may predate it.

## When to use

Use this skill when you run into "Create inference API throws NPE after cluster upgrade: restart master".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 8.16.1. If you are on something much newer or older, the details may have shifted.

## Why this happens

Issue elastic/elasticsearch#112694 (closed, 26 comments): An error occurred while calling the create inference API in the ES cluster after upgrade.

## Sources

- https://github.com/elastic/elasticsearch/issues/112694
