Getting conflicted copy whenever a file is edited

Nextcloud version : 19.0.5
Operating system and version : Ubuntu 20.04.1 LTS (GNU/Linux 5.4.77-217 armv7l)
Apache or nginx version : Apache/2.4.41
PHP version : 7.4.3

The issue you are facing:

Can create local files and are synced to server with no problems, but every time a local file is edited it gives an unresolved conflict message and creates a conflicted copy file. Editing files on server are synced without problems to local.

There is only one user editing the files. Server files are stores on externally trough sftp.

Aditionally, i have no troubles creating and editing files from android device using nextcloud android app.

On Admin > Logging get this 2 error messages:

Error: Trying to access array offset on value of type bool at /usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#334
Error: Trying to access array offset on value of type bool at /usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#330

Is this the first time you’ve seen this error? : Yes

The output of your Nextcloud log in Admin > Logging:

"message":{
    "Exception":"Error",
    "Message":"Trying to access array offset on value of type bool at /usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#334",
    "Code":0,
    "Trace":[
      {
        "file":"/usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php",
        "line":334,
        "function":"onError",
        "class":"OC\\Log\\ErrorHandler",
        "type":"::"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Common.php",
        "line":115,
        "function":"filetype",
        "class":"OCA\\Files_External\\Lib\\Storage\\SFTP",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Common.php",
        "line":149,
        "function":"is_dir",
        "class":"OC\\Files\\Storage\\Common",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Common",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php",
        "line":67,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
        "line":182,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Availability",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/ransomware_protection/lib/StorageWrapper.php",
        "line":143,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/View.php",
        "line":1167,
        "function":"isCreatable",
        "class":"OCA\\RansomwareProtection\\StorageWrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/View.php",
        "line":495,
        "function":"basicOperation",
        "class":"OC\\Files\\View",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
        "line":155,
        "function":"isCreatable",
        "class":"OC\\Files\\View",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":1143,
        "function":"put",
        "class":"OCA\\DAV\\Connector\\Sabre\\File",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line":515,
        "function":"updateFile",
        "class":"Sabre\\DAV\\Server",
        "type":"->",
        "args":[
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line":89,
        "function":"httpPut",
        "class":"Sabre\\DAV\\CorePlugin",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":474,
        "function":"emit",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":251,
        "function":"invokeMethod",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":319,
        "function":"start",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/lib/Server.php",
        "line":320,
        "function":"exec",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line":35,
        "function":"exec",
        "class":"OCA\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/remote.php",
        "line":167,
        "args":[
          "/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function":"require_once"
      }
    ],
    "File":"/usr/share/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line":91,
    "CustomMessage":"--"
  },
"message":{
    "Exception":"Error",
    "Message":"Trying to access array offset on value of type bool at /usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php#330",
    "Code":0,
    "Trace":[
      {
        "file":"/usr/share/nextcloud/apps/files_external/lib/Lib/Storage/SFTP.php",
        "line":330,
        "function":"onError",
        "class":"OC\\Log\\ErrorHandler",
        "type":"::"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Common.php",
        "line":115,
        "function":"filetype",
        "class":"OCA\\Files_External\\Lib\\Storage\\SFTP",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Common.php",
        "line":149,
        "function":"is_dir",
        "class":"OC\\Files\\Storage\\Common",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Common",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/PermissionsMask.php",
        "line":67,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\PermissionsMask",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php",
        "line":182,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line":165,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Availability",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/ransomware_protection/lib/StorageWrapper.php",
        "line":143,
        "function":"isCreatable",
        "class":"OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/View.php",
        "line":1167,
        "function":"isCreatable",
        "class":"OCA\\RansomwareProtection\\StorageWrapper",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/lib/private/Files/View.php",
        "line":495,
        "function":"basicOperation",
        "class":"OC\\Files\\View",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
        "line":155,
        "function":"isCreatable",
        "class":"OC\\Files\\View",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":1143,
        "function":"put",
        "class":"OCA\\DAV\\Connector\\Sabre\\File",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line":515,
        "function":"updateFile",
        "class":"Sabre\\DAV\\Server",
        "type":"->",
        "args":[
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line":89,
        "function":"httpPut",
        "class":"Sabre\\DAV\\CorePlugin",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":474,
        "function":"emit",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":251,
        "function":"invokeMethod",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line":319,
        "function":"start",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/lib/Server.php",
        "line":320,
        "function":"exec",
        "class":"Sabre\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line":35,
        "function":"exec",
        "class":"OCA\\DAV\\Server",
        "type":"->"
      },
      {
        "file":"/usr/share/nextcloud/remote.php",
        "line":167,
        "args":[
          "/usr/share/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function":"require_once"
      }
    ],
    "File":"/usr/share/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line":91,
    "CustomMessage":"--"
  }

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

$CONFIG = array (
  'instanceid' => 'xxxxx',
  'passwordsalt' => 'xxxxxxx',
  'secret' => 'xxxxxx',
  'trusted_domains' => 
  array (
    0 => 'xxxx',
    1 => 'xxxxx',
    2 => 'xxxxx',
  ),
  'datadirectory' => '/xxxxx/NEXTCLOUD_DATA/',
  'dbtype' => 'mysql',
  'version' => '19.0.5.2',
  'overwrite.cli.url' => 'http://xxxx/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'nextcloud',
  'installed' => true,
  'theme' => '',
  'loglevel' => '2',
  'maintenance' => false,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\TXT',
    1 => 'OC\\Preview\\MarkDown',
    2 => 'OC\\Preview\\OpenDocument',
    3 => 'OC\\Preview\\PDF',
    4 => 'OC\\Preview\\MSOffice2003',
    5 => 'OC\\Preview\\MSOfficeDoc',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\Image',
    8 => 'OC\\Preview\\Photoshop',
    9 => 'OC\\Preview\\TIFF',
    10 => 'OC\\Preview\\SVG',
    11 => 'OC\\Preview\\Font',
    12 => 'OC\\Preview\\MP3',
    13 => 'OC\\Preview\\Movie',
    14 => 'OC\\Preview\\MKV',
    15 => 'OC\\Preview\\MP4',
    16 => 'OC\\Preview\\AVI',
    17 => 'OC\\Preview\\MOV',
  ),
  'enable_movie_transcode' => true,
  'mysql.utf8mb4' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.secret' => 'xxxxxxxx',
  'log_type' => 'owncloud',
  'logfile' => '/var/log/nextcloud.log',
  'log_rotate_size' => '104857600',
);