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
OC5.0.6 - External Storage - FTP - unable to mount share #3408
Comments
Point 4) As far as I can see the stat error is caused because the command is used on an empty $path at the given address. After changing the stat function in public function stat($path) {
if(!empty($path) && $path != "/") {
return stat($this->constructUrl($path));
} else {
return true;
}
} |
I did further investigations and found out that the created FTP link in the files window differs from the links created for LOCAL or SMB shares. This seems to be the reason why the "Cloud not found, i //BilderHome" error message is shown after the file_exists check in LOCAL mount: https://test.privat.lan/owncloud/index.php/apps/files?dir=/Bilder-Ablage
SMB mount: https://test.privat.lan/owncloud/index.php/apps/files?dir=//MP3-Archiv
Google mount: http://eis1-dev.privatnet.lan/owncloud5/index.php/apps/files?dir=//GoogleDrive
FTP mount: https://test.privat.lan/owncloud/index.php/apps/files/download//BilderHome Unfortunately I don't have a clue how and where these URLs are created :-( @icewind1991 It seems that you know this part of OC very well. Could you give me a hint |
The problem still exists in OC5.0.10 |
@icewind1991 THX |
The problem still exists in OC5.0.12 |
I am seeing this in 5.0.12 as well. Would love to get this fixed, as this is the last piece I need for a production OC instance. |
@PVince81 What do you think? |
Just tried in OC 5.0.13 and I'm able to mount an FTP volume. Works in OC 6 beta 4 except for deleting folders. |
@PVince81 I've just tried to access the FTP mount in OC6 beta4 on my server and the displayed problem is still the same. I'm able to access the ftp share it when I use the ftp command from the command line. What kind of information do you need to identify the root cause of the problem? |
@PVince81 I've just tried to access the FTP mount in OC 5.013 on my server and the displayed problem is still the same. |
I was using vsftpd 2.3.5 on Ubuntu 12.04.3 LTS. I'll have a try with Pure-FTPd |
There seems to be a bug when specifying the root folder. Make sure to have a trailing slash at the end of it. (but I don't think it's related) |
@PVince81 I've already tested this but unfortunately without success. |
I installed pureftpd 1.0.36 on Ubuntu 12.10 in a VM using the following: http://wiki.ggis.biz/index.php/Pure-FTPd_on_Ubuntu It works fine with OC6 beta 5 (master) and OC 5.0.13. The only issue is if I have big media files on the FTP it takes a long time to index, but that's a known issue that is fixed in OC 6 (mime type detection) |
Btw, on that info page I stopped before the "TLS/SSL support". |
Should work. Please retest with ownCloud 6 |
Ok, I tested the following things:
6.) Created the following php script and ran it. <?php
$ftp_server = "127.0.0.1";
$ftp_user = "ftpuser";
$ftp_pass = "ftptest";
echo "- start -----------------------<br>\n";
// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server");
// login
$login_result = ftp_login ($conn_id, $ftp_user, $ftp_pass);
// check open
if ((!$conn_id) || (!$login_result)) {
echo "FTP connect failed!<br>\n"; die;
} else {
echo "connected to FTP server.<br>\n";
echo "- file list -------------------<br>\n";
// get contents of the current directory
$contents = ftp_nlist($conn_id, ".");
// output $contents
foreach($contents as $item) {
echo "+ $item<br>\n";
}
// close this connection
ftp_close($conn_id);
}
echo "- end -------------------------<br>\n";
?> Due to the fact that a basic FTP connect and authentication was possible using the given script, the FTP server access should be ok. |
To investigate further I added a
BTW: I wonder if it is correct that only the |
@j-ed thanks for the info. For FTP ownCloud uses ownCloud also reads files using ftp.php relies on the base class' stat implementation (streamwrapper.php) and doesn't need its own specific one. |
@PVince81 I did further investigations on this issue and found several comments on the Internet describing problems with the
|
If PHP fails on stat() there isn't much we can do about it except for rewriting it... Your PHP version (5.3.13) should be recent enough. |
@PVince81 I updated PHP to v5.4.21 but the problem still persists. In addition I checked the PHP changelog for FTP related issues but I wasn't able to find any issue of relevance. Wouldn't it be sufficient to add a dedicated stat() function to ftp.php? |
@j-ed I'm not sure how to implement such function. It would still need to go through FTP to fetch the relevant information. One idea would be to rewrite the ftp storage to use the approach you used in your test scripts above. The only thing I can think of now is trying to Google the issue (I know you did already) to find out under what conditions stat() doesn't work for FTP in PHP. 😦 |
You don't happen to have something like apparmor or selinux running ? |
Sorry, no apparmor nor selinux running. |
@j-ed In your test script consider calling ftp_pasv() as that is what the FTP stream wrapper expects to work as per http://www.php.net/manual/en/wrappers.ftp.php Also, you may just want to give an external host a try. E.g. |
Additionally, you may want to look into something like wireshark or tcpdump to see what is going on. |
@bantu I ran various FTP tests and also included ftp_pasv() but without any change on the results. |
@bantu First I executed the Then I accessed the URL using From my point of view PHP seems to have a problem interpreting the given URL properly. Unfortunately I don't have a clue how to debug PHP to find the root cause of the problem. |
Can you check your php.ini and make sure that "allow_url_fopen" is allowed ? Could be related... |
@PVince81 That was the first thing I checked, although fopen and all ftp_... commands are working properly: |
If even PHP 5.4 isn't able to stat FTP URLs, I'm out of ideas what could be wrong here 😦 |
Looks like I've got it as well now... I have two VMs, one with pureftpd and one with vsftpd. |
Any update on this? Is this still reproducible? |
I will set-up a new test environment with the latest OC 6.0.4 and check if this problem is reproducible. |
This is causing me headaches also. I'm able to connect to my FTP server using a small PHP test script with ftp_login(), but stat() fails, both in owncloud and as a separate test script. Am I correct that stat('ftp://user:pass@sqroot.eu/data01/sqroot/domeenid/www.sqroot.eu/owncloud/'); should succeed in theory? |
In theory it should succeed, at least it does on most installs. |
Tested FTP shares on oC 7.0.3 with PHP 5.6.3, against vsftpd 3.0.2. No |
Can´t be produced. I assume this is fixed. If not please reopen |
I've installed Pure-FTPd on my server and ran some tests. Filezilla works like a charm but as soon as I'm trying to access the server via a FTP share from ownCloud v7.0.4 it still doesn't work. I'm not able to connect to this server using EnvironmentServer ConfigurationOS: Linux 3.2.54 Client ConfigurationBrowser: Firefox v34.0 |
I remember that you were using a custom-built Linux distro. Did you check whether PHP was setup/installed properly there (maybe compare the config/libs with other distros) ? |
@PVince81 As a first step I verified all setting etc. but couldn't find a reason for that problem. I also did some research on the Internet concerning the |
@icewind1991 has been working on a new implementation here: #14551 |
@j-ed still having this problem with newer PHP versions ? |
@PVince81 I've justed tested it in the following environment, but the problem still persists. Server ConfigurationOS: Linux 3.2.67 Client ConfigurationBrowser: Firefox 40.0.2 |
No information. Please comment again if the issue continues on new ownCloud versions. |
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. |
Expected behaviour
If you've created a FTP mount configuration the share should automatically be mounted.
Actual behaviour
The configured FTP share is not being mounted if I select the share
BilderHome
from the files tab and the message "Cloud not found, i //BilderHome" is shown instead. It might be important to mention that the mount pointBilderHome
is displayed as a file and not as a folder.Steps to reproduce
2.1) At first I've created the following
mount.php
file to test access to the server:2.2) In addition I've also tried to create the same ftp mount using the GUI to access the server. As a result the following
mount.json
file was created:If I select the displayed share
BilderHome
, which is not displayed as folder but as a file, the message "Cloud not found, i //BilderHome" is displayed.If I select the Administrator menu, the following PHP error is shown on the screen for a short moment:
Environment
Server Configuration
OS: Linux 2.6.24-24
Web server: Apache/ 2.2.22
Database: MySQL
PHP version: 5.3.13
Pure-FTPd v1.0.36
ownCloud version: 5.0.6
Client Configuration
Browser: Firefox 21.0
Operating system: Windows 7
The text was updated successfully, but these errors were encountered: