# Kibana Generate PDF function Returns Internal Server Error

**URL:** <https://discuss.elastic.co/t/kibana-generate-pdf-function-returns-internal-server-error/350455>\
**Category:** Kibana\
**Tags:** elastic-stack-reporting\
**Created:** [January 5, 2024, 11:32am UTC](https://discuss.elastic.co/t/kibana-generate-pdf-function-returns-internal-server-error/350455 "2024-01-05T11:32:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [January 5, 2024, 11:50am UTC](https://discuss.elastic.co/t/kibana-generate-pdf-function-returns-internal-server-error/350455/2 "2024-01-05T11:50:08Z")

</div>

Hi @mbathann,

Welcome to the community! Which version of Elasticsearch and Kibana are you using?

It looks like your cluster has too many shards and you're hitting the limit. Can you check the size of your shards using the [`_cluster/stats` API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html). I would also consider using the [`_shrink` API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html) as per [this old thread](https://discuss.elastic.co/t/validation-failed-1-this-action-would-add-2-total-shards-but-this-cluster-currently-has-2000-2000-maximum-shards-open/257064).

Hope that helps!

---

_[View the full topic](https://discuss.elastic.co/t/kibana-generate-pdf-function-returns-internal-server-error/350455)._
