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

OC7.0b1: all SFTP uploads fail, though able to create folders #9320

Closed
MarvinFS opened this issue Jul 1, 2014 · 37 comments · Fixed by #9605
Closed

OC7.0b1: all SFTP uploads fail, though able to create folders #9320

MarvinFS opened this issue Jul 1, 2014 · 37 comments · Fixed by #9605

Comments

@MarvinFS
Copy link

MarvinFS commented Jul 1, 2014

Steps to reproduce

  1. Mount an SFTP storage on users level
  2. Try to create folders
  3. Try to upload files
    4 Try to download existing files on the server (yes i know that you better not directly modify FS and exclusive OC resource access)

Expected behaviour

  1. User can create folders
  2. User can upload files
  3. User can download files

Actual behaviour

  1. Users CAN create folders, and they appears on the target SFTP server
  2. User's CANNOT upload any files. all uploads are failed with "The target folder has been moved or deleted" yellow alert message.
  3. Although i can see existing files in OC UI on the server, but can't download 'em also with "no such file or dir name"

Server configuration

UBUNTU12LTS

Web server:
APACHE 2.4

Database:
MYSQL 5.5.37

PHP version:
5.5.14

ownCloud version:
7.0b1

Updated from an older ownCloud or fresh install:
fresh

List of activated apps:
only defaults and encryption enabled

The content of config/config.php:

