FTP does not work from a docker-mesos container

I have a scala application with akka pairs. So, the flow of my application is as follows:

1. Check if file exists on FTP - I'm doing it with the org.apache.commons.net.ftp.FTPClient
2. If it exists stream it via alpakka library(and make some stream transformations)

My application runs locally and can connect to the server.

The problem is that it is being deployed to dcos / mesos. I have a problem:

java.io.IOException: /path/file.txt: No such file or directory

I can safely say that the file still exists. Also, when I try to connect from the docker container locally via ftp, I have something like this:

ftp> open some.ftp.address.com
Connected to some.ftp.address.com.
220 Microsoft FTP Service
Name (some.ftp.address.com:root): USER
331 Password required
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> dir
501 Server cannot accept argument.
ftp: bind: Address already in use
ftp> 
+4
source share
1 answer

So my problem was really strange. But I managed to fix it. Quick answer: I used alpakka ftp lib this way:

Ftp
  .fromPath(url, user, pass, Paths.get(s"/path/$fileName"))

, :

val ftpSettings = FtpSettings(
  host = InetAddress.getByName(url),
  port = 21,
  NonAnonFtpCredentials(user, pass),
  binary = true,
  passiveMode = true
)
Ftp
  .fromPath(Paths.get(s"/path/$fileName"), ftpSettings)

: alpakka lib, , , !

https://github.com/akka/alpakka/blob/master/ftp/src/main/scala/akka/stream/alpakka/ftp/impl/FtpOperations.scala

, , , . , , ftp- Windows ... , - , , :)

+1

Source: https://habr.com/ru/post/1668393/


All Articles