I have a go server that uses github.com/jlaffaye/ftp
library for getting FTP files from a remote server.
I first of all get the connection
conn, err := ftp.DialTimeout(cfg.Host+cfg.Port, time.Second*15)
if err != nil {
return nil, fmt.Errorf("ftp dial error: %v", err)
}
After which, I try to login with
err = conn.Login(cfg.Username, pwd)
if err != nil {
return nil, fmt.Errorf("ftp login error: %v", err)
}
I log in successfully while running locally.
This is also confirmed while looking at the output of
code, msg, err := c.cmd(StatusLoggedIn, "PASS %s", password)
log.Printf("pass, code %d, msg %s, err %v", code, msg, err)
if err != nil {
return err
}
Which is from my vendor pkg under \vendor\github.com\jlaffaye\ftp\ftp.go
With the output being
2021/06/16 23:12:45 pass, code 230, msg User xxxx logged in, err <nil>
While running the same service deployed on amazon ECS,
the output of the vendored pkg under \vendor\github.com\jlaffaye\ftp\ftp.go
becomes
2021/06/16 20:24:28 pass, code 0, msg , err EOF
Any idea on what might be causing this?