0 votes
by (160 points)

Hello again, Lukas,

We have been using the Rebex file server to serve files via SCP without issue since your update. Thank you.

Unfortunately, when we send files from our system to the Rebex server we are getting errors.

We're using the call:

libssh2_scp_send64(session, (remote_path + filename).c_str(), file_info.st_mode & 0777, file_info.st_size, file_info.st_mtime, file_info.st_atime);

to send the file. The remote_path value is: "/home/laser/", and the filename is "AdapterTransform.xml":

I've turned on logging inside the Rebex server, which seems to be working, as the path is correct here:

"SCP: Executing command: DEBUG ScpModule(50)[25] scp -pt '/home/laser/AdapterTransform.xml'",

but a few lines down it says this:

Getting item info on '/home/laser/AdapterTransform.xml/AdapterTransform.xml': not found.
2023-04-25 16:55:12.486 DEBUG ScpModule(50)[46] SCP: Opening file '/home/laser/AdapterTransform.xml/AdapterTransform.xml' (Create, Write): failure.

It seems conceivable that this issue is also caused by LIBSSH2 being written in C and not therefore respecting proper .NET string formats.

Would you be able to check into this?

Our previous conversation was here: https://forum.rebex.net/22091/does-rebex-sftp-library-support-the-scp-f-switch-scp1-mode

I've placed the log at this link: https://app.box.com/s/kbp6lrmq6pzih4dn0qiiqv9a47ym4ez2

by (147k points)
I just sent a link to a hotfix to your e-mail. Please give it a try and let us know whether it resolves the issue.
by (160 points)
Hi Lukas,

Unfortunately, it does not. The files transfer, but if a file exists on the server, it is not overwritten. (Even though SCP -pt is supposed to overwrite, and I've set the (Windows) permissions on the folder to full control).  I'll take another look tomorrow.

Ron


Ugh here's a snippet from a log I generated today after installing the hotpatch with the same path issue:

023-04-25 16:55:12.474 DEBUG ScpModule(50)[46] SCP: Getting item info on '/home/laser/AdapterTransform.xml/AdapterTransform.xml': not found.
2023-04-25 16:55:12.486 DEBUG ScpModule(50)[46] SCP: Opening file '/home/laser/AdapterTransform.xml/AdapterTransform.xml' (Create, Write): failure.
2023-04-25 16:55:12.487 VERBOSE FileServer(1)[45] SSH: Session 50: Sent packet SSH_MSG_CHANNEL_DATA (85 bytes).
2023-04-25 16:55:12.487 LEVEL0 FileServer(1)[45] SSH: Sent packet data:
 0000 |5E-00-00-00-00-00-00-00 4C-01-73-63-70-3A-20-2F| ^.......L.scp: /
 0010 |68-6F-6D-65-2F-6C-61-73 65-72-2F-41-64-61-70-74| home/laser/Adapt
 0020 |65-72-54-72-61-6E-73-66 6F-72-6D-2E-78-6D-6C-2F| erTransform.xml/
 0030 |41-64-61-70-74-65-72-54 72-61-6E-73-66-6F-72-6D| AdapterTransform
 0040 |2E-78-6D-6C-3A-20-50-61 74-68-20-6E-6F-74-20-66| .xml: Path not f
 0050 |6F-75-6E-64-0A                                 | ound.
by (147k points)
Please make sure you are actually using the new assemblies in your app. The log looks just like from the previous version. If you are indeed using the new version, please post the section of the log that shows SSH_MSG_CHANNEL_REQUEST and the log entries following that.
by (160 points)
Hi Lukas,

I'm afraid it was operator error. It's working fine! (I was using the proper version DLL 6.0.8519.0, but our software fetches before I was uploading, "corrupting" the file I was uploading).

Thanks again for your quick responses.

Ron
by (147k points)
Thanks for the update! If you notice any unexpected behavior, please let us know. The patch is scheduled to be included in R6.13 next month.

1 Answer

0 votes
by (147k points)

Hello, thanks for reporting this!
It's not a .NET vs C issue, but rather an incompatibility in handling these kinds of requests. We'll modify our SCP server to accommodate for this. I'll mail you a link to a hotfix when it's ready.

...