Can't open files on external storage

I connect to NC as external storage to a different server with SFTP. I was faced with the problem of not being able to open those files.

I have access to it itself. The list of files also appears fine. However, when the user tries to open the file, the following error appears.

Error Loading FILENAME

The following error occurs when the user attempts to download.

Internal Server Error

The server was unable to complete your request.
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.

Nextcloud’s error log is below.

[PHP] Error: fopen(sftpread://MY-SECONDSERVER/ext-drive/sp//Under11/DSC01987.JPG): failed to open stream: "OCA\Files_External\Lib\Storage\SFTPReadStream::stream_open" call failed at /MY-NEXTCLOUD/apps/files_external/lib/Lib/Storage/SFTP.php#378
GET /index.php/core/preview?fileId=275176&x=1920&y=1080&a=true

[PHP] Error: fread() expects parameter 1 to be resource, bool given at /MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Encryption.php#861

GET /index.php/core/preview?fileId=275176&x=1920&y=1080&a=true

[PHP] Error: fclose() expects parameter 1 to be resource, bool given at /MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Encryption.php#862

GET /index.php/core/preview?fileId=275176&x=1920&y=1080&a=true

I unregistered the external storage once and then tried to reconnect. But the situation remained the same.

//MY-SECONDSERVER/ext-drive/sp//Under11/

I’m curious about “sp//Under11”. For some reason, there are two slashes.
I’m stopping at “sp” for the description in the external storage settings and not including the slash at the end of the word.

But not all of them, apparently. There are also external storage folders that user can access.

What are the causes of unconnected external storage?


CentOS 7.7, Nextcloud 19.0.0, PHP 7.3.18, nginx 1.16.1, MariaDB 10.2.32, External Storage Support 1.10.0

Today I deleted all the external storage settings and reconfigured them anew. But the result was the same. Not even the NC administrator has access to it.

did someone find solution for that issue ?
its few days that i’m trying to solve it and cant find any solution
re-install nextcloud few times and still facing the same issue

Unfortunately, I can’t find a solution. Is this a compatibility issue between the app and NC19?

do you have encryption enabled? at least for some folders?

I use End-to-End Encrypton app.
I have “Main Storage Encryption” enabled in the default encryption module.
Server-side encryption is disabled.

Of course, disabling them does not solve the problem this time.

i found something interesting

the OS is ubuntu 18.04 ( remote storage and local)

i found that when i ls the folder the remote folder its showing the files wrap with single quotes
like this : ‘test file.mp4’

but if i add file without space it showing normal.

so i create 2 files on remote server and try to make copy to local nextcloud server ( by nextcloud interface )
the one that with quotes didnt copied and the on without spaces and quotes is copied , and possible to play from remote

there is some info about this on the web : Coretutils 8.25+ adds single quotes
3

I gave up on the SFTP connection and tried a WebDAV connection, but was unable to connect with the following error.

Storage is temporarily unavailable.

[webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable: Sabre\HTTP\ClientException: Failed connect to EXTERNAL-ADDRESS:80; Connection refused at <<closure>>

0. /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Tree.php line 80
   OCA\DAV\Connector\Sabre\Directory->getChild("OUTERDIRECTORY")
1. /MY-NEXTCLOUD/apps/end_to_end_encryption/lib/Connector/Sabre/LockPlugin.php line 144
   Sabre\DAV\Tree->getNodeForPath("files/USER/OUTERDIRECTORY")
2. /MY-NEXTCLOUD/apps/end_to_end_encryption/lib/Connector/Sabre/LockPlugin.php line 114
   OCA\EndToEndEncryption\Connector\Sabre\LockPlugin->getNode("files/USER/OUTERDIRECTORY", "PROPFIND")
3. /MY-NEXTCLOUD/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
   OCA\EndToEndEncryption\Connector\Sabre\LockPlugin->checkLock(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
4. /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php line 458
   Sabre\DAV\Server->emit("beforeMethod:PROPFIND", [Sabre\HTTP\Requ ... }])
5. /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php line 251
   Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
6. /MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php line 319
   Sabre\DAV\Server->start()
7. /MY-NEXTCLOUD/apps/dav/lib/Server.php line 320
   Sabre\DAV\Server->exec()
8. /MY-NEXTCLOUD/apps/dav/appinfo/v2/remote.php line 35
   OCA\DAV\Server->exec()
9. /MY-NEXTCLOUD/remote.php line 167
   require_once("/var/www/vhosts ... p")

PROPFIND /remote.php/dav/files/USER/OUTERDIRECTORY
from IP by USER at 2020-06-19T09:25:42+09:00

I’m currently only able to use SFTP.

looks as if the other server doesn’t speak webdav. Maybe SFTP is implemented buggy on their side as well.

I WebDAV connection with client apps like CyberDuck and WinSCP. And WebDAV connection in Windows 10 itself. Either way is fine.

Problem is that you use the encryption wrapper here. So it somehow uses encryption (perhaps that’s the problem because it shouldn’t use it?).

How can I make it unencrypted?

I have just solved same problem configuring external sources using FTP except SFTP.

In my case, the connection speed is abnormally slow with FTP. And the probability to reach the target file is low.

Exactly the same behaviour happen to me after the update to NC19… The double slash is suspicious.

There is a bug on github which seems the same https://github.com/nextcloud/server/issues/21429

A post was split to a new topic: Thumbnails doesn’t always show up