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

Mounted ftps doesn't show all the files and directories #9630

Closed
cdamken opened this issue Jul 15, 2014 · 48 comments
Closed

Mounted ftps doesn't show all the files and directories #9630

cdamken opened this issue Jul 15, 2014 · 48 comments

Comments

@cdamken
Copy link
Contributor

cdamken commented Jul 15, 2014

Expected behaviour

Mounting a ftps file system. put and erase files/directories and can be used with ownCloud

Actual behaviour

Mounting a ftps file system. put and erase files and ownCloud do not refresh the files or directories

Steps to reproduce

  1. Mounting an external ftps, can be seen in ownCloud
  2. Actual files and directories are shown
  3. Put new files and/or directories in the ftps with an external application
  4. Files and directories are not shown
    1. Nothing gets better if I execute 'php console.php files:scan --all' (It doesn't refresh)

Server configuration

ownCloud version: 6.0.4

00001186

@cdamken cdamken added the Bug label Jul 15, 2014
@PVince81
Copy link
Contributor

With FTPS you mean FTP + secure checkbox ?

There's trouble with some FTP servers that they don't return any mtime, so update detection cannot work.

Related: #6395

@icewind1991 maybe we need to put return false; in the hasUpdated as well ?

@cdamken
Copy link
Contributor Author

cdamken commented Jul 15, 2014

@PVince81 yes: ftp with secure checkbox. The FTP server is ProFTPD

@MTRichards
Copy link
Contributor

Have you set up a cron job (admin page > set background jobs to cron > configure an OS cron job to execute the cron).
Probably the issue is that ownCloud doesn't know that files have been added to the FTP server, since the FTP server doesn't tell this to ownCloud. Therefore, you need to set the cron job to occasionally scan for updates.

@karlitschek
Copy link
Contributor

@cdamken
Copy link
Contributor Author

cdamken commented Jul 23, 2014

@MTRichards what should the cron job says?, As I wrote before: php console.php files:scan --all' (It doesn't refresh)
Even unmouning and remounting does not help.

@MTRichards
Copy link
Contributor

@karlitschek @DeepDiver1975 Any help on the specific syntax of the cron job? @cdamken has an example above, but it doesn't seem to work.

@DeepDiver1975
Copy link
Member

@cdamken are you executing the console call with the web server user?

@cdamken
Copy link
Contributor Author

cdamken commented Jul 25, 2014

@DeepDiver1975 @MTRichards

I just mounted a local directory with my ftps server (using curlftpfs) and added to OwnCloud as an external storage. I can see that ownCloud can access to the files in the FTP server, and it refreshes the content although the files have been uploaded through an FTP client. There are some problems to create files trough the ownCloud client in that directory, but it seems it's a problem with curlftpfs (the files cannot be created in the file system either)

When I use "Local" as an external storage, I see that if I delete the storage, the oc_filecache table keeps the old entries, but once I create again the local external storage, this table get refreshed with the new files (I deleted directly some files in the meantime). It doesn't happen if I create an external storage as FTP, since the files in the oc_filecache table that belong to this external storage don' get
refreshed (after recreating the storage, I can see some files that don't exist anymore) Nothing gets better if I execute 'php console.php files:scan --all'

You can see attached tree files: the ftp external storage definition (ac.png, where the indicator is green), the files not refreshed that I can see through the web interface (edw.png) and the files that actually exist in the ftp server (Ftp_folder.png). In order to reproduce it, you just have to create the FTPS external storage and delete some FTP files through the ftp client, not the owncloud client.

Attached in: S3-ownCloud\Shared\owncloud\support\github-issues\core\9630

@PVince81
Copy link
Contributor

@icewind1991 please help. Thanks.

@cdamken
Copy link
Contributor Author

cdamken commented Jul 31, 2014

@DeepDiver1975 From the web server, as administrator

@icewind1991
Copy link
Contributor

It might be caused by the filecache entries not having valid hashes of the path, which makes it impossible for the scanner to remove the files. Can you try running

SELECT * from oc_filecache WHERE path_hash != md5(path);

(this is mysql specific, you probably need to replace the oc_ prefix)
(see also #10705)

You can also try re-running the scanner and checking the output it generates, if the output of the scanner lists the removed files it means it's a problem with the storage backend

@cdamken
Copy link
Contributor Author

cdamken commented Sep 25, 2014

@icewind1991 I saved the results here: S3-ownCloud\Shared\owncloud\support\github-issues\core\9630\New\

@cdamken
Copy link
Contributor Author

cdamken commented Oct 13, 2014

@icewind1991 Any news?

@cdamken
Copy link
Contributor Author

cdamken commented Nov 4, 2014

@butonic @PVince81 @icewind1991 http://www.proftpd.org/docs/howto/Timestamps.html

Question: Does ProFTPD support changing the timestamp on a file using the MDTM command? That's what my client does.
Answer: No.

Why not? For several reasons:

The MDTM command is not one of the commands mandated by RFC959.
Some FTP clients use MDTM for retrieving the modification time, others try to use it to set the modification time, and still others do both.
Among those FTP clients that do use MDTM, there is no consistent format of the timestamp used.

In short, it is a royal mess. ProFTPD supports MDTM for retrieving the modification time, in GMT. Period.
So it seems that you can get the mtime date for a file using the MDTM command. I don't know if the mechanism used by OwnCloud involves using this command or some other. I tried myself sending the MDTM command against my Proftpd server and got a timestamp returned. I guess that Owncloud doesn't need to set the mtime itself, because probably we would need to recompile the FTP server with additional modules.

@PVince81
Copy link
Contributor

PVince81 commented Nov 4, 2014

ownCloud is using PHP's FTP stream wrapper. So if that one isn't using that command then it won't work.
At some point I suggested rewriting the FTP external storage to use the real client API: #6468

@craigpg craigpg modified the milestones: 2014-sprint-08-current, 2014-sprint-07 Nov 10, 2014
@craigpg craigpg modified the milestones: ownCloud 8, 8.0-current Dec 22, 2014
@DeepDiver1975 DeepDiver1975 modified the milestones: 8.0-current, ownCloud 8, 8.1-next Jan 8, 2015
@ghost ghost modified the milestones: 9.1-current, 9.0.1-current-maintenance Mar 18, 2016
@ghost
Copy link

ghost commented Mar 18, 2016

done

@PVince81 PVince81 modified the milestones: 9.1-current, 9.1.1-next-maintenance Jun 30, 2016
@PVince81 PVince81 modified the milestones: 9.1.2, 9.1.1 Sep 21, 2016
@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 20, 2016
@PVince81 PVince81 modified the milestones: 9.1.4, 9.1.3 Dec 22, 2016
@PVince81 PVince81 modified the milestones: 9.1.5, 9.1.4 Feb 6, 2017
@PVince81 PVince81 modified the milestones: 9.1.6, 9.1.5 Apr 13, 2017
@cortho cortho self-assigned this May 12, 2017
@PVince81
Copy link
Contributor

please test with the files_external_ftp app from the marketplace and see if the problem persists

@PVince81 PVince81 modified the milestones: triage, 9.1.6 May 29, 2017
@cdamken
Copy link
Contributor Author

cdamken commented Dec 14, 2017

I will test it and reopen (or create a new issue) if the problem still appears.

@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests