# Typeerror: Argument 2 passed to Encryption::modifyMetaData()

**URL:** <https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475>\
**Category:** ℹ️ Support\
**Tags:** nc19, archlinux, encryption-server\
**Created:** [July 28, 2020, 9:53pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475 "2020-07-28T21:53:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stdcerr](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stdcerr/32/19611_2.png) [@stdcerr](https://help.nextcloud.com/u/stdcerr)\
**Post date:** [July 28, 2020, 9:53pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/1 "2020-07-28T21:53:00Z")

</div>

Nextcloud version _(eg, 18.0.2)_: 19.0.1-1  
Operating system and version _(eg, Ubuntu 20.04)_: arch Linux ARM  
Apache or nginx version _(eg, Apache 2.4.25)_: 2.4.43  
PHP version _(eg, 7.1)_:7.4.8

The issue you are facing: Nextcloud client gives an error that reads:  
“An error ocurred while opening a folder Operation canceled”

Is this the first time you’ve seen this error? _(Y/N)_:Y  
Steps to replicate it:

1. Open client app
2. Select Force sync now
3. Error appears after a while

The output of your Nextcloud log in **Admin \> Logging** :

```auto
TypeError: Argument 2 passed to OC\Files\Storage\Wrapper\Encryption::modifyMetaData() must be of the type array, null given, called in /usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php on line 208
/usr/share/webapps/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php - line 208:

OC\Files\Storage\Wrapper\Encryption->modifyMetaData()

<<closure>>

OC\Files\Storage\Wrapper\Encryption->getDirectoryContent()

/usr/share/webapps/nextcloud/lib/private/Files/Cache/Scanner.php - line 408:

iterator_to_array()

/usr/share/webapps/nextcloud/lib/private/Files/Cache/Scanner.php - line 388:

OC\Files\Cache\Scanner->handleChildren()

/usr/share/webapps/nextcloud/lib/private/Files/Cache/Scanner.php - line 340:

OC\Files\Cache\Scanner->scanChildren()

/usr/share/webapps/nextcloud/lib/private/Files/View.php - line 1339:

OC\Files\Cache\Scanner->scan()

/usr/share/webapps/nextcloud/lib/private/Files/View.php - line 1383:

OC\Files\View->getCacheEntry()

/usr/share/webapps/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 221:

OC\Files\View->getFileInfo()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php - line 80:

OCA\DAV\Connector\Sabre\Directory->getChild()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 976:

Sabre\DAV\Tree->getNodeForPath()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1678:

Sabre\DAV\Server->getPropertiesIteratorForPath()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1661:

Sabre\DAV\Server->writeMultiStatus()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 363:

Sabre\DAV\Server->generateMultiStatus()

/usr/share/webapps/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:

Sabre\DAV\CorePlugin->httpPropFind()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:

Sabre\DAV\Server->emit()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:

Sabre\DAV\Server->invokeMethod()

/usr/share/webapps/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:

Sabre\DAV\Server->start()

/usr/share/webapps/nextcloud/apps/dav/lib/Server.php - line 320:

Sabre\DAV\Server->exec()

/usr/share/webapps/nextcloud/apps/dav/appinfo/v2/remote.php - line 35:

OCA\DAV\Server->exec()

/usr/share/webapps/nextcloud/remote.php - line 167:

require_once("/usr/share/ ... p")

```

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):

```auto
<?php
$CONFIG = array (
  'instanceid' => 'ocy4w4gp6x34',
  'passwordsalt' => 'DoJ1ZFNR0uezFlkirehLSkazt1pZ1X',
  'secret' => 'YfRBvmPcOlnisWDCt63ffsLpFKbsMu4Qm9y6YtyV3Mz0DflA',
  'trusted_domains' => 
  array (
    0 => '*',
  ),
  'datadirectory' => '/usr/share/webapps/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.1.1',
  'overwrite.cli.url' => 'http://raspi/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'user',
  'dbpassword' => 'password',
  'installed' => true,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'mail_from_address' => 'test',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'server.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.server.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'test@email.com',
  'mail_smtppassword' => 'pwd',
)

```

The output of your Apache/nginx/system log in `/var/log/error_log_my_url_com`:

```auto
[Tue Jul 28 14:59:11.492230 2020] [php7:error] [pid 785] [client 192.168.1.1:42486] PHP Fatal error: Uncaught PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction in /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117\nStack trace:\n#0 /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute()\n#1 /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1054): Doctrine\\DBAL\\Driver\\PDOStatement->execute()\n#2 /usr/share/webapps/nextcloud/lib/private/DB/Connection.php(214): Doctrine\\DBAL\\Connection->executeUpdate()\n#3 /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(203): OC\\DB\\Connection->executeUpdate()\n#4 /usr/share/webapps/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(216): Doctrine\\DBAL\\Query\\QueryBuilder->execute()\n#5 /usr/share/webapps/nextcloud/lib/private/Lock/DBLockingProvider.php(316): OC\\DB\\QueryBuilder\\QueryBuilder->execute()\n#6 [internal fu in /usr/share/webapps/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php on line 34

```

---

<div class="post-metadata">

**Author:** ![AndyXheli](https://help.nextcloud.com/letter_avatar/andyxheli/32/6_449c533f586939b6e5f246632a46421f.png) [@AndyXheli](https://help.nextcloud.com/u/AndyXheli)\
**Post date:** [August 3, 2020, 5:09pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/2 "2020-08-03T17:09:46Z")

</div>

I’m also have the same issue since i updated to PHP 7.4 this started to happen if i go back to PHP7.3 i dont see these errors

| 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 | | 11 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 | | 11 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 | | 11 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 | | 11 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 | | |

---

<div class="post-metadata">

**Author:** ![kesselb](https://help.nextcloud.com/user_avatar/help.nextcloud.com/kesselb/32/74519_2.png) [@kesselb](https://help.nextcloud.com/u/kesselb)\
**Post date:** [August 3, 2020, 5:34pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/3 "2020-08-03T17:34:14Z")

</div>

Related report on GitHub: [https://github.com/nextcloud/server/issues/21578](https://github.com/nextcloud/server/issues/21578)

---

<div class="post-metadata">

**Author:** ![AndyXheli](https://help.nextcloud.com/letter_avatar/andyxheli/32/6_449c533f586939b6e5f246632a46421f.png) [@AndyXheli](https://help.nextcloud.com/u/AndyXheli)\
**Post date:** [August 3, 2020, 7:14pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/4 "2020-08-03T19:14:35Z")

</div>

@kesselb Yup i reported that issue back on Jun 24, 2020

---

<div class="post-metadata">

**Author:** ![AndyXheli](https://help.nextcloud.com/letter_avatar/andyxheli/32/6_449c533f586939b6e5f246632a46421f.png) [@AndyXheli](https://help.nextcloud.com/u/AndyXheli)\
**Post date:** [August 10, 2020, 2:33pm UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/5 "2020-08-10T14:33:34Z")

</div>

any updates on this ticket ?

---

<div class="post-metadata">

**Author:** ![stdcerr](https://help.nextcloud.com/user_avatar/help.nextcloud.com/stdcerr/32/19611_2.png) [@stdcerr](https://help.nextcloud.com/u/stdcerr)\
**Post date:** [August 11, 2020, 3:51am UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/6 "2020-08-11T03:51:16Z")

</div>

I unfortunately don’t have any update…

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:53am UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/7 "2024-12-12T07:53:38Z")

</div>



---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 12, 2024, 7:53am UTC](https://help.nextcloud.com/t/typeerror-argument-2-passed-to-encryption-modifymetadata/88475/8 "2024-12-12T07:53:40Z")

</div>


