Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP only works with subdirectories #17

Open
ekgermann opened this issue May 29, 2017 · 29 comments
Open

FTP only works with subdirectories #17

ekgermann opened this issue May 29, 2017 · 29 comments
Assignees
Milestone

Comments

@ekgermann
Copy link

Installed from Marketplace files_external_ftp app.

Either in user or admin Storage area, I try to define an external FTP source. The status icon shows red.

In attempt to debug, I started a tshark capture and no traffic is generated from the host towards the FTP server.

Is there a prerequisite I'm missing? PHP is 7.1.5 built from source with --enable-ftp ticked. phpinfo indicates ftp and ftps streams are enabled. Setting owncloud logging to info,warnings,errors and fatal issues shows nothing in the logs.

System Status
installed true
maintenance false
needsDbUpgrade false
version 10.0.1.5
versionstring 10.0.1
edition Community
productname ownCloud

Debugging pointers appreciated.

@cmonjeau
Copy link

cmonjeau commented Jul 26, 2017

Hi,

I've the same issue with the 10.0.2 owncloud release. I've tried in a docker container too but it's the same problem.

A part of the response : "statusMessage":"League\Flysystem\FileNotFoundException: File not found at path: "

@owncloud-bot @PVince81 @DeepDiver1975 Have you observed this trouble?

@Commifreak
Copy link

Got exact same:

League\Flysystem\FileNotFoundException: File not found at path: 

@cmonjeau
Copy link

Hi @PVince81 @DeepDiver1975 or someone else,

I've tried with the 10.0.3 owncloud release and always the same issue, FTP connection doesn't work at all.

It's a problem because I can't update my Owncloud because it's an important feature for my institution.

@francesco74
Copy link

francesco74 commented Sep 21, 2017

Same for me. FTP work only on subdirectory not on root. On root directory no connection at all to server.
Owncloud version 10.0.3

@PVince81
Copy link
Contributor

Does it work for everyone on subdirectories ? If yes, maybe it's just a simple path computation bug which would be good news and easy to fix.

@PVince81
Copy link
Contributor

PVince81 commented Sep 22, 2017

Can you try adding a "/" instead of subdirectory in the configuration instead of leaving it empty, in case that helps ?

@cmonjeau
Copy link

Hi,

indeed, it works only with subdirectories but not on root, even with adding /.

Thanks for your replies!!

@francesco74
Copy link

Me too, even with "/", no connection to root directory.

@PVince81
Copy link
Contributor

