# EMFILE Error with Influxdb

**URL:** https://discourse.nodered.org/t/emfile-error-with-influxdb/8554
**Category:** General
**Created:** [3 March 2019 14:04 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554 "2019-03-03T14:04:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 14:04 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/1 "2019-03-03T14:04:08Z")

</div>

Hi

I am trying to write some data to an influxdb database but I am getting an EMFILE error which I cant seem to understand. Does anyone have any ideas?

Here is a screenshot of the relevant parts of my flows along with the error showing from the debug node (I have blanked out the IP address of the server running the database other than the port number which is 8086).

I know influxdb expects a very specific format for input which I think I have correct so I suspect it has something to do with trying to connect to the database (which happens to run on a google cloud compute engine instance).

 ![EMFILEError](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a0525d6d28a6c3b938a5c99809645dc38a76ee38.png)

Regards  
Gavin

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 14:32 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/3 "2019-03-03T14:32:44Z")

</div>

That error means that you have tried to open too many files/sockets. What could be the cause of that I don't know.  
I would start by looking at the node-red startup log to see what is there.

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 16:44 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/4 "2019-03-03T16:44:20Z")

</div>

by the startup log I understand that I should stop node red and then start it again and see what comes up on the command line screen....correct?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 16:47 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/5 "2019-03-03T16:47:30Z")

</div>

Yes, it starts with the Welcome to node-RED message.  
Post it here if there isn't anything obvious. You can copy from the terminal using Ctrl-Shift-C

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 16:47 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/6 "2019-03-03T16:47:53Z")

</div>

Here is the start up log:

# Starting as a systemd service. Started Node-RED graphical event wiring tool. 3 Mar 16:45:58 - [info] Welcome to Node-RED

## 3 Mar 16:45:58 - [info] Node-RED version: v0.19.5 3 Mar 16:45:58 - [info] Node.js version: v10.15.0 3 Mar 16:45:58 - [info] Linux 4.14.79-v7+ arm LE 3 Mar 16:45:59 - [info] Loading palette nodes 3 Mar 16:46:04 - [info] Dashboard version 2.13.0 started at /ui 3 Mar 16:46:04 - [info] Settings file : /home/pi/.node-red/settings.js 3 Mar 16:46:04 - [info] Context store : 'default' [module=memory] 3 Mar 16:46:04 - [info] User directory : /home/pi/.node-red 3 Mar 16:46:04 - [warn] Projects disabled : editorTheme.projects.enabled=false 3 Mar 16:46:04 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json 3 Mar 16:46:05 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/) 3 Mar 16:46:05 - [warn]

## Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change.

3 Mar 16:46:05 - [info] Starting flows  
3 Mar 16:46:05 - [info] [worldmap:GavMap] Serving /home/pi/.node-red/node\_modules/node-red-contrib-web-worldmap as /worldmap  
3 Mar 16:46:05 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003  
3 Mar 16:46:05 - [info] Started flows  
3 Mar 16:46:06 - [info] [mqtt-broker:Gavin GPS] Connected to broker: mqtt://m15.cloudmqtt.com:16063  
gpx2json@0.0.5 ../../tmp/d-11923-5364-8q3aln.v287c/node\_modules/gpx2json  
└── xml2js@0.4.19 (sax@1.2.4, xmlbuilder@9.0.7)  
3 Mar 16:46:09 - [info] [npm:80697789.8115b8] Downloaded and installed NPM module: gpx2json  
gpx2json@0.0.5 ../../tmp/d-11923-5364-8q3aln.v287c/node\_modules/gpx2json  
└── xml2js@0.4.19 (sax@1.2.4, xmlbuilder@9.0.7)  
3 Mar 16:46:09 - [info] [npm:62c2daea.5f0cb4] Downloaded and installed NPM module: gpx2json

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 16:49 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/7 "2019-03-03T16:49:07Z")

</div>

I don't see the error there.

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 16:51 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/8 "2019-03-03T16:51:30Z")

</div>

Sorry...I didnt run the flows...here it is:

3 Mar 16:48:18 - [info] [tcp in:MySensors Gateway] Error: connect ETIMEDOUT 192.168.1.20:5003  
3 Mar 16:48:18 - [info] [tcp in:MySensors Gateway] connection lost to 192.168.1.20:5003  
3 Mar 16:48:28 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003  
3 Mar 16:50:10 - [warn] [function:Format track] [object Object]  
3 Mar 16:50:10 - [warn] [function:Format track] [object Object]  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)  
3 Mar 16:50:41 - [info] [tcp in:MySensors Gateway] Error: connect ETIMEDOUT 192.168.1.20:5003  
3 Mar 16:50:41 - [info] [tcp in:MySensors Gateway] connection lost to 192.168.1.20:5003  
3 Mar 16:50:51 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003  
3 Mar 16:50:54 - [info] [mqtt-broker:Gavin GPS] Connected to broker: mqtt://m15.cloudmqtt.com:16063

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 16:57 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/9 "2019-03-03T16:57:48Z")

