# Node File not creating or appending file

**URL:** <https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760>\
**Category:** General\
**Created:** [1 July 2019 00:04 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760 "2019-07-01T00:04:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romulas](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Romulas](https://discourse.nodered.org/u/Romulas)\
**Post date:** [1 July 2019 00:04 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/1 "2019-07-01T00:04:37Z")

</div>

Hi I've been using the Nodered plugin in Hassio for a while works great I have quite a few flows running.

I would like to log MQTT payloads to a file.  
To test I send a simple timestamp to the File Node.  
(Standard File Node node-red0.20.3)  
No errors are reported but the file is not created or if I manually create it, it is not written to.  
The Directory exists on the Pi. I monitor it using Filezilla.

HassOS 2.8 shows I have Version Nodered 2.0.2 installed . Also says 4.01 while available is not compatible with my system so I can't update at this point.

If I try and enter an invalid file path in the File Node I get an error message saying directory doesn't exist and it does not complain when I use the correct path so seems it can see the file location.

Does anyone have a suggestion on what I could try.

Simple Flow is shown below.  
[{"id":"3a9d656f.069eba","type":"tab","label":"Flow 7","disabled":false,"info":""},{"id":"1b4074a1.95467b","type":"debug","z":"3a9d656f.069eba","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":906.017333984375,"y":424.0104064941406,"wires":},{"id":"9bd99b74.6d5b08","type":"file","z":"3a9d656f.069eba","name":"","filename":"/home/pi/logs/sonoffevents.log","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":630.5141296386719,"y":428.9999113082886,"wires":[["1b4074a1.95467b"]]},{"id":"ae786a5e.151358","type":"inject","z":"3a9d656f.069eba","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":356.07666778564453,"y":430.71162700653076,"wires":[["9bd99b74.6d5b08"]]}]

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 July 2019 00:17 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/2 "2019-07-01T00:17:10Z")

</div>

You might want to try the new flogger node?

---

<div class="post-metadata">

**Author:** ![Romulas](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Romulas](https://discourse.nodered.org/u/Romulas)\
**Post date:** [1 July 2019 00:25 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/3 "2019-07-01T00:25:16Z")

</div>

Thanks for the suggestion but had the same result . File not created. Existing file not appended too.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [1 July 2019 08:19 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/4 "2019-07-01T08:19:50Z")

</div>

Have you checked permissions on that folder and the file? Is it owned by the pi user or root?

---

<div class="post-metadata">

**Author:** ![Romulas](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Romulas](https://discourse.nodered.org/u/Romulas)\
**Post date:** [2 July 2019 04:54 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/5 "2019-07-02T04:54:01Z")

</div>

The whole thing was built using the [Hass.io](http://Hass.io) installer onto a pi, [Hass.io](http://Hass.io) then has a plugin for Nodered so I assumed it would own the files but as you suggest it's worth checking. When I putty into the pi I just see the [Hass.io](http://Hass.io) CLI which I cant figure out how to exit. The Command line doesn't seem to recognize simple linux commands like 'ls' . Is there a way to exit this view. Sorry might be a better question for the [Hass.io](http://Hass.io) community.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [2 July 2019 16:17 UTC](https://discourse.nodered.org/t/node-file-not-creating-or-appending-file/12760/6 "2019-07-02T16:17:07Z")

</div>

Yes, sorry I think that you would be better off asking there.
