Fatal error syncing

Nextcloud version 13.0.5.2
Raspbian 9
Apache 2.4.25:
PHP 7.0.30-0+deb9u1 (cli) (built: Jun 14 2018 13:50:25) ( NTS )
self signed certificate

The issue you are facing:
data not syncing
OSX client shows “connection closed”

Is this the first time you’ve seen this error?
yes

Steps to replicate it:
put files in syncing folder

The output of your Nextcloud log in Admin > Logging:

Fatal	OCP\Encryption\Exceptions\GenericEncryptionException: Bad Signature
/var/www/nextcloud/apps/encryption/lib/Crypto/Crypt.php - line 465: OCA\Encryption\Crypto\Crypt->checkSignature('FeA3AqK/C7Xao8L...', '\xB42\x8F%\xC7\xD4\x06\xAE2\xD0\xDD F$^...', '54cccf257be7121...')
/var/www/nextcloud/apps/encryption/lib/Crypto/Encryption.php - line 380: OCA\Encryption\Crypto\Crypt->symmetricDecryptFileContent('FeA3AqK/C7Xao8L...', '\xB42\x8F%\xC7\xD4\x06\xAE2\xD0\xDD F$^...', 'AES-256-CTR', 0, 0)
/var/www/nextcloud/lib/private/Files/Stream/Encryption.php - line 464: OCA\Encryption\Crypto\Encryption->decrypt(*** sensitive parameters replaced ***)
/var/www/nextcloud/lib/private/Files/Stream/Encryption.php - line 295: OC\Files\Stream\Encryption->readCache()
[internal function] OC\Files\Stream\Encryption->stream_read(8192)
/var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php - line 83: fread(Resource id #406, 8192)
/var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php - line 91: Icewind\Streams\Wrapper->stream_read(8192)
[internal function] Icewind\Streams\CallbackWrapper->stream_read(8192)
/var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php - line 84: fread(Resource id #410, 8192)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 498: Sabre\HTTP\Sapi sendResponse(Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/lib/Server.php - line 287: Sabre\DAV\Server->exec()
/var/www/nextcloud/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
/var/www/nextcloud/remote.php - line 164: require_once('/var/www/nextcl...')
{main}

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

$CONFIG = array (
  'passwordsalt' => ‘xx’,
  'secret' => ‘xx’,
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '192.168.1.80',
    5 => 'nextcloudpi.local',
    6 => ‘domain.com',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'https://192.168.1.80',
  'dbtype' => 'mysql',
  'version' => '13.0.5.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => ‘xx’,
  'dbpassword' => ‘xx’,
  'installed' => true,
  'instanceid' => 'ocrvwcjl6cut',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => ‘xx’,
  ),
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'overwriteprotocol' => 'https',
  'maintenance' => false,
  'loglevel' => 2,
);

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

[Wed Jul 25 12:49:33.105111 2018] [proxy_fcgi:error] [pid 11914:tid 1758651440] [client 192.168.1.17:49313] AH01067: Failed to read FastCGI header
[Wed Jul 25 12:49:33.105236 2018] [proxy_fcgi:error] [pid 11914:tid 1758651440] (104)Connection reset by peer: [client 192.168.1.17:49313] AH01075: Error dispatching request to :4443: 
[Wed Jul 25 12:49:34.621011 2018] [mpm_event:notice] [pid 26592:tid 1992622080] AH00491: caught SIGTERM, shutting down
[Wed Jul 25 12:49:48.962910 2018] [ssl:warn] [pid 570:tid 1992704000] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 25 12:49:48.963256 2018] [ssl:error] [pid 570:tid 1992704000] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=desktop / issuer: CN=desktop / serial: E22858A05CCC728F / notbefore: Jun 27 16:34:34 2018 GMT / notafter: Jun 24 16:34:34 2028 GMT]
[Wed Jul 25 12:49:48.963277 2018] [ssl:error] [pid 570:tid 1992704000] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed Jul 25 12:49:49.060844 2018] [ssl:warn] [pid 683:tid 1992704000] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Jul 25 12:49:49.061208 2018] [ssl:error] [pid 683:tid 1992704000] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=desktop / issuer: CN=desktop / serial: E22858A05CCC728F / notbefore: Jun 27 16:34:34 2018 GMT / notafter: Jun 24 16:34:34 2028 GMT]
[Wed Jul 25 12:49:49.061234 2018] [ssl:error] [pid 683:tid 1992704000] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed Jul 25 12:49:50.003620 2018] [mpm_event:notice] [pid 683:tid 1992704000] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Wed Jul 25 12:49:50.003789 2018] [core:notice] [pid 683:tid 1992704000] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jul 25 12:49:51.109081 2018] [proxy:error] [pid 854:tid 1683178544] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.0-fpm.sock (*) failed
[Wed Jul 25 12:49:51.109215 2018] [proxy_fcgi:error] [pid 854:tid 1683178544] [client 192.168.1.17:49391] AH01079: failed to make connection to backend: httpd-UDS
[Wed Jul 25 12:52:38.858948 2018] [proxy_fcgi:error] [pid 854:tid 1683178544] [client 192.168.1.17:49429] AH01071: Got error 'PHP message: PHP Warning:  fclose(): supplied resource is not a valid stream resource in /var/www/ncp-web/L10N.php on line 166\n'```