</div>

There are several things there I don't understand. Perhaps someone else can comment.

Does the error occur immediately or not till you send the node something? If not till you send something what are you sending. Also export the influx node so we can see how it is configured. If there is any sensitive information in that node or the influx server node that will get exported too then change those before exporting.

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 17:13 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/10 "2019-03-03T17:13:33Z")

</div>

The data consists of the following:

Latitude measurement  
Longitude measurement  
Elevation Measurement  
Timestamp

You can see the object in the following picture from the debug node before it gets formatted into the correct structure for Influxdb:

![inputdata](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e61aa03b12284cf045b2e6d10c8dd78cb3e85a52.png)

Then I have a function node to format the data for influx which contains the following:

msg.payload.Lat = parseFloat(msg.payload.Lat);  
msg.payload.Lon = parseFloat(msg.payload.Lon);  
msg.payload.Elevation = parseFloat(msg.payload.Elevation);  
msg.payload.Date = Date.parse(msg.payload.Date)

msg.payload = [  
{  
measurement: "LatLonEle",  
fields: {  
Lat: msg.payload.Lat,  
Lon: msg.payload.Lon,  
Elevation: msg.payload.Elevation  
},  
tags:{  
location:"points"  
},  
timestamp: msg.payload.Date  
}  
];  
return msg;

The first section changes the data from strings into floats and the timestamp into a date/time format and the second section structure the data into the right format according to the influxdb node documentation.

Finally the influxdb node just has the configuration for my influxdb server as follows:

![influxnode](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/846421caac56a14b997d8e33bb9ef52e7ad77a58.png)

I have grayed out the host in the picture which is the ip address for my server where the influxdb database is running.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 17:32 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/11 "2019-03-03T17:32:30Z")

</div>

Is the server address that you have greyed out the one in the error message? 35.246...

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 17:33 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/12 "2019-03-03T17:33:17Z")

</div>

yes thats correct

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 17:44 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/13 "2019-03-03T17:44:44Z")

</div>

You did not say whether you get the error even if you don't send anything to the db node.

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 17:47 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/14 "2019-03-03T17:47:13Z")

</div>

If I disconnect the influxdb node then everything is fine...its only once I connect it that I get the error

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 17:55 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/15 "2019-03-03T17:55:32Z")

</div>

Enable the debug node showing what is going to the db node, expand everything and check ok

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 18:01 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/16 "2019-03-03T18:01:41Z")

</div>

ok here it is:

 ![debugnode](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8cc41a3110ae2743126e0fb53ff0dc27537d0092.png)

Similar to the other debug node but the structure is slightly different and strings are now turned to numbers and date is in date format

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [3 March 2019 18:48 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/17 "2019-03-03T18:48:45Z")

</div>

If you had to grey out the server IP you might want to remove the log that is displaying it over and over....

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 20:16 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/18 "2019-03-03T20:16:26Z")

</div>

Looking at the info tab for the influx node I don't see where it says that the payload can be an array of 1 element containing an object of that form.

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [3 March 2019 21:27 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/19 "2019-03-03T21:27:22Z")

</div>

I copied the structure from the example batch node at the very end of the page for "node-red-contrib-influxdb" which shows the following structure:

msg.payload = [  
{  
measurement: "weather\_sensor",  
fields: {  
temp: 5.5,  
light: 678,  
humidity: 51  
},  
tags:{  
location:"garden"  
},  
timestamp: new Date()  
},  
{  
measurement: "alarm\_sensor",  
fields: {  
proximity: 999,  
temp: 19.5  
},  
tags:{  
location:"home"  
},  
timestamp: new Date()  
}  
];  
return msg;

I just replaced the fields and tags according to my data which is why I thought I had done it correctly...but it appears not.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 March 2019 21:46 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/20 "2019-03-03T21:46:51Z")

</div>

Ah, you are using the batch node that is not present in the version of node-red-contrib-influxdb that I am using.  
Your data does look ok.  
Have a look at the influxdb log on the server and see what it says about it.  
Have you successfully accessed the server at all?

---

<div class="post-metadata">

### Author: ![gavraq](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavraq](https://discourse.nodered.org/u/gavraq)
#### Post date: [4 March 2019 21:57 UTC](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554/21 "2019-03-04T21:57:14Z")

</div>

Hi Colin

Yes I can access the server, but when I review the firewall logs (I created a firewall rule to open port 8086) there is no record of any activity so I suspect the issue may be in getting the connection out of node red.

[Next page](https://discourse.nodered.org/t/emfile-error-with-influxdb/8554.md?page=2)