'oc00bb20a276', 'passwordsalt' => '*** Removed for security reasons', 'trusted_domains' => array ( 0 => 'cloud.soulfly.us:8443', ), 'datadirectory' => '/var/www/owncloud/data', 'dbtype' => 'mysql', 'version' => '7.0.0.2', 'dbname' => 'name', 'dbhost' => '127.0.0.1', 'dbtableprefix' => 'prefix_', 'dbuser' => 'user', 'dbpassword' => '', 'installed' => true, 'ldapIgnoreNamingRules' => false, 'loglevel' => '0', 'forcessl' => true, ); **Are you using external storage, if yes which one:** local/smb/sftp/... SFTP **Are you using encryption:** yes/no YES ### Client configuration **Browser:** FIREFOX 30, IE 11 **Operating system:** Windows 7,8.1 ### Logs #### ownCloud log (data/owncloud.log) {"reqId":"53b19dbfcb01b","app":"PHP","message":"fopen(): Unable to find the wrapper "sftp" - did you forget to enable it when you configured PHP? at \/var\/www\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":3,"time":"2014-06-30T17:26:25+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"} {"reqId":"53b19dbfcb01b","app":"PHP","message":"fopen(sftp:\/\/...@server.name\/ocloud\/Artist.srt): failed to open stream: No such file or directory at \/var\/www\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":3,"time":"2014-06-30T17:26:25+00:00","method":"POST","url":"\/index.php\/apps\/files\/ajax\/upload.php"} _**Any other sftp external clients can upload files on server successfully except owncloud! *_* The PHP's SFTP wrapper is there: ``` php -r 'var_dump(stream_get_wrappers());' array(17) { [0]=> string(5) "https" [1]=> string(4) "ftps" [2]=> string(13) "compress.zlib" [3]=> string(14) "compress.bzip2" [4]=> string(3) "php" [5]=> string(4) "file" [6]=> string(4) "glob" [7]=> string(4) "data" [8]=> string(4) "http" [9]=> string(3) "ftp" [10]=> string(4) "phar" [11]=> string(3) "zip" [12]=> string(10) "ssh2.shell" [13]=> string(9) "ssh2.exec" [14]=> string(11) "ssh2.tunnel" [15]=> string(8) "ssh2.scp" [16]=> string(9) "ssh2.sftp" } ``` target sftp server is debian 7,no selinux, chrooted user ocloud with no shell on /opt/ocloud folder tried all permission variants up to 777 root@server:/opt# ls -la total 12 drwxr-xr-x 3 root root 4096 Jun 30 22:06 . drwxr-xr-x 22 root root 4096 Apr 24 03:57 .. drwxrwxrwx 3 root root 4096 Jul 1 00:39 ocloud Target SFTP server's logs: ``` Jul 1 00:20:22 marvinfs sshd[6021]: debug1: SSH2_MSG_NEWKEYS received [preauth] Jul 1 00:20:22 marvinfs sshd[6021]: debug1: KEX done [preauth] Jul 1 00:20:22 marvinfs sshd[6021]: debug1: userauth-request for user ocloud service ssh-connection method password [preauth] Jul 1 00:20:22 marvinfs sshd[6021]: debug1: attempt 0 failures 0 [preauth] Jul 1 00:20:22 marvinfs sshd[6021]: debug1: user ocloud matched 'User ocloud' at line 79 Jul 1 00:20:22 marvinfs sshd[6021]: Accepted password for ocloud from IP port 58388 ssh2 Jul 1 00:20:22 marvinfs sshd[6021]: debug1: monitor_read_log: child log fd closed Jul 1 00:20:22 marvinfs sshd[6021]: debug1: monitor_child_preauth: ocloud has been authenticated by privileged process Jul 1 00:20:22 marvinfs sshd[6021]: User child is on pid 6023 Jul 1 00:20:22 marvinfs sshd[6023]: debug1: SELinux support disabled Jul 1 00:20:22 marvinfs sshd[5839]: debug1: Forked child 6025. Jul 1 00:20:22 marvinfs sshd[6025]: Set /proc/self/oom_score_adj to 0 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: inetd sockets after dupping: 3, 3 Jul 1 00:20:22 marvinfs sshd[6025]: Connection from IP port 41381 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: Client protocol version 2.0; client software version phpseclib_0.3 (bcmath) Jul 1 00:20:22 marvinfs sshd[6025]: debug1: no match: phpseclib_0.3 (bcmath) Jul 1 00:20:22 marvinfs sshd[6025]: debug1: Enabling compatibility mode for protocol 2.0 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u1 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: permanently_set_uid: 102/65534 [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256 [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: SSH2_MSG_KEXINIT sent [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: SSH2_MSG_KEXINIT received [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: kex: client->server arcfour256 hmac-sha1-96 none [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: kex: server->client arcfour256 hmac-sha1-96 none [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: expecting SSH2_MSG_KEXDH_INIT [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: SSH2_MSG_NEWKEYS sent [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: expecting SSH2_MSG_NEWKEYS [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: SSH2_MSG_NEWKEYS received [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: KEX done [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: userauth-request for user ocloud service ssh-connection method password [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: attempt 0 failures 0 [preauth] Jul 1 00:20:22 marvinfs sshd[6025]: debug1: user ocloud matched 'User ocloud' at line 79 Jul 1 00:20:22 marvinfs sshd[6025]: Accepted password for ocloud from IP port 41381 ssh2 Jul 1 00:20:22 marvinfs sshd[6025]: debug1: monitor_read_log: child log fd closed Jul 1 00:20:22 marvinfs sshd[6025]: debug1: monitor_child_preauth: ocloud has been authenticated by privileged process Jul 1 00:20:22 marvinfs sshd[6025]: User child is on pid 6027 Jul 1 00:20:22 marvinfs sshd[6027]: debug1: SELinux support disabled Jul 1 00:20:22 marvinfs sshd[6025]: debug1: do_cleanup Jul 1 00:20:22 marvinfs sshd[6013]: debug1: do_cleanup Jul 1 00:20:22 marvinfs sshd[6009]: debug1: do_cleanup Jul 1 00:20:22 marvinfs sshd[6021]: debug1: do_cleanup ``` SFTP external storage users's json ``` /var/www/owncloud/data/user1# cat ./mount.json { "user": { "user1": { "\/user1\/files\/home": { "class": "\\OC\\Files\\Storage\\SFTP", "options": { "host": "servername.ru", "user": "user2", "password": "", "root": "\/ocloud", "password_encrypted": "deleted=" }, "priority": 100 } } } } ```
@PVince81
Copy link
Contributor

