# Graylog API Call Timing Out

**URL:** <https://community.graylog.org/t/graylog-api-call-timing-out/2868>\
**Category:** Graylog Central (peer support)\
**Created:** [October 23, 2017, 10:17am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868 "2017-10-23T10:17:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [October 23, 2017, 10:17am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/1 "2017-10-23T10:17:03Z")

</div>

When I tried to start and input I got an error about the input not being able to start. The popup suggested I check my error logs, here is what I see:

```
2017-10-23T10:47:51.826+01:00 WARN [ProxiedResource] Unable to call http://VMExternalIP:9000/api/system/metrics/multiple on node <0e3dcc02-a09a-4a7f-b9eb-13ff286b89f8>
java.net.SocketTimeoutException: connect timed out

```

I have provided what I deem to be the relevant parts of my config.

```
rest_listen_uri = http://InternalP:9000/api/
rest_transport_uri = http://ExternalIP:9000/api/
web_listen_uri = http://InternalIP:9000/

```

I believe that Graylog can connect to its external IP, however I am not 100% sure. Can anyone suggest how I would test this?

Cheers,

G

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [October 23, 2017, 12:17pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/2 "2017-10-23T12:17:11Z")

</div>

I tried:

> curl [http://VMExternalIP:9000/api/system/inputstates](http://VMExternalIP:9000/api/system/inputstates)

I believed this would test connectivity between the Virtual machine and its external IP. The command timed out, which points further towards the VM not being able to communicate with its external address. Is there any way to work around this or should I put a hole in the firewall?

Cheers,

G

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [October 23, 2017, 2:19pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/3 "2017-10-23T14:19:39Z")

</div>

I have gone to ‘WebInterface’/api/api-browser. Going to this page allows me to perform API queries and I get response code ‘200’ which is a good sign. I still have no idea how to resolve this issue, could it be firewall blocking Graylog performing API queries on itself?

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [October 23, 2017, 6:34pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/4 "2017-10-23T18:34:22Z")

</div>

Use the internal URI for `rest_transport_uri` and the external one for `web_endpoint_uri`.

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [October 24, 2017, 11:17am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/5 "2017-10-24T11:17:59Z")

</div>

I have now set my config as you stated and now I get a login error which means my browser can’t access the API. this leads me to believe we need to add a firewall rule to allow access from the browser to the Graylog API.

Cheers,

G

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 2, 2017, 10:56am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/6 "2017-11-02T10:56:35Z")

</div>

So the rest\_transport\_api is set to the internal address and the web\_endpoint\_uri is set to the external address then we get a login error: 404 - cannot POST.

We have put a firewall rule in so that the virtual machine can go out and connect back into itself. The firewall rule is as follows: ExternalIPoftheVM to ExternalIPoftheVM over port 9000 on TCP. This should allow Graylog to connect to the API when the rest\_transport\_api is set to external.

Cheers,

George.

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 2, 2017, 5:15pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/7 "2017-11-02T17:15:51Z")

</div>

> [@GTownson](#):
>
> So the rest\_transport\_api is set to the internal address and the web\_endpoint\_uri is set to the external address then we get a login error: 404 - cannot POST.

What’s the exact configuration of these settings and what’s the exact error message?

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 9:46am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/8 "2017-11-06T09:46:20Z")

</div>

