Open drimmeer opened 1 month ago
Are you trying to receive the files from a remote z/OS ssh implementation? Or from our server implementation?
Do you have any logs from the z/OS machine’s ssh about the packets?
Could you maybe try out the v2
branch? The NewClient
call changes slightly, and doesn’t take any options yet. Though, it definitely won’t need either of the WithConcurrentXY
calls in the future, but I’ll probably need to adjust it to fit the MaxConcurrentRequestsPerFile
design principle for your needs. Right now, it just has a global maximum of in-flight packets, and it’s hardcoded to 64. (YAGNI principle, don’t build a feature until there’s a real-world need.)
If the two implementations differ somehow, that could be a hint into what’s breaking…
Thank you for the response.
Yes, I am trying to receive the files from a remote z/OS ssh implementation.
I managed to capture the sshd log on debug level, on the remote z/OS, and attach it here. The log for receiving files from z/OS to z/OS (which was failed): server.debuglog.receive.part.txt
The log for sending files from z/OS to z/OS (which was successful): server.debuglog.send.part.txt
go: github.com/pkg/sftp@v2: no matching versions for query "v2"
Hi Cassondra , good news!
After I took the master branch, the problem is gone!
Don't know why, but 'go get github.com/pkg/sftp
' got the 1.13.6 version, which doesn't have the z/OS support now! while 'go get github.com/pkg/sftp@master
' got the 1.13.7 version, which has the z/OS support.
So 1.13.7 solved the problem!
Huh, it could be that you already had the v1.13.6
version local, so it just used the cached value. 🤔
maybe... Is there a way for me to fix this version so that I won't be impacted if it is changed? I found that sometime ago I was able to wrap it to calculate the digest but recently I found that it didn't work! So I had to find another way to wrap it.
Ah, OK, I’ve released a new version, so we can ensure that z/OS support is in a released version. I hadn’t realized that we hadn’t released a version since.
Thank you Cassondra. What version is it? What do I put in my 'go get' and 'import' path ?
It is v1.13.7
, you should be able to update your go.mod to have github.com/pkg/sftp v.1.13.7
the import path is the same as all of the v1
versions have used.
I’ve also corrected the issue with trying to use v2
as the branch name. I just renamed it to dev-v2
and it works now.
This is what I get for not testing things before I try and release them. 🤦♀️
When I tried this branch, I got different error.
When running go get github.com/pkg/sftp@dev-v2
on Mac, I got:
go: github.com/pkg/sftp@dev-v2: github.com/pkg/sftp@v0.0.0-20240930173818-5839350cfcba: invalid version: go.mod has post-v0 module path "github.com/pkg/sftp/v2" at revision 5839350cfcba
But when running go get github.com/pkg/sftp@dev-v2
on z/OS, I got:
go: github.com/pkg/sftp@dev-v2: git init --bare in /u/jamiel/go/pkg/mod/cache/vcs/74e1affce0467ac134276b4073f643881e0cb81f11fcefd0045fc639aae1e3d1: exec: "git": executable file not found in $PATH
You need to use github.com/pkg/sftp/v2
as the import path, since this will be a v2
version.
When I tried this command, I still got error (sorry, I am quite dumb at using Go...):
go get github.com/pkg/sftp/v2
go: module github.com/pkg/sftp@upgrade found (v1.13.7), but does not contain package github.com/pkg/sftp/v2
You need to still use @dev-v2
to target the branch.
Please help! I just realized that when I ran the code on a z/OS to receive a file from another z/OS, it always failed when trying to open the sftpClient, with error message: _sftp: "Bad message" (SSH_FX_BADMESSAGE)
Please note that sending file from z/OS to z/OS is successful; And receiving/sending file between Linux and z/OS is also successful!
I tested this on 4 z/OS machines already...
I am using the 'master' branch, which is v1.13.6
Here is the related code: