nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.65k stars 3.99k forks source link

No access to external storage [SFTP] #21429

Open Bables55 opened 4 years ago

Bables55 commented 4 years ago

Steps to reproduce

  1. Connecting External Storage with SFTP
  2. Accessing external storage from NC19 and displaying the list
  3. Click on the file to view or attempt to download

Expected behaviour

The contents of the file are displayed or the file has been downloaded successfully.

Actual behaviour

I can't view or download the content with an error.

Server configuration

Operating system: CentOS 7.7 Web server: nginx 1.16.1 Database: MariaDB 10.2.32 PHP version: 7.3.18 Nextcloud version: (see Nextcloud admin page) 19 Updated from an older Nextcloud/ownCloud or fresh install: from NC18.0.4 Where did you install Nextcloud from: Official Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` - accessibility: 1.5.0 - activity: 2.12.0 - admin_audit: 1.9.0 - apporder: 0.10.0 - calendar: 2.0.3 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contacts: 3.3.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - deck: 1.0.2 - documentserver_community: 0.1.6 - encryption: 2.7.0 - end_to_end_encryption: 1.5.1 - event_update_notification: 1.0.2 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_external: 1.10.0 - files_markdown: 2.3.0 - files_mindmap: 0.0.22 - files_pdfviewer: 1.8.0 - files_retention: 1.8.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trackdownloads: 1.8.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - forms: 1.1.1 - groupfolders: 6.0.6 - impersonate: 1.6.0 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - metadata: 0.11.1 - notes: 3.5.1 - notifications: 2.7.0 - oauth2: 1.7.0 - onlyoffice: 4.2.0 - password_policy: 1.9.1 - passwords: 2020.6.0 - polls: 1.4.3 - privacy: 1.3.0 - provisioning_api: 1.9.0 - quicknotes: 0.4.0 - quota_warning: 1.8.0 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - sharepoint: 1.7.0 - spreed: 9.0.1 - survey_client: 1.7.0 - systemtags: 1.9.0 - talk_simple_poll: 1.1.1 - tasks: 0.13.1 - text: 3.0.1 - theming: 1.10.0 - theming_customcss: 1.6.0 - twofactor_backupcodes: 1.8.0 - twofactor_totp: 4.1.3 - updatenotification: 1.9.0 - user_external: 0.10.0 - user_usage_report: 1.3.0 - viewer: 1.3.0 - workflow_pdf_converter: 1.4.0 - workflowengine: 2.1.0 ```

Nextcloud configuration:

Config report ``` "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/cloud.courio-city.net", "dbtype": "mysql", "version": "19.0.0.12", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "log_type": "file", "logtimezone": "Asia\/Tokyo", "loglevel": 0, "default_language": "ja", "default_locale": "ja_JP", "memcache.local": "\\OC\\Memcache\\APCu", "filelocking.enabled": true, "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "timeout": 0, "password": "***REMOVED SENSITIVE VALUE***" }, "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN", "mail_smtpsecure": "ssl", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "465", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "auth.bruteforce.protection.enabled": false, "versions_retention_obligation": "7,auto", "trashbin_retention_obligation": "auto", "defaultapp": "calendar", "theme": "", "updater.release.channel": "stable", "twofactor_enforced": "false", "twofactor_enforced_groups": [ "admin" ], "twofactor_enforced_excluded_groups": [], "has_rebuilt_cache": true, "app_install_overwrite": [ "groupfolders" ], "activity_expire_days": 90, "ldapIgnoreNamingRules": false, "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory", "simpleSignUpLink.shown": false, "migrate_guest_user_data": true, "sort_groups_by_name": true, "enabledPreviewProviders": [ "OC\\Preview\\PDF", "OC\\Preview\\JPEG", "OC\\Preview\\PNG", "OC\\Preview\\GIF", "OC\\Preview\\HEIC", "OC\\Preview\\BMP", "OC\\Preview\\TXT", "OC\\Preview\\MarkDown" ] } } ```

Are you using external storage, if yes which one: local/smb/sftp/... sftp Are you using encryption: yes/no yes *main storageonly. not server-side Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser:

Operating system:

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` [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 ```
Bables55 commented 4 years ago

This is giving me an error, but I'm actually able to view the photo in my browser.