PVince81 commented Jul 1, 2014

phpseclib has been upgraded/moved recently, possibly related ? #8729

@bantu did uploading work properly during your tests ?

@MarvinFS
Copy link
Author

MarvinFS commented Jul 1, 2014

as you can see from the SFTP server's log when OC is connecting, the seclib version as follows:

debug1: Client protocol version 2.0; client software version phpseclib_0.3 (bcmath)
debug1: no match: phpseclib_0.3 (bcmath)
debug1: Enabling compatibility mode for protocol 2.0

not sure if it's related...
you may request any debug info from me, if you need anything!

@bantu
Copy link

bantu commented Jul 1, 2014

@PVince81 yes

@MarvinFS
Copy link
Author

MarvinFS commented Jul 2, 2014

if i mount the same sftp server as a local resource by sshfs user@servername.ru/ocloud/ /mnt/sftp -o allow_other,reconnect,idmap=user,uid=33,gid=33,big_writes and then add the mount as an external storage in OC, everything working lighting fast and as expected, including encryption and public sharing encrypted files.

The only issue here, that i cannon add it as a user level external storage, only able to add on a server level, thus all users can see and have full control on everything on this resource, including foreign files, and the $user template is NOT working (like a a /mnt/sftp/$user) in a configuration field, when u add this local storage on a server level.

@PVince81
Copy link
Contributor

PVince81 commented Jul 2, 2014

Okay that's strange.
So to summarize your problem:

  1. Mounting system level SFTP works correctly
  2. Mounting SFTP as personal mount does not work
  3. Mounting system level SFTP with "/mnt/sftp/$user" does not work

The connection parameters shouldn't be that different for the personal mount.
Unless something went wrong with storing the password.

Needs further research.

@MarvinFS
Copy link
Author

MarvinFS commented Jul 2, 2014

  1. not true - also not working! neither on server level, nor on user level.
    it only works if i use sshfs to mount sftp server as a local resource on server first and then add this resource as a local storage in OC (any level) (i can see the files there but cannot upload\download)
  2. mounting works and i can see the files there but cannot upload\download
  3. Mounting anylevel any external storage provider (including SFTP) with /mnt/sftp/$user is not working at all

@deklar
Copy link

deklar commented Jul 8, 2014

Same issue with FTP and FTPS for 7.0.0RC1. Almost looks like the connector is looping/failing. Several thousand FTP connections (login/logoff/repeat) each minute.

@PVince81
Copy link
Contributor

PVince81 commented Jul 8, 2014

@bantu can you please help investigate this ?
Thanks.

@MarvinFS
Copy link
Author

MarvinFS commented Jul 8, 2014

confirm - nothing changed for sftp or webdav upload issuer with 7.0rc1 - still not working!

@deklar
Copy link

deklar commented Jul 8, 2014

Webdav is broken for you as well? I admit I have not yet tested that one since going to the stable7 branch, however SMB worked fine for me. FTP and FTPS are the important ones, SMB doesn't help me out here at all. I recall seeing that webdav was incredibly slow elsewhere but I'm not sure if it's related or not (webdav is incredibly slow all the time, anyways).

@MarvinFS
Copy link
Author

MarvinFS commented Jul 8, 2014

Actually it's not just slow - it's unusable slow! stated about the issue here #9351
Just tried from the very scratch on 7.0rc1, new db, new users, no encryption, everything fresh - still all the issues with external storages are there!

@deklar
Copy link

deklar commented Jul 8, 2014

I feel your pain. I've spent 72 hours in the last week -- installing OC of multiple versions (along with various versions of PHP, BSD 9/9.1R/9.2R/10R, three versions of MySQL, etc etc). I've gone so far as to rule out ZFS being the issue and switched back to UFS. Oddly enough I was doing all of this to fix other bugs (or at the very least rule out my setup as the culprit). I did not have external maps failing until 7.x.

