# Network undefined when adding data source to grafana

**URL:** <https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725>\
**Category:** Grafana\
**Created:** [April 26, 2019, 9:19am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725 "2019-04-26T09:19:02Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 9:19am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/1 "2019-04-26T09:19:02Z")

</div>

i am trying to add a influxDB as data source in Grafana and facing the attached

 ![Screenshot%20from%202019-04-26%2014-47-48](https://us1.discourse-cdn.com/grafana/original/2X/0/08dcc4aa205a3fe95717e290fbfa82174986e4a1.png) error.  
please help in resolving it.

---

<div class="post-metadata">

**Author:** ![clanlaw](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@clanlaw](https://community.grafana.com/u/clanlaw)\
**Post date:** [April 26, 2019, 9:44am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/2 "2019-04-26T09:44:26Z")

</div>

Is there a reason you have chosen Browser access, Server would be more usual. With Browser and a specification of localhost I think you will only be able to run the browser on the machine running influx.  
What do you see if you run, in a terminal, the command  
`influx`

---

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 9:50am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/3 "2019-04-26T09:50:55Z")

</div>

## the program ‘influx’ is currently not installed.

i have not hosted Grafana, i am using the free hosting that is why used browser.  
should i use server in this case as well?

---

<div class="post-metadata">

**Author:** ![clanlaw](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@clanlaw](https://community.grafana.com/u/clanlaw)\
**Post date:** [April 26, 2019, 9:53am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/4 "2019-04-26T09:53:52Z")

</div>

Sorry I don’t understand the question. Influx must be running somewhere in order to access the database. Where is it running, and where is Grafana server running?

---

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 9:59am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/5 "2019-04-26T09:59:09Z")

</div>

when i run influxd it shows that the server is running.  
but when i do run influx it tells me to install influxdb-client package, i have got that installed now so it works now and gives me the influxql cli to fire queries.

but when i try to add a data-source it shows error “network undefined” when done with browser access and “bad gateway(502)” when done with server access

---

<div class="post-metadata">

**Author:** ![clanlaw](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@clanlaw](https://community.grafana.com/u/clanlaw)\
**Post date:** [April 26, 2019, 10:28am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/6 "2019-04-26T10:28:03Z")

</div>

You didn’t answer the questions, where is influx server running and where is grafana server running?

---

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 10:41am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/7 "2019-04-26T10:41:37Z")

</div>

- the influxd is running on localhost:8086
- i haven’t hosted grafana on my machine i am using the free hosting that grafana provides.

---

<div class="post-metadata">

**Author:** ![clanlaw](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@clanlaw](https://community.grafana.com/u/clanlaw)\
**Post date:** [April 26, 2019, 10:43am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/8 "2019-04-26T10:43:10Z")

</div>

Do you mean Grafana Cloud? Sorry, I don’t know about setting that up. Presumably there are some tutorials to follow.

---

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 10:52am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/9 "2019-04-26T10:52:10Z")

</div>

yes Grafana cloud is what i am using.  
thanks for the effort 🙂

---

<div class="post-metadata">

**Author:** ![neo1702](https://avatars.discourse-cdn.com/v4/letter/n/d9b06d/32.png) [@neo1702](https://community.grafana.com/u/neo1702)\
**Post date:** [April 26, 2019, 11:31am UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/10 "2019-04-26T11:31:03Z")

</div>

it’s happening because incoming requests are not allowed on my machine.  
and due to this Grafana cannot interact with the influxDB that i have locally installed in my machine.

---

<div class="post-metadata">

**Author:** ![anon34853223](https://avatars.discourse-cdn.com/v4/letter/a/71c47a/32.png) [@anon34853223](https://community.grafana.com/u/anon34853223)\
**Post date:** [May 10, 2019, 3:29pm UTC](https://community.grafana.com/t/network-undefined-when-adding-data-source-to-grafana/16725/11 "2019-05-10T15:29:59Z")

</div>

To be able to connect to an InfluxDB instance (running on your local machine) using hosted Grafana Cloud instance and browser access mode you’ll need to configure CORS to be able to communicate with InfluxDB. CORS is something browsers enforced when doing request between different domains. I don’t think InfluxDB allow you to configure this so you’ll need to put a proxy server like nginx which proxy requests to your InfluxDB instance.

A really ugly/temporary way of solving this may be to use a browser extension, like this one for example: [https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)