[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=242084&c=5db8e595252af&x=250&y=250&forceIcon=0
from IP by USER at 2020-06-19T16:49:13+09:00

[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=242084&c=5db8e595252af&x=250&y=250&forceIcon=0
from IP by USER at 2020-06-19T16:49:13+09:00

[PHP] Error: fopen(sftpread://EXTERNAL-STORAGE//Logo PNG/FILENAME.png): 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=242084&c=5db8e595252af&x=250&y=250&forceIcon=0
from IP by USER at 2020-06-19T16:49:13+09:00
PnjDbq commented 4 years ago

Ran into a similar (the same?) issue testing v19 for the snap.

This might be the same as https://github.com/nextcloud/server/issues/20979?

pholthaus commented 4 years ago

I applied the patch from #20979 manually but without any luck so far. Would I need to restart apache as that's out of my hands?

pholthaus commented 4 years ago

I have just now updated to 19.0.1RC1 but still cannot access any external files. My log if I click on some file:

{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"fopen(sftpread://storage/robothouse/pholthaus//sensors.csv): failed to open stream: "OCA\\Files_External\\Lib\\Storage\\SFTPReadStream::stream_open" call failed at /home/sites/roboth/public_html/cloud/apps/files_external/lib/Lib/Storage/SFTP.php#378","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"fread() expects parameter 1 to be resource, bool given at /home/sites/roboth/public_html/cloud/lib/private/Files/Storage/Wrapper/Encryption.php#861","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"fclose() expects parameter 1 to be resource, bool given at /home/sites/roboth/public_html/cloud/lib/private/Files/Storage/Wrapper/Encryption.php#862","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"fread(): Length parameter must be greater than 0 at /home/sites/roboth/public_html/cloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php#91","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"Expected SSH_FXP_STATUS at /home/sites/roboth/public_html/cloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php#2123","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
{"reqId":"Xwi@g0f72tQFV5IUUZQgYAAAAA4","level":3,"time":"2020-07-10T19:16:20+00:00","remoteAddr":"86.173.64.87","user":"pholthaus","app":"PHP","method":"GET","url":"/cloud/index.php/apps/text/session/create?fileId=318373&filePath=%2Fsensors.csv&guestName=null&forceRecreate=false","message":"chmod(): Operation not permitted at /home/sites/roboth/public_html/cloud/lib/private/Log/File.php#86","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.68 Safari/537.36","version":"19.0.1.0"}
Bables55 commented 4 years ago

Will this issue be fixed when the stable version of 19.0.1 is released? How few people are faced with this problem?

I've been looking at the error log and am curious about the "double slash" and "encryption".

pholthaus commented 4 years ago

Just updated to 19.0.1 and the issue still persists.

isaac82419 commented 4 years ago

I have upgraded to 19.0.1 and still see this issue as well.

PnjDbq commented 4 years ago

Ran into a similar (the same?) issue testing v19 for the snap.

This might be the same as #20979?

Must be different issues. My external storage issue is resolved with 19.0.1.

isaac82419 commented 4 years ago

upgrading to 19.0.1, does not solve my issue. However if after I upgrade to 19.0.1, I manually apply the workaround mentioned here: https://github.com/nextcloud/server/issues/20979#issuecomment-629213272 my issue is resolved.

pholthaus commented 4 years ago

That helps in my setup, too!

jospoortvliet commented 4 years ago

@icewind1991 so your work-around fixes the problem, but the final patch you made (that was merged in 19.0.1) doesn't?!? That's odd.

pholthaus commented 3 years ago

Just to update, I still need to apply https://github.com/nextcloud/server/issues/20979#issuecomment-629213272 in 19.0.3 for external storage to work.

pholthaus commented 3 years ago

Still persists in 19.0.4

Bables55 commented 3 years ago

I've updated to NC 19.0.4. The error situation has not changed at all.

`Error: fopen(sftpread://EXTERNAL-SERVER/USERNAME//DIRECTORY1/FILENAME.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 <> OC\Log\ErrorHandler::onError()

/MY-NEXTCLOUD/apps/files_external/lib/Lib/Storage/SFTP.php - line 378: fopen()

/MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Wrapper.php - line 300: OCA\Files_External\Lib\Storage\SFTP->fopen()

/MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Availability.php - line 315: OC\Files\Storage\Wrapper\Wrapper->fopen()

/MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Encryption.php - line 480: OC\Files\Storage\Wrapper\Availability->fopen()

/MY-NEXTCLOUD/lib/private/Files/Storage/Wrapper/Wrapper.php - line 300: OC\Files\Storage\Wrapper\Encryption->fopen()

/MY-NEXTCLOUD/apps/ransomware_protection/lib/StorageWrapper.php - line 317: OC\Files\Storage\Wrapper\Wrapper->fopen()

/MY-NEXTCLOUD/lib/private/Files/View.php - line 1159: OCA\RansomwareProtection\StorageWrapper->fopen()

/MY-NEXTCLOUD/lib/private/Files/View.php - line 995: OC\Files\View->basicOperation()

/MY-NEXTCLOUD/apps/dav/lib/Connector/Sabre/File.php - line 433: OC\Files\View->fopen()

/MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 90: OCA\DAV\Connector\Sabre\File->get()

/MY-NEXTCLOUD/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89: Sabre\DAV\CorePlugin->httpGet()

/MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php - line 474: Sabre\DAV\Server->emit()

/MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php - line 251: Sabre\DAV\Server->invokeMethod()

/MY-NEXTCLOUD/3rdparty/sabre/dav/lib/DAV/Server.php - line 319: Sabre\DAV\Server->start()

/MY-NEXTCLOUD/apps/dav/appinfo/v1/webdav.php - line 82: Sabre\DAV\Server->exec()

/MY-NEXTCLOUD/remote.php - line 167: require_once("MY-NEX ... p")`


Is this the same for the NC20?

hmoisand commented 3 years ago

NC20 webdav folder in pcloud shows folders and even allow me to add more folders and files, but show no content in form of file. No content never in any of the files - they look like empty folders.

pholthaus commented 3 years ago

Issue still persists in NC 19.0.5

Bables55 commented 3 years ago

I updated to NC20. Then there is no longer a situation where I can't connect at all with SFTP connections. Sometimes the folder may not appear. If the file is at least visible, it is possible to open the desired data.

However, periodically some errors are output.

Error: Expected SSH_FXP_STATUS at /NEXTCLOUD/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php#2123
Error: Expected SSH_FXP_ATTRS or SSH_FXP_STATUS at /NEXTCLOUD/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php#1384
Error: Trying to access array offset on value of type bool at /NEXTCLOUD/apps/files_external/lib/Lib/Storage/SFTP.php#334
Can't get app storage, app files_external, user not logged in

NC20.0.2, PHP 7.4.13, CentOS 7.9, nginx 1.16.1

raceface2nd commented 3 years ago

I can confirm that opening files within SFTP external folders is not working with NC 20.0.2 and external storage support 1.11.1. When trying to download a file or open a PDF file in the viewer I get errors like the following.

Sorry for the raw error message copying formatted log messages is not working inside my NC installation since some 19 version.

{"reqId":"rwL5Z3X4kUKhxonBgpRz","level":3,"time":"2020-12-09T19:20:55+00:00","remoteAddr":"91.224.227.248","user":"username","app":"PHP","method":"GET","url":"/remote.php/dav/files/username/_t/20190901_cancellation-kopano.pdf","message":{"Exception":"Error","Message":"fopen(sftpread://home/username/test//20190901_cancellation-kopano.pdf): failed to open stream: &quot;OCA\\Files_External\\Lib\\Storage\\SFTPReadStream::stream_open&quot; call failed at /var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php#378","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/html/apps/files_external/lib/Lib/Storage/SFTP.php","line":378,"function":"fopen"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":300,"function":"fopen","class":"OCA\\Files_External\\Lib\\Storage\\SFTP","type":"->"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/PermissionsMask.php","line":118,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":300,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask","type":"->"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Availability.php","line":315,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php","line":480,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->"},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":300,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/html/lib/private/Files/View.php","line":1165,"function":"fopen","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/html/lib/private/Files/View.php","line":1001,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":434,"function":"fopen","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":90,"function":"get","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":474,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/html/remote.php","line":167,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0","version":"20.0.2.2","id":"5fd123a7b84b3"}

pholthaus commented 3 years ago

Issue still persists in NC 19.0.6

pholthaus commented 3 years ago

And also still in NC 20.0.4

pholthaus commented 3 years ago

Same in 20.0.5

cilex-ft commented 3 years ago

Same here on 20.0.5 with SFTP on localhost, with public RSA Key. Tried with different key sizes, same problem: I can upload and rename files, but can't download them. php 7.4 on updated ubuntu 18.04

Log displays:

    Error: Undefined offset: 256 at /var/www/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php#444
/var/www/nextcloud/3rdparty/phpseclib/phpseclib/phpseclib/Net/SFTP.php - line 444:
OC\Log\ErrorHandler::onError()
/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php - line 144:
phpseclib\Net\SFTP->login("*** sensiti ... *")
/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php - line 454:
OCA\Files_External\Lib\Storage\SFTP->getConnection()
/var/www/nextcloud/lib/private/Files/Storage/Common.php - line 187:
OCA\Files_External\Lib\Storage\SFTP->stat()
/var/www/nextcloud/lib/private/Files/Storage/Common.php - line 331:
OC\Files\Storage\Common->filemtime()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Common->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 385:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Availability->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 380:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/Cache/Watcher.php - line 128:
OC\Files\Storage\Wrapper\Wrapper->hasUpdated()
/var/www/nextcloud/lib/private/Files/View.php - line 1347:
OC\Files\Cache\Watcher->needsUpdate()
/var/www/nextcloud/lib/private/Files/View.php - line 1389:
OC\Files\View->getCacheEntry()
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/ObjectTree.php - line 156:
OC\Files\View->getFileInfo()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 81:
OCA\DAV\Connector\Sabre\ObjectTree->getNodeForPath()
/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
Sabre\DAV\CorePlugin->httpGet()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
Sabre\DAV\Server->emit()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
Sabre\DAV\Server->invokeMethod()
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
Sabre\DAV\Server->start()
/var/www/nextcloud/apps/dav/appinfo/v1/webdav.php - line 84:
Sabre\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 167:
require_once("/var/www/ne ... p")
cilex-ft commented 3 years ago

Additional info: Path to storage is defined as /home/nextcloud/paper without any trailing /, nevertheless the error message displays double slashes:

Error: fopen(sftpread://home/nextcloud/paper//output/document.pdf): failed to open stream: &quot;OCA\Files_External\Lib\Storage\SFTPReadStream::stream_open&quot; call failed at /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php\#378
eknoes commented 3 years ago

Same bug still on 21.0.3, applying https://github.com/nextcloud/server/issues/20979#issuecomment-629213272 fixes it for me.

szaimen commented 1 year ago

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

Millesimus commented 1 year ago

The issue is still present in 25.0.3 and it also affects WebDAV storage.

ghost commented 1 year ago

I'm also affected by this error, in 25.0.3 with SFTP, using https://github.com/nextcloud/all-in-one/

joshtrichards commented 1 year ago

It seems that the original reporters' (@Bables55) inability to download at all has partially been addressed, but there remain errors appearing in the logs. It also sounds like there remain some cases where SFTP isn't functioning right for some people.

Some of these errors are likely related to interactions with different SFTP server protocol versions, their various implementations and extensions, and the module we use for SFTP client mode.

For SFTP bug reports it's important to report here:

It's also critical we:

Now, unfortunately, I'm having a challenging reproducing the above issue. I'm testing against a Synology that uses OpenSSH and supports SFTPv3. And I see no issues like the above with NC26-current. Though that's not necessarily surprising given that my setup doesn't exactly match everyone else's here.

@Millesimus Your issues may or may not be related. Without stack traces the only similarities are some of the symptoms. What makes you suspect a connection to WebDAV? Can you trigger the symptoms you're seeing in your environment and then pull the stack trace(s) from your nextcloud.log (can also be accessed via Administration settings->Logging but make sure you use Copy raw and format the output as code here).

Millesimus commented 12 months ago

@joshtrichards I guess my part of the issue has been solved in with your comment in the other issue. @Bables55 also had encryption enabled, maybe that was related?

royalroot commented 8 months ago

Hi, I do receive these errors as well. But for me they only appear when scanning files. The access to the files seems to work without an issue.

Unfortunately there is no "real error stack", I guess the error is catched somewhere and formed into a "human readable" log entry.

For SFTP bug reports it's important to report here:

* the SFTP server implementation (and if not it's protocol version certainly the software version itself)

OpenSSH_9.3p2, OpenSSL 1.1.1t-freebsd 7 Feb 2023 (iocage on truenas)

* the full NC stack trace resulting from a sequence of steps that triggers a given error

"reqId":"BhehYpieLzrm7RJVESzf","level":3,"time":"2023-12-31T09:56:54+00:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"Can't get app storage, app files_external, user not logged in","userAgent":"--","version":"28.0.1.1","data":{"app":"core"},"id":"65913aeec7b81"}

* the sequence of steps that triggers the given error in a repeatable manner
  • Perform a full scan of files (via cronjob)
  • the above error pops up several times
  • access to all external files work without an issue
  • configuration of sftp/external storage shows green "hook" and everything seems fine

    • the exact NC version 28.0.1.1