# Generation URL not working

**URL:** https://discuss.elastic.co/t/generation-url-not-working/61708
**Category:** Kibana
**Tags:** elastic-stack-reporting
**Created:** [September 28, 2016, 2:20pm UTC](https://discuss.elastic.co/t/generation-url-not-working/61708 "2016-09-28T14:20:13Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bwgriffith](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bwgriffith/32/7695_2.png) [@bwgriffith](https://discuss.elastic.co/u/bwgriffith)
#### Post date: [September 28, 2016, 2:20pm UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/1 "2016-09-28T14:20:13Z")

</div>

I have reporting setup in a shield environment. I am about to create a report via the "Document Generation" printable button.

However, when I create a report via the Generation URL and try to access that URL I receive an error:

`{"statusCode":404,"error":"Not Found"}`

Any ideas?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [September 30, 2016, 5:26am UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/2 "2016-09-30T05:26:55Z")

</div>

What does your browser console show? Anything in KB and ES logs? What version are you on?

---

<div class="post-metadata">

### Author: ![DaanCreemers](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@DaanCreemers](https://discuss.elastic.co/u/DaanCreemers)
#### Post date: [October 5, 2016, 3:05pm UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/3 "2016-10-05T15:05:25Z")

</div>

Hi,

I am facing a similar issue with getting a 404 statusCode error when using the Generation URL. If I use the button 'Printable PDF' then I can download a pdf report under Settings \> Reporting. When copying the Generation URL and visiting the URL in the browser I get `{"statusCode":404,"error":"Not Found"}`.

My environment:

- Elasticsearch 2.4.0 on [http://localhost:9210/](http://localhost:9210/)
- Kibana 4.6.1 on [http://localhost:5611](http://localhost:5611)
- Reporting 2.4.2
- Own hardware, Windows 10
- No proxy between between components.  
Because Elasticsearch and Kibana are not working on the default ports, I set in kibana.yml '`server.port: 5611`' and '`server.host: "localhost"`'.

Neither Elasticsearch nor Kibana shows anything in the console when visiting the Generation URL.

Does anybody have an idea?

---

<div class="post-metadata">

### Author: ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)
#### Post date: [October 10, 2016, 11:20pm UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/4 "2016-10-10T23:20:59Z")

</div>

The generation URL isn't accessible that way, it has to use a POST request, not a GET request.

You'll also need to include a `kbn-xsrf` header in the request.

The documentation around [using Reporting with Watcher](https://www.elastic.co/guide/en/reporting/current/getting-started.html#automating-report-generation) outlines some of these things. It works with curl as well, you just need to include that header and make it a POST request.

---

<div class="post-metadata">

### Author: ![DaanCreemers](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@DaanCreemers](https://discuss.elastic.co/u/DaanCreemers)
#### Post date: [October 12, 2016, 8:11am UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/5 "2016-10-12T08:11:16Z")

</div>

Thank you @Joe_Fleming! That solved my problem.

---

<div class="post-metadata">

### Author: ![android.kc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/android.kc/32/58806_2.png) [@android.kc](https://discuss.elastic.co/u/android.kc)
#### Post date: [November 30, 2016, 3:47am UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/6 "2016-11-30T03:47:59Z")

</div>

@DaanCreemers, can you please share your example of how to construct the POST request? thanks!

---

<div class="post-metadata">

### Author: ![android.kc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/android.kc/32/58806_2.png) [@android.kc](https://discuss.elastic.co/u/android.kc)
#### Post date: [November 30, 2016, 3:53am UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/7 "2016-11-30T03:53:10Z")

</div>

it's actually quite simple and just worked. here is the header to include

"headers": {"kbn-xsrf": "reporting"}

---

<div class="post-metadata">

### Author: ![DaanCreemers](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@DaanCreemers](https://discuss.elastic.co/u/DaanCreemers)
#### Post date: [November 30, 2016, 9:21am UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/8 "2016-11-30T09:21:35Z")

</div>

@android.kc, yes, that's also how I did it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 29, 2018, 8:08pm UTC](https://discuss.elastic.co/t/generation-url-not-working/61708/12 "2018-10-29T20:08:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
