Error: Cannot modify header information - headers already sent by (output started at

Hallo,

bei meiner Neuinstallation habe ich ein bisher unlösbares Problem:
Auf einem Raspberry Pi habe ich NextcloudPi installiert und aktualisiert - siehe unten.
An den Raspberry wurden zwei 4Gb-Festplatten per USB angeschlossen und zu einem Software-Raid1-Verbund eingebunden.
Die config.php sah nach der Anpassung so aus:

<?php
$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    11 => '93.131.85.253',
    1 => '192.168.178.33',
    3 => 'mein.ddns.net',
    2 => 'tmein.ddns.net',
    12 => 'mein.ddns.net',
  ),
  'datadirectory' => '/media/raid/nextcloud/ncdata',
  'dbtype' => 'mysql',
  'version' => '20.0.2.2',
  'updater.release.channel' => 'stable',
  'overwrite.cli.url' => 'https://mein.ddns.net/',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'xxx',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'xxx',
  ),
  'tempdirectory' => '/media/raid/nextcloud/ncdata/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'loglevel' => '2',
  'log_type' => 'file',
  'maintenance' => false,
  'logfile' => '/media/raid/nextcloud/ncdata/nextcloud.log',
  'logtimezone' => 'Europe/Berlin',
);

Leider ist es nicht möglich eine Synchronisation vorzunehmen.
Es werden keine Dateien hochgeladen, nur Ordner angelegt.
Eine Fehlermeldung aus dem Protokoll lautet:

Error	PHP	Error: Cannot modify header information - headers already sent by (output started at /var/www/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691
    <<closure>>
    OC\Log\ErrorHandler::onError(2, "Cannot modi ... )", "/var/www/ne ... p", 691, { string: "X ... "})
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 691:
    header("X-Hash-MD5: ... 8")
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 189:
    OCA\DAV\Connector\Sabre\File->header("X-Hash-MD5: ... 8")
    <<closure>>
    OCA\DAV\Connector\Sabre\File->OCA\DAV\Connector\Sabre\{closure}("*** sensiti ... *")
    /var/www/nextcloud/lib/private/Files/Stream/HashWrapper.php - line 71:
    call_user_func(Closure {}, "*** sensiti ... *")
    <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
    /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php - line 132:
    fclose(null)
    /var/www/nextcloud/lib/private/Files/Stream/HashWrapper.php - line 75:
    Icewind\Streams\Wrapper->stream_close()
    <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
    /var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php - line 132:
    fclose(null)
    /var/www/nextcloud/lib/private/Files/Stream/HashWrapper.php - line 75:
    Icewind\Streams\Wrapper->stream_close()
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
    OC\Files\Stream\HashWrapper->stream_close()
    /var/www/nextcloud/apps/dav/lib/Server.php - line 332:
    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 167:
    require_once("/var/www/ne ... p")

Eine weitere Fehlermeldung:

Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 112192 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8192 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
    /var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 155:
    OCA\DAV\Connector\Sabre\File->put(null)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1104:
    OCA\DAV\Connector\Sabre\Directory->createFile("KMUPD10.mdx", null)
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 527:
    Sabre\DAV\Server->createFile("files/jan.t ... x", null, null)
    /var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php - line 89:
    Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 474:
    Sabre\DAV\Server->emit("method:PUT", [ Sabre\HTTP ... }])
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 251:
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
    /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 319:
    Sabre\DAV\Server->start()
    /var/www/nextcloud/apps/dav/lib/Server.php - line 332:
    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 167:
    require_once("/var/www/ne ... p")

Zu meiner Installation noch einige Informationen:

NextCloudPi version  v1.36.3
NextCloudPi image    NextCloudPi_11-27-20
distribution         Debian GNU/Linux 10 \n \l
automount            yes
USB devices          sda sdb
datadir              /media/raid/nextcloud/ncdata
data in SD           no
data filesystem      ext2/ext3
data disk usage      1.3G/3.6T
rootfs usage         2.5G/29G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      ok
Nextcloud version    20.0.2.2
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.178.33
gateway              192.168.178.1
interface            eth0

Informationen zu meinem RAID:

/dev/md0:
           Version : 1.2
     Creation Time : Sat Jun 12 23:09:53 2021
        Raid Level : raid1
        Array Size : 3906885440 (3725.90 GiB 4000.65 GB)
     Used Dev Size : 3906885440 (3725.90 GiB 4000.65 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Mon Jun 14 22:06:53 2021
             State : clean, resyncing
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

     Resync Status : 73% complete

              Name : nextcloudpi:0  (local to host nextcloudpi)
              UUID : c4d37eda:f8de28f0:2d579ef4:61758582
            Events : 122579

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

Inhalt von /etc/fstab:

PARTUUID=c4f7eed2-01  /boot           vfat    defaults          0       2
PARTUUID=c4f7eed2-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
/dev/md0              /media/raid     ext4    defaults          0       0

Kann mir jemand einen Tipp geben, wie ich meine Cloud zum Laufen bekomme?
Besten Dank im Voraus.
Jan

Hatte die gleiche Fehlermeldung in den logs, nach einem Update von 18 auf 21.

Lag bei mir daran, dass das in der phpconfig spezifizierte directory nicht existierte.
bei dir diese Zeile:
‘tempdirectory’ => ‘/media/raid/nextcloud/ncdata/tmp’

nachdem ich es erstellt habe und mit den richtigen Berechtigungen versehen habe, konnte ich wieder über die Desktop App syncronisieren.

Grüße