If I recall, webdav did work for me in the past (on 6.something) but it was pretty slow. At that time, everything else was tested and worked (remote maps anyways).

I'm now in the process of disabling everything that does not work, so that I can concentrate on getting the main functionality of OC working first. There are simply too many broken items to deal with (albeit, not all are within core, but many are).

@deklar
Copy link

deklar commented Jul 8, 2014

@MarvinFS I do find it interesting how you and I are both running, for the most part, the same software versions. I'd be interested to know if others with earlier packages have these issues. On my 6.x box that was working pretty well, I had some pretty old software packages and dependencies installed.

@MarvinFS
Copy link
Author

MarvinFS commented Jul 8, 2014

@deklar well i'm not sure if we can compare BSD and linux in terms of dependencies - the kernel is still different, as for me, i've tried to figure out those issue with external storages in OC very hard - it's critical for me - without fast secure cloud ext. storage OC is useless in my case, and, since i can't use webdav (dead slow) and sftp (not working directly from OC) i was searching for solution, tried both old ubuntu12 and newer ubuntu14 LTS servers, tried to change apache and php versions... still no luck.
The only usable solutions i've found is to use yandex.cloud with their proprietary cli linux client syncing my data dir (actually it's built on common webdav protocol - i have no idea, why OCs implementation is so freaking slow) and the second option is to use sshfs to mount the resource directly and to use it in OC - those two are working pretty fast on my 100Mb line! but the only issue here that all OC's users have 777 permissions on external storages and are able to access other users's files without previously sharing them...
Also i can't add ext. local type storages on user level - it's possible only on server level! (as it stated in docs - it's a potential security vulnerability - can't really say why)
I've found no support on forums so opened issues here!

@deklar
Copy link

deklar commented Jul 8, 2014

Well, beta is beta, I guess. I wouldn't expect Alpha/Beta software to work flawlessly. That said, I upgraded to 7 (then re-installed 7 on 6 different platforms with different configurations each time) to get away from the bugs in 6-Stable. The good news is, some of the bugs are gone. The bad news is, you and I both lost the ability to mount externally.

In regards to the dependencies, I'm convinced there is something - a library, the version of PHP with the compiled options, some version of pecl, maybe even Apache -- something, that is causing at-least some of the issues. I had a snapshot of my working 6.x box, so I pooled up the /usr/local and overwrote one of my .... now six (yea, six) OC installations. It replaced all versions of PHP, Apache, dependencies, libs, etc. My pkg(1) was/is a mess - the box is hosed - but, it actually worked -- on 6. It fixed most of the issues. Of course the box is destroyed now so time to re-do it again ... at any rate, I then updated the packages (all but OC, configs, etc) and kept everything as much as I could original to the working snapshot. Doing this, broke nearly everything again.