Is there a docker instance with the same FTP server software that could be used to reproduce this quickly ? (I don't have an FTP instance locally for trying this)

The automated tests are currently running against vsftpd (https://github.com/owncloud/files_external_ftp/blob/master/.travis.yml#L28).

Can you guys post what FTP server software you are using ?

@cmonjeau
Copy link

Hi,

I use a proftpd server.

Maybe you can test with this public FTP server :

host : speedtest.tele2.net
user : anonymous
pwd : whatever
root : / not working but /upload works for example

Thank for you working on it.

@cmonjeau
Copy link

cmonjeau commented Oct 9, 2017

Hi @PVince81, any progress on it?

@PVince81
Copy link
Contributor

PVince81 commented Oct 9, 2017

Can you guys try replacing "/" with "" here: https://github.com/owncloud/files_external_ftp/blob/master/lib/Storage/FTP.php#L55 ?

It seems the slash might be doubled here: https://github.com/owncloud/files_external_ftp/blob/master/lib/Storage/FTP.php#L72 and maybe ProFTP doesn't like it ?

(I don't have time to debug this myself right now, sorry)

@francesco74
Copy link

Even with "" instead of "/" not work for me.
(P.S. I'm using pureFTP on a local server for testing)

@cmonjeau
Copy link

cmonjeau commented Oct 9, 2017

Not good for me too :/

@PVince81
Copy link
Contributor

PVince81 commented Oct 9, 2017

found a docker here: https://hub.docker.com/r/aexea/proftpd/

@patrickjahns
Copy link
Contributor

patrickjahns commented Jan 15, 2018

I've also encountered this problem:

Using this docker to verify:

docker run \
   --name vsftpd \
   -d \
   -e FTP_USER=test \
   -e FTP_PASS=test\
   -p 20-21:20-21 \
   -p 21100-21110:21100-21110 \
   million12/vsftpd

With ftp utility I can connect - create directories, upload files etc. no problems

In owncloud I get this:
image

And the exception in the json reply:

{
"id":1,
"mountPoint":"\/FTP",
"backend":"ftp",
"authMechanism":"builtin::builtin",
"backendOptions":{"username":"test","password":"test","host":"ftpd","root":"","port":"","secure":false},"priority":100,"mountOptions":{"encrypt":true,"previews":true,"enable_sharing":false,"filesystem_check_changes":1,"encoding_compatibility":false},
"status":1,
"statusMessage":"League\\Flysystem\\FileNotFoundException: File not found at path: ",
"userProvided":false,
"type":"system"
}

With a subdirectory previously created on the ftp it works:
image

Json answer:

{
"id":1,
"mountPoint":"\/FTP",
"backend":"ftp"
,"authMechanism":"builtin::builtin",
"backendOptions":{"username":"test","password":"test","host":"ftpd","root":"test","port":"","secure":false},"priority":100,"mountOptions":{"encrypt":true,"previews":true,"enable_sharing":false,"filesystem_check_changes":1,"encoding_compatibility":false},
"status":0,
"userProvided":false,
"type":"system"
}

cc @PVince81 - let me know if you need further details on this

@mmattel
Copy link

mmattel commented Oct 22, 2018

Is there any update on the ftp sub dir issue ?

@PVince81 PVince81 modified the milestones: QA, backlog Oct 22, 2018
@PVince81 PVince81 modified the milestones: backlog, development Oct 22, 2018
@jvillafanez
Copy link
Member

The only thing I can say for now is that it might not be possible to fetch the required information from the root folder of the ftp server.
The flysystem has some additional checks about file existence. The exception is one of them. Basically, it can't find that "" path (the root one)

I don't know for sure if it's a bug in the flysystem, or we'll have to patch it anyway because we can't get the information for the root folder.

@gekoul
Copy link

gekoul commented Oct 27, 2018

A little bit of random debugging from me. I tried all possible combinations ( "", "/", / , , ./ , /.. , etc. Νothing works and i get a monotonous "Message":"File not found at path: "

Things got a bit out of the ordinary when I opted for ../ as a root folder and then I got the expected error "message":"Exception: {"Exception":"LogicException","Message":"Path is outside of the defined root, path: [..]"

There might be a possibility that the system sends the correct path but the ftp server is messing up with the reply, or reply is not understood correctly.

@PVince81
Copy link
Contributor

@jvillafanez can we use a virtual entry for root then ?

@jvillafanez
Copy link
Member

we can fake the information based on the contents of the folder, but it might be expensive if there is a lot of content. Not sure if there is any other alternative.

@gekoul
Copy link

gekoul commented Oct 31, 2018

@PVince81 @jvillafanez I'm not sure i understand the notion of virtual entry in this context. I cannot thing of a virtual anything when it comes to / directory on ftp server. BTW tests are performed on vsftpd on Centos 7.

@PVince81
Copy link
Contributor

the main problem as I understand is that a FTP server does not return any metadata for the root entry. So we don't have metadata like "folder size", "mtime", etc, so we cannot represent that node inside of ownCloud with real information. The idea above is that instead of asking the FTP server, ownCloud populates its internal root node information with computed information.
This means it would need to retrieve the contents of the root folder and calculate the total size and maybe max(mtime) to set it on the root node. This information would likely be cached in oc_filecache, @jvillafanez, so would only need to be computed once.

The mtime is important to be able to detect changes that happened remotely.

@jvillafanez
Copy link
Member

I think we'll also need to compute the mtime based on the contents. If this the case, this will be expensive because we'll have to scan the contents to know if something has changed.

@mmattel
Copy link

mmattel commented Oct 31, 2018

but only for the root dir - or?

@PVince81
Copy link
Contributor

PVince81 commented Nov 2, 2018

in this case "a bit expensive" is likely more desirable than "not working at all" I guess

@PVince81 PVince81 modified the milestones: development, backlog Nov 29, 2018
@piotrekzielony
Copy link

Any updates on this?

I have some legacy devices running FTP and I'd like to have top / directory visible

@ChristophorusReyhan
Copy link

still not working

@IboSmiles
Copy link

For me this worked.

I just used "/tmp/.." as directory.
The "tmp" folder doesn't even exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests