damoclark / node-red-contrib-msg-queue

A contributed Node-RED node, that queues undeliverable messages to file for later delivery.
GNU General Public License v3.0
10 stars 17 forks source link

Uncaught Exception #1

Open M-M26 opened 6 years ago

M-M26 commented 6 years ago

Hi!

At first, thanks for your message queue, I really like it. It works fast and reliable.

I just found one problem with it, namely if the queue is not in forwarding state (meaning it has some old entries in the queue to process), and you press deploy in Node-RED, you get an "Error: Call open() method before calling isEmpty()". If the queue is in forwarding state and you press deploy, it works with no error.

Do you know what's the problem with it and how to fix it?

Message from Node-RED right after clicking deploy: queue

damoclark commented 6 years ago

Hi Matthias,

I’ll investigate and get back to you.

D.

On 24 Sep 2017, at 7:06 pm, Matthias26 notifications@github.com wrote:

Hi!

At first, thanks for your message queue, I really like it. It works fast and reliable.

I just found one problem with it, namely if the queue is not in forwarding state (meaning it has some old entries in the queue to process), and you press deploy in Node-RED, you get an "Error: Call open() method before calling isEmpty()". If the queue is in forwarding state and you press deploy, it works with no error.

Do you know what's the problem with it and how to fix it?

Message from Node-RED right after clicking deploy: https://user-images.githubusercontent.com/18436284/30781023-0f372358-a118-11e7-83aa-d3ab6dc11632.JPG — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/damoclark/node-red-contrib-msg-queue/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQyphaInAxicOX53bXg_aipGJqj-twXks5slhubgaJpZM4Ph05t.

damoclark commented 6 years ago

Hi Matthias,

I'm having difficulty reproducing the problem. Can you provide me with specific steps and/or a copy of your flow that results in this error?

Could you also include details on:

. Operating System (Mac/Linux/Windows) . Hardware (Intel/Raspberry Pi) . Node Red Version . Node Version

Damien.

w4tsn commented 5 years ago

Hi Matthias and Damien,

I was able to reproduce this problem on a Windows Subsystem Ubuntu 18.04 on a x86 processor and node-red 0.20.1.

I narrowed down the problem to the life-cycle of node-red nodes and the sql configuration. When the sql connection is open or started when the node is in the processing state node-red crashes with the error mentioned above. I assume that this has to do with the order in which the life-cycle operations in node-red are called. So, when nodes are closed and created may interfere with open timer functions.

Unfortunately I was not yet able to find the root cause and fix the problem.

garethhcoleman commented 4 years ago

Hello @damoclark @w4tsn and @M-M26 I am also experiencing this issue - I'm running latest buster (10.3) on a Pi Zero W with node-red 1.05 and v1.0.2 of this node. When I try to deploy or restart flows and this node has some messages in it's queue then node-red crashes with { [Error: SQLITE_MISUSE: Database handle is closed] errno: 21, code: 'SQLITE_MISUSE' }. Impressively on restart the queue begins to empty again but still... there must be a way to hook into the deploy signal and close the connection to the database file more gracefully? Thanks for a really useful node though, despite this little quirk.

olivierpichon commented 4 years ago

Hi, I fixed this issue in this PR here : https://github.com/damoclark/node-red-contrib-msg-queue/pull/10 which is currently being reviewed. Will post an update here when / if it finally gets merged 👍

olivierpichon commented 4 years ago

We unfortunately had to go live and could not wait longer for the PR to be merged. So we pushed a fork to npm which includes a fix to this problem. The fork is called node-red-contrib-persistent-queue if anyone else needs this urgently. We will take the fork down if it eventually gets merged.

damoclark commented 4 years ago

Hi,

There are some issues with PR #10 that I am discussing with @olivierpichon that need to be resolved before I can merge the changes to the node.

D.