Skip to content

Encryption Error while deleting folder Error: fread(): Read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#860 #21578

Description

@AndyXheli

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create a folder then delete it

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Error PHP fread(): read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#861

Server configuration

Operating system:
Ubunti 18.0.4
Web server:
Apache2
Database:
MySQL
PHP version:
7.4.7
Nextcloud version: (see Nextcloud admin page)
19.0
Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list Enabled: - accessibility: 1.5.0 - activity: 2.12.0 - admin_audit: 1.9.0 - bruteforcesettings: 1.6.0 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contactsinteraction: 1.0.0 - dav: 1.15.0 - encryption: 2.7.0 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_external: 1.10.0 - files_pdfviewer: 1.8.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - firstrunwizard: 2.8.0 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - nextcloud_announcements: 1.8.0 - notifications: 2.7.0 - oauth2: 1.7.0 - password_policy: 1.9.1 - photos: 1.1.0 - privacy: 1.3.0 - provisioning_api: 1.9.0 - recommendations: 0.7.0 - richdocuments: 3.7.2 - serverinfo: 1.9.0 - settings: 1.1.0 - sharebymail: 1.9.0 - socialsharing_email: 2.0.0 - support: 1.2.1 - survey_client: 1.7.0 - systemtags: 1.9.0 - text: 3.0.1 - theming: 1.10.0 - twofactor_backupcodes: 1.8.0 - updatenotification: 1.9.0 - viewer: 1.3.0 - workflowengine: 2.1.0
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
![image](https://user-images.githubusercontent.com/59488153/85640490-89e03580-b651-11ea-9235-0b672653aa26.png)

Activity

  1. AndyXheli commented on Jun 25, 2020

    @AndyXheli
    ContributorAuthor

    Looks like it may have something to do with PHP 7.4.7 I went back to PHP 7.3.19 and did not get that error.

  2. changed the title [-]NC 17 Error PHP fread(): read of 8192 bytes failed with errno=21[/-] [+]NC 19 Error PHP 7.4 fread(): read of 8192 bytes failed with errno=21[/+] on Jun 25, 2020
  3. closingin commented on Jul 2, 2020

    @closingin

    I can confirm this bug. I have the same error using the docker image with PHP 7.4.7.

  4. AndyXheli commented on Aug 3, 2020

    @AndyXheli
    ContributorAuthor

    Hello any updates on this.

    Still have this issue

    Fatal webdav TypeError: Argument 2 passed to OC\Files\Storage\Wrapper\Encryption::modifyMetaData() must be of the type array, null given, called in /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php on line 208   16 minutes ago
    Error PHP Trying to access array offset on value of type null at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#208   16 minutes ago
    Fatal webdav TypeError: Argument 2 passed to OC\Files\Storage\Wrapper\Encryption::modifyMetaData() must be of the type array, null given, called in /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php on line 208   17 minutes ago
    Error PHP Trying to access array offset on value of type null at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#208   17 minutes ago
    Error PHP fread(): read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#861
  5. AndyXheli commented on Aug 10, 2020

    @AndyXheli
    ContributorAuthor

    Still having this issue on Nextcloud 19.0.1 PHP: Version: 7.4.8

  6. AndyXheli commented on Aug 27, 2020

    @AndyXheli
    ContributorAuthor

    @MorrisJobke Is this something thats being worked on?

    fread(): read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#862

  7. AndyXheli commented on Sep 8, 2020

    @AndyXheli
    ContributorAuthor

    @MorrisJobke any updates on this issue?

  8. MorrisJobke commented on Sep 9, 2020

    @MorrisJobke
    Member

    @MorrisJobke any updates on this issue?

    Not really. I linked just the wrong ticket 🙈

  9. AndyXheli commented on Sep 9, 2020

    @AndyXheli
    ContributorAuthor

    @MorrisJobke Okay thank you for the update. Anyway we can have someone look into this please!

  10. AndyXheli commented on Sep 14, 2020

    @AndyXheli
    ContributorAuthor

    Same issue on NC 19.0.3

  11. toxpal commented on Sep 24, 2020

    @toxpal

    Have exactly the same problem after updating to 19.0.3. All previous versions worked just fine.

  12. RedKage commented on Oct 12, 2020

    @RedKage

    @axheli I do have these errors in the log as well.

    And also in the client
    image

    But it doesn't seem to affect Nextcloud beyond these errors.
    Everythings gets deleted fine, and uploaded fine.
    Or did I miss something?

  13. changed the title [-]NC 19 Error PHP 7.4 fread(): read of 8192 bytes failed with errno=21[/-] [+]NC 20 Error PHP 7.4 fread(): read of 8192 bytes failed with errno=21[/+] on Nov 8, 2020
  14. 43 remaining items

  15. jknockaert commented on Jul 2, 2021

    @jknockaert
    Contributor

    @AndyXheli I am no longer using the encryption app (I disabled it) and I do no longer support any code I wrote including #24966. Maybe someone else can help you.

  16. AndyXheli commented on Jul 2, 2021

    @AndyXheli
    ContributorAuthor

    @jknockaert Thank you for your effort. Since this is not fixed can you please reopen this ticket ?

  17. jknockaert commented on Jul 2, 2021

    @jknockaert
    Contributor

    @AndyXheli You can reopen it or create a new one. For me the issue is gone.

  18. AndyXheli commented on Jul 2, 2021

    @AndyXheli
    ContributorAuthor

    @jknockaert Thank you very much.

  19. changed the title [-]Encryption Error while deleting folder[/-] [+]Encryption Error while deleting folder Error: fread(): Read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#860[/+] on Jul 2, 2021
  20. RedKage commented on Jul 2, 2021

    @RedKage

    I have just updated to 21.0.3
    And the file Encryption.php hasn't changed since @jknockaert fix.
    There's just some additional comments, that's all.
    So the fix should still work.
    I'm applying it, and we will see

  21. AndyXheli commented on Jul 2, 2021

    @AndyXheli
    ContributorAuthor

    @RedKage I did apply the fix and it still dose work. Someone just need to backport it

  22. RedKage commented on Sep 30, 2021

    @RedKage

    Seems like this patch is live on version 21.0.5
    Which is kinda weird as I don't remember seeing this in the changelog https://nextcloud.com/changelog#21-0-5

  23. dzaziz commented on Dec 22, 2022

    @dzaziz

    I have similar issue, not sure what cause the error in the logfile.

    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:16+0800
    Error PHP Error: hash_file(): Read of 8192 bytes failed with errno=21 Is a directory at /snap/nextcloud/32871/htdocs/lib/private/Files/Storage/Local.php#390   2022-12-22T08:33:15+0800
  24. afzl-wtu commented on Nov 6, 2023

    @afzl-wtu

    LOL Issue is still present in 27.1.3

  25. olivka86 commented on Dec 13, 2023

    @olivka86

    27.1.4 has this issue too
    {"reqId":"H14hMo8rHwStihWXsXXm","level":3,"time":"2023-12-13T12:33:06+00:00","remoteAddr":"192.168.1.191","user":"owner","app":"PHP","method":"MOVE","url":"/remote.php/dav/uploads/owner/ee1871439985347b926ae0b34eb9f924/.file","message":"fread(): Read of 8192 bytes failed with errno=5 Input/output error at /var/www/html/3rdparty/icewind/streams/src/Wrapper.php#55","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.26.0","version":"27.1.4.1","data":{"app":"PHP"}}

  26. metorm commented on Apr 25, 2024

    @metorm

    Hello, this is v28.0.4 and the error is still there

    [PHP] 错误: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#331
    from ? by -- at 2024年4月25日 10:53:22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions