How to use node-red-contrib-smb get file?

I don't know how to use
node-red-contrib-smb to get file,pls help me....:tired_face:

Hi @GordonSu - it isn't a node I've ever used, but looking at it, I can see you can configure the node to do the operation 'Get File', along with the path of the file to get.

Unless someone responds who has used the node (but given its download stats, that may be unlikely), could you describe a bit more about what you've tried so far?

At the moment I am not even able to install the package:

root@node-red:~# npm install -g node-red-contrib-smb
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/netsmarttech/node-smb2.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-31T14_54_27_878Z-debug.log

Does the server running node-red have internet access?

And normally we don't encourage people to install nodes globally. (drop the -g if you can)

root@node-red:~# npm install -g node-red-contrib-smb

also why are you running as root?

@Steve-Mcl : yes, it does. all the other packages can be easily installed.
@dceejay: you're right. Usually I use the "manage palette" install function from the editor. I just made a test with command line.
@zenofmud: also right. will be changed soon...

This means npm could not find the Git binary in your environment (probably not installed). If you check the node's package.json, you'll see that one of its dependencies is linked to a git repository, and that's why git is needed there.

We're the developer of this node, we've let it like this at the time because of issues with the original smb library. There are other minor issues with this node we want to fix, so we can already check if we can change it back to the original npm dependency.

2 Likes

@gfcittolin I noticed you just released a new version (1.1.0).
Installation and the package in general is now working fine!
I am just reading text files from our server, but no issues for the moment.

Thanks a lot!!!!

3 Likes

You're welcome! I tried to improve the node's layout and documentation, hopefully making it easier to use. Beside of that, some bugs on specific configuration scenarios were fixed. Let me know if you find any other issue

1 Like

For the moment seem to be running like a charm!:ok_hand:

There is only one thing I don't understand: I have to specify a specific share folder in the config node. If I specify only the address seems not to work (see images). But maybe this is related to how our server is configured...


why mine always shows blue dot process only? anything wrong? something missed for nodejs I guess...

Please help!

image

I have same issue, just stuck at process...

Hello, I am facing the same issue with SMB node on NodeRed.
Hello.
I am using the operation "Create file" in order to create a new file, & for a new file it works absolutely fine, but when a file with same name already exists, then the complete NodeRed crashes.
Here a screenshot of my log message:

Question:

         case "create":
                    let data = "";
                    if (msg.hasOwnProperty("payload")) {
                        data = msg.payload;
                    }
                    node.statusProcess();
                    node.config.writeFile(filename, data, (err) => {
                       if (err) {
                            node.statusError();
                            done(err);
                            return;
                        }
                        node.statusDone();
                        send(msg);
                        done();
                    });
                    break;

While debugging I found that the code is going into "if (err)" statement above and then returning: [error] Error: STATUS_OBJECT_NAME_COLLISION (0xC0000035) : The object name already exists.
Then suddenly everything stops & Node Red crashes.

I am using the latest version of SMB node from here: GitHub - st-one-io/node-red-contrib-smb: Node of Node-RED for SMB Protocol.

@gfcittolin Is this a bug in the Code or am I missing something. Please help me out in this. Thanks in advance.

Regards

I see you opened an issue on this node’s GitHub page five days ago and tagged one of the contributors of the node.

Seeing that the node hasn’t been updated in almost 2 years (at the time of this post) and two of the contributors of the node haven’t been active on GitHub over the last year, I would suggest that this node has been abandoned and you should look for another way to solve your issue.

@zenofmud Thank you very much for your quick response. Since many of them were able to successfully use this node, I thought there might be something that I am missing.
Instead of showing the error on the debug sidebar, its shutting the NodeRed and the Error can be seen on the Log file. I hope to find a solution to this..
Thanks.

Hello!

Did someone find a solution for this issue?

I have developed a dashboard in which i an able to create (at designated times) some csv and json files containing some information acquired from OPC UA server. The node red works on an external devide on linux but i want my csv files to be downloadable on windows so that i can get something like a daily report. I have tried using this smb node but i am finding some issues in configuring it. how should i configure it in order to download the csv files locally on windows inside the local download folder ? (supposing not to hava a shared folder like a nas).

i have a shared folder on a nas and i have tried to create some folders an files on that nas but i could not achieve a solution and i am a bit stuck. Can someone help me?

i am using node red v1.0.3 ( i cannot update it) and the contrib-smb is 1.2.0

You can use file transfer over OPC UA.