<p>The log message</p>
<pre><code>runCommand error: system(/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js ea31b10db3554ba03a81166c27aa94ba27c335769 7cdd834509731c8946d6fde &gt; /dev/null 2&gt;&amp;1) returned 256
</code></pre>
<p>is not an error log entry produced by <code>/root/.nvm/versions/node/v11.15.0/bin/node</code> (as such output would be redirected to /dev/null). It is an error reported by <code>bitcoind</code> because the command invoked returned failure. Redirecting output does not change the return value of a command.</p>
<p>Try adding <code>|| true</code> at the end of the command.</p>

CC BY-SA 4.0
2022-05-11T21:37:25.117Z
2022-05-11T21:37:25.117Z
Pieter Wuille
<p>I have this code in my bitcoin.conf</p>
<p><code>blocknotify=/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js %s &gt; /dev/null 2&gt;&amp;1</code></p>
<p>I see the error</p>
<p><code>runCommand error: system(/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js ea31b10db3554ba03a81166c27aa94ba27c335769 7cdd834509731c8946d6fde &gt; /dev/null 2&gt;&amp;1) returned 256</code></p>
<p>As whenever I'm not running an additional script <code>/home/BTC/block.js</code> is automatically deleted.</p>
<p>Why does bitcoin debug ignore <code>/dev/null 2&gt;&amp;1</code> and how do I stop it?</p>
<p><strong>@m1xolyd1an, sorry if I am not clear:</strong></p>
<p>The %s gives the block hash to the block.js nodejs script if the script exists (and when it does block.js accepts the hash fine and does what it needs to do). The problem is that the instruction to ignore all errors in the conf is not upheld by bitcoind, thus, my debug.log looks terrible when blocks.js does not exist. blocks.js only exists when it is created by another script and when that script terminates it deletes blocks.js</p>

CC BY-SA 4.0
2022-05-11T16:35:27.220Z
What are you trying to do with the %s data all by itself after block.js? I think your space after .js and before %s might be causing the problem. If you want to pass the data as a GET do something like `/home/BTC/block.js?q=%s`
m1xolyd1an
CC BY-SA 4.0
2022-05-11T18:07:39.293Z
No it works fine with no error when the file exists.
Ben Muircroft
<bitcoin.conf><debugging>
blocknotify ignores > /dev/null 2>&1 and fills up my debug log
Ben Muircroft
# blocknotify ignores > /dev/null 2>&1 and fills up my debug log

(Asked by: username_0 on 2022-05-10)

I have this code in my bitcoin.conf

`blocknotify=/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js %s > /dev/null 2>&1`

I see the error

`runCommand error: system(/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js ea31b10db3554ba03a81166c27aa94ba27c335769 7cdd834509731c8946d6fde > /dev/null 2>&1) returned 256`

As whenever I'm not running an additional script `/home/BTC/block.js` is automatically deleted.

Why does bitcoin debug ignore `/dev/null 2>&1` and how do I stop it?

**@username_1, sorry if I am not clear:**

The %s gives the block hash to the block.js nodejs script if the script exists (and when it does block.js accepts the hash fine and does what it needs to do). The problem is that the instruction to ignore all errors in the conf is not upheld by bitcoind, thus, my debug.log looks terrible when blocks.js does not exist. blocks.js only exists when it is created by another script and when that script terminates it deletes blocks.js

**Tags:** bitcoin.conf, debugging

> **Comments:**
> **username_1**: What are you trying to do with the %s data all by itself after block.js? I think your space after .js and before %s might be causing the problem. If you want to pass the data as a GET do something like `/home/BTC/block.js?q=%s`  
> **username_0**: No it works fine with no error when the file exists.  

---

## 1 answers

### Answer by username_2 on 2022-05-11. Score: 2 | Accepted answer

The log message

```
runCommand error: system(/root/.nvm/versions/node/v11.15.0/bin/node /home/BTC/block.js ea31b10db3554ba03a81166c27aa94ba27c335769 7cdd834509731c8946d6fde > /dev/null 2>&1) returned 256

```

is not an error log entry produced by `/root/.nvm/versions/node/v11.15.0/bin/node` (as such output would be redirected to /dev/null). It is an error reported by `bitcoind` because the command invoked returned failure. Redirecting output does not change the return value of a command.

Try adding `|| true` at the end of the command.


---