rest\_listen\_uri = [http://Internal:9000/api/](http://Internal:9000/api/)  
rest\_transport\_uri = [http://Internal:9000/api/](http://Internal:9000/api/)  
web\_listen\_uri = [http://External:9000/](http://External:9000/)

I get Error - the server returned: 404 - cannot POST (404)

That error message is from the web interface itself. When I set rest\_transport\_uri = [http://External:9000/api/](http://External:9000/api/) I can connect to the web interface fine, but Graylog itself can’t query its rest api. So I things such as node info just shows as unavailable.

Cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 9:55am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/9 "2017-11-06T09:55:08Z")

</div>

I will just quote what I wrote before:

> [@Graylog API Call Timing Out](https://community.graylog.org/t/graylog-api-call-timing-out/2868/4):
>
> Use the internal URI for rest\_transport\_uri and the external one for web\_endpoint\_uri.

You’re still missing the `web_endpoint_uri` setting.

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 10:09am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/10 "2017-11-06T10:09:03Z")

</div>

Hi sorry, I meant that to be the Web\_endpoint\_uri and not web\_listen\_uri.

So to give you a clear picture the config is:  
rest\_listen\_uri = [http://Internal:9000/api/](http://Internal:9000/api/)  
rest\_transport\_uri = [http://Internal:9000/api/](http://Internal:9000/api/)  
web\_listen\_uri = [http://Internal:9000/](http://Internal:9000/)  
web\_endpoint\_uri = [http://External:9000/](http://External:9000/)

Cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 10:20am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/11 "2017-11-06T10:20:21Z")

</div>

```auto
rest_listen_uri = http://0.0.0.0:9000/api/
rest_transport_uri = http://<Internal IP address>:9000/api/
web_listen_uri = http://0.0.0.0:9000/
web_endpoint_uri = http://<External IP address>:9000/api/

```

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 10:25am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/12 "2017-11-06T10:25:02Z")

</div>

I should try this config you provided?

Cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 10:36am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/13 "2017-11-06T10:36:36Z")

</div>

I didn’t provide it just for fun. 😉

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 11:25am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/14 "2017-11-06T11:25:40Z")

</div>

Just tried them and I get the login issue.

Here is the error from the web interface:  
Error - the server returned: 404 - cannot POST [http://ExternalIP:9000/system/sessions](http://ExternalIP:9000/system/sessions) (404)

There are no errors in /var/log/graylog/server.log

Cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 11:50am UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/15 "2017-11-06T11:50:15Z")

</div>

Are you using a reverse proxy in front of Graylog?  
If not, you have used the wrong value for `web_endpoint_uri`. It has to point to the _public_ URI of the Graylog REST API.

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 12:05pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/16 "2017-11-06T12:05:23Z")

</div>

No, I am not using a reverse proxy, however I have may look into using one as it may resolve this issue.

The address I am using for the web\_endpoint\_uri is the external IP address of machine that Graylog is run on. I am not sure if that is the correct value?

Cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 12:31pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/17 "2017-11-06T12:31:29Z")

</div>

> [@GTownson](#):
>
> The address I am using for the web\_endpoint\_uri is the external IP address of machine that Graylog is run on. I am not sure if that is the correct value?

An IP address alone is not the complete URI.

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 3:18pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/18 "2017-11-06T15:18:12Z")

</div>

I am not sure what the complete URI would be, please could you help me?

cheers,

G

---

<div class="post-metadata">

**Author:** ![jochen](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jochen/32/8_2.png) [@jochen](https://community.graylog.org/u/jochen)\
**Post date:** [November 6, 2017, 4:01pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/19 "2017-11-06T16:01:17Z")

</div>

> [@GTownson](#):
>
> I am not sure what the complete URI would be, please could you help me?

It’s `http://<External IP address>:9000/api/`, as written before.

Example:  
Given the external URI for the Graylog web interface was `http://example.com/` and the URI for the Graylog REST API was `http://example.com/api/`, then the `web_endpoint_uri` setting should be `http://example.com/api/`.

---

<div class="post-metadata">

**Author:** ![GTownson](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gtownson/32/793_2.png) [@GTownson](https://community.graylog.org/u/GTownson)\
**Post date:** [November 6, 2017, 4:12pm UTC](https://community.graylog.org/t/graylog-api-call-timing-out/2868/20 "2017-11-06T16:12:30Z")

</div>

Just set the web\_endpoint\_uri from:

[http://External](http://External) IP address:9000/  
to  
[http://External](http://External) IP address:9000/api/

My issue has been resolved, thank you very much for your time and help.

Cheers,

G

[Next page](https://community.graylog.org/t/graylog-api-call-timing-out/2868.md?page=2)