The issue here is, OC needs around 200 packages in total to run with most of the options. Ok, ok, it may only have a "few dependencies" but those dependencies more often than not require 2, 3, 4, 10, 16 or more packages installed just to get the ones required to work. Finding out where the issue is (assuming I'm even right on this) would mean going over every single installed package, upgrading one at a time (which is not possible in many cases) and then re-testing every function after each upgrade - it would take weeks.

On a fresh 10R machine using the latest stable packages, OC6 has plenty of issues. Using outdated (and in some cases, exploitable) packages, OC6 runs fine. I'm betting here that OC7 would work better (perhaps not with external maps however, although it could be related) with fewer bugs if I ran it on older packages. We need better debugs...

@bantu
Copy link

bantu commented Jul 8, 2014

@bantu can you please help investigate this ?

@PVince81 Not anytime soon; possibly on friday.

@bantu
Copy link

bantu commented Jul 8, 2014

@MarvinFS phpseclib's "sftp" stream wrapper is not there, but it is also not expected to be there because it is not a built-in stream wrapper. The stream wrappers you are seeing are probably those of libssh2 or so, which owncloud does not use.

"phpseclib_0.3 (bcmath)" indicates that you "only" have the bcmath extension which will speedup phpseclib slightly, but not massively. Please try to install the GMP extension to further speed up BigInteger operations and the mcrypt extensions to speedup some other cryptographic operations.

@bantu
Copy link

bantu commented Jul 8, 2014

@MarvinFS Please amend your report with documentation about how ownCloud was installed. Tarball? Git?

The debian packages you will want to install are probably called php5-gmp and php5-mcrypt.

@deklar
Copy link

deklar commented Jul 8, 2014

@bantu I know this isn't my PR, but MarvinFS and I have the same issue. I have GMP 5.1.3 and mcrypt 2.5.8 compiled in (I just added GMP now).

Here are my test results with FTP: I'm able to map the drive fine (as I was able to before). Creating a single directory, and then creating a single text file, modifying it and saving it, returning to root path then re-entering the remote path connected to the FTP server 291 times. A little excessive, I'd say. I had to configure the FTP service to allow more than 60 connections per minute by any given IP address (which is bad to do for security reasons) just to make this happen. Uploading a single XLS file connected 45 times (in 3 seconds) Something is really wrong here -- if this is by design, the design is flawed.I was able to upload three files, pretty quickly however - so this is an improvement (137 connections in 8 seconds). Syncing the OC Windows client (I know it's not directly related, but probably still part of Core) connected a minimum number of times, for what it's worth.

Summary: It's "better" just not great - unless you have an unlimited FTP (connections per second, etc) setup FTP will timeout/have issues. I was also able to delete the mount without any problem here.

SFTP works the same method as above - however is failing and is much slower most likely due to the overhead of the SFTP process itself (as it will require much more memory/resources, and will be slower to initiate than FTP). Uploading a 200KB file failed here as well (I suspect because there was an issue creating the 50 or so connections to do this transaction - that should use just one). With SFTP, I do have the OC log:

{"app":"PHP","message":"fopen(): Unable to find the wrapper "sftp" - did you forget to enable it when you configured PHP? at /data/owncloud/apps/files_external/lib/sftp.php#220","level":3,"time":"2014-07-08T15:28:59-05:00"}

I was able to create a text file, it just took some time to do (again, probably due to the large number of connections taking place).

Webdav -
I was able to connect to a standard Apache Webdav. 120 PROPFINDs to list 0 files on the access log file. I was unable to create a simple text file, and I was unable to upload a single 200KB file - these both timeout. At present, tailing the Apache access log, it looks pretty much like a webserver I run where we have a few hundred domains hosted and high traffic day and night -- but the only hit on this webserver is OC. No errors in OC log for Webdav - but it just did not work, at all. This was tested with a HTTP (not secure) setup as well in case that helps.

@bantu
Copy link

bantu commented Jul 8, 2014

Please make this ticket about SFTP only. The missing sftp wrapper error
sounds like a problem in ownCloud.

@deklar
Copy link

deklar commented Jul 8, 2014

@bantu You bet. It's an important one too. Anyone with RC1 should be able to simulate this issue. My question at this point is, has anyone been able to get SFTP to work (and quickly for that matter) using 7RC1? Despite the wrapper error, the pure number of connections (I know we are only talking SFTP but you can't deny how this seems to be the case with Webdav and FTP as well) is bloated to an almost fictional number that would never work in the real world.

Tell me what I can do to help you out and I'll do whatever I can. Thanks.

@PVince81
Copy link
Contributor

PVince81 commented Jul 8, 2014

@deklar some of the storage backends are missing a stat cache, see: #7910

@MarvinFS
Copy link
Author

MarvinFS commented Jul 9, 2014

@bantu Forgive me being lame and i totally understand this is not the place for user support. am i missing something? What do you mean "phpseclib_0.3 (bcmath) indicates that you "only" have the bcmath extension" - only means i need some other lib?

root@ubuntu14:/var/www/owncloud/data# dpkg -l | grep php5
libapache2-mod-php5              5.5.9+dfsg-1ubuntu4.2 
php5-cli                         5.5.9+dfsg-1ubuntu4.2 
php5-common                      5.5.9+dfsg-1ubuntu4.2 
php5-curl                        5.5.9+dfsg-1ubuntu4.2 
php5-gd                          5.5.9+dfsg-1ubuntu4.2 
php5-gmp                         5.5.9+dfsg-1ubuntu4.2 
php5-json                        1.3.2-2build1         
php5-ldap                        5.5.9+dfsg-1ubuntu4.2 
php5-mcrypt                      5.4.6-0ubuntu5        
php5-mysql                       5.5.9+dfsg-1ubuntu4.2 
php5-readline                    5.5.9+dfsg-1ubuntu4.2 

 dpkg -l | grep ssh
libssh2-1:amd64                  1.4.3-2          
openssh-client                   1:6.6p1-2ubuntu2 
openssh-server                   1:6.6p1-2ubuntu2 
openssh-sftp-server              1:6.6p1-2ubuntu2 
ssh-import-id                    3.21-0ubuntu1    
sshfs                            2.5-1ubuntu1     

the php5-gmp and php5-mcrypt were not installed, after installation and server reboot (just in case) nothing changed - SFTP uploads fails with "the target folder has been moved or deleted" message.
existing files are showed just fine and i'm able to create folders also just fine!

sshd[20185]: debug1: Client protocol version 2.0; client software version phpseclib_0.3 (gmp)
sshd[20185]: debug1: no match: phpseclib_0.3 (gmp)
sshd[20185]: debug1: Enabling compatibility mode for protocol 2.0
sshd[20185]: debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u1
{"reqId":"53bcbb704d3ed","app":"PHP","message":"fopen(sftp:\/\/...@server.ru/\ocloud\/test3\/\u0448\u0430\u0431\u043b\u043e\u043d \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u044f.docx): failed to open stream: No such file or directory at \/var\/www\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":3,"time":"2014-07-09T09:48:00+06:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53bcbb7e6bb28","app":"PHP","message":"fopen(): Unable to find the wrapper "sftp" - did you forget to enable it when you configured PHP? at \/var\/www\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":3,"time":"2014-07-09T09:48:14+06:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53bcbb7e6bb28","app":"PHP","message":"fopen(sftp:\/\/...@server.ru\/ocloud\/test3\/gover_server.ovf): failed to open stream: No such file or directory at \/var\/www\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":3,"time":"2014-07-09T09:48:14+06:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}

@deklar
Copy link

deklar commented Jul 9, 2014

I think those errors may be due to an overloaded SFTP server - I've seen them before, but not always - they pop up when OC is doing some dramatic (see #7910) things it shouldn't be doing. Essentially the SFTP server can't keep up with the connections. It may or may not be related to 7910 but I just did testing on the FTP end, and everything I have tested thus far, tells me that the SFTP side does about the same thing.

@MarvinFS
Copy link
Author

MarvinFS commented Jul 9, 2014

@deklar there are no load on a SFTP server at all here - it's a test server. Also, as i've turned on SFTP debugging - i see only a few connections when it's trying to upload files basically about 3 or 4 connections only! Also i may say when i've tried FTP servers (vsftpd) as an external storage with OC7 - it was working OK! no issues, but the FTP is not a solution for me, due to a lot of issues with firewalls.

@PVince81
Copy link
Contributor

PVince81 commented Jul 9, 2014

I can confirm this on stable7 (9ccadcf)

Also getting this error on upload:

{"reqId":"53bd4f5e59062","app":"PHP","message":"fopen(): Unable to find the wrapper "sftp" - did you forget to enable it when you configured PHP? at \/srv\/www\/htdocs\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":0,"time":"2014-07-09T14:19:10+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"53bd4f5e59062","app":"PHP","message":"fopen(sftp:\/\/...@test\/home\/vincent\/temp\/sftpmount\/Huoguo.jpg): failed to open stream: No such file or directory at \/srv\/www\/htdocs\/owncloud\/apps\/files_external\/lib\/sftp.php#220","level":0,"time":"2014-07-09T14:19:10+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php"}

The only change since OC 6 is that now phpseclib is bundled in core's 3rdparty instead of files_external's 3rdparty. Maybe the version has been increased as well.
Could be a class init error of some sorts.

Will try installing the extra modules.
But I remember that I didn't need them before.

@PVince81
Copy link
Contributor

PVince81 commented Jul 9, 2014

Same problem after installing php5-gmp and php5-mcrypt.

I think the basic file operations work, I was able to delete files.
So the issue is mostly with the fopen() stream wrapper, not the protocol extensions.

@PVince81
Copy link
Contributor

PVince81 commented Jul 9, 2014

Okay, I set a breakpoint in 3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP/Stream.php on the line:

if (function_exists('stream_wrapper_register')) {
    stream_wrapper_register('sftp', 'Net_SFTP_Stream');
}

When uploading a file it doesn't go there, which means there is a class loading issue.

Maybe that file needs to be explicitly included when using the SFTP storage classes ?

@PVince81
Copy link
Contributor

PVince81 commented Jul 9, 2014

@bantu
Copy link

bantu commented Jul 9, 2014

Yes. The sftp wrapper file of phpseclib 0.3.6 needs to be included
manually. This has been documented in the owncloud ticket about sftp rsa
keys as well as a phpseclib ticket. The phpseclib ticket has been addressed
in 0.3.7. Please update phpseclib and call ::register appropriatly (e.g. in
the constructor of sftp ext storage).
On 9 Jul 2014 16:40, "Vincent Petry" notifications@github.com wrote:

Possibly related:
https://github.com/owncloud/core/pull/9198/files#r14651400


Reply to this email directly or view it on GitHub
#9320 (comment).

@MarvinFS
Copy link
Author

tried to update phpseclib
sudo apt-get install php5-pgsql php-pear
sudo pear channel-discover phpseclib.sourceforge.net
sudo pear remote-list -c phpseclib
sudo pear install phpseclib/Net_SSH2
sudo pear install phpseclib/Net_SFTP
sudo service apache2 restart

install ok: channel://phpseclib.sourceforge.net/Net_SFTP-0.3.7

issue still there! unable to upload!

@DeepDiver1975
Copy link
Member

@bantu pull request to update phpseclib? Thx

@bantu
Copy link

bantu commented Jul 11, 2014

All right, I've got access to a sane internet connection again.

@MarvinFS ownCloud does not use phpseclib via PEAR. The instructions I posted were not for you, but for @PVince81

@bantu pull request to update phpseclib? Thx

owncloud-archive/3rdparty#103

@bantu
Copy link

bantu commented Jul 12, 2014

I have properly analysed this issue now, the conclusion is as follows:

@bantu
Copy link

bantu commented Jul 12, 2014

@MarvinFS @deklar Please checkout the SFTP fix at #9605. Sorry for the inconvenience.
@deklar Please create a new issue for your FTP/FTPS problem.

@MarvinFS
Copy link
Author

@bantu

Dear Andreas, don't be sorry!
You guys are going a great job for the community, i'm just happy that i was able to point one small issue! BTW can you kindly point me on how to test the fixes?
all the time i just took the latest build by the link on site here
http://download.owncloud.org/community/testing/owncloud-7.0.0RC1.tar.bz2
i've tried
https://download.owncloud.org/community/daily/owncloud-daily-master.tar.bz2
but the issue is still there

@lock
Copy link

lock bot commented Aug 2, 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 Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants