owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.36k stars 2.06k forks source link

[files_sharing] Log gets flooded with "No owner found for reshare" #20375

Closed stonerl closed 8 years ago

stonerl commented 8 years ago

Actual behaviour

The log gets flooded with "No owner found for reshare" since I updated to 8.1.4.

Server configuration

Operating system: Ubuntu 14.04.3

Web server: Apache/2.4.7

Database: mysql Ver 14.14 Distrib 5.5.46

PHP version: 5.5.9-1ubuntu4.14

ownCloud version: 8.1.4 (stable)

Updated from an older ownCloud or fresh install: update from 8.1.3

List of activated apps:

 - activity: 2.0.2
 - calendar: 0.7.3
 - contacts: 0.4.0.1
 - conversations: 0.2.2
 - delete_confirmation: 1.0.1
 - documents: 0.10.2
 - files: 1.1.10
 - files_antivirus: 0.7.0.1
 - files_pdfviewer: 0.7
 - files_sharing: 0.6.3
 - files_texteditor: 0.4
 - files_trashbin: 0.6.3
 - files_versions: 1.0.6
 - firstrunwizard: 1.1
 - mail: 0.2.1
 - polls: 0.6.2
 - provisioning_api: 0.2
 - search_lucene: 0.7.0
 - tasks: 0.8
 - user_external: 0.4

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => '###',
  'passwordsalt' => '###',
  'trusted_domains' => 
  array (
    0 => '###',
  ),
  'datadirectory' => '/srv/owncloud-data',
  'dbtype' => 'mysql',
  'version' => '8.1.4.2',
  'dbname' => '###',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => '###',
  'dbpassword' => '###',
  'installed' => true,
  'mail_from_address' => 'owncloud',
  'mail_smtpmode' => 'sendmail',
  'loglevel' => 3,
  'logtimezone' => 'Europe/Berlin',
  'log_type' => 'owncloud',
  'log_authfailip' => true,
  'log_rotate_size' => 52428800,
  'logfile' => '/var/log/owncloud/owncloud.log',
  'mail_domain' => '###',
  'default_language' => 'de_DE',
  'user_backends' => 
  array (
    0 => 
    array (
      'class' => 'OC_User_IMAP',
      'arguments' => 
      array (
        0 => '{###:993/imap/ssl/novalidate-cert}',
      ),
    ),
  ),
  'maintenance' => false,
  'overwritewebroot' => '/owncloud',
  'appcodechecker' => false,
  'session_lifetime' => 604800,
  'session_keepalive' => true,
  'secret' => '###',
  'theme' => '',
  'skeletondirectory' => '',
  'overwrite.cli.url' => '###',
  'asset-pipeline.enabled' => true,
  'allow_user_to_change_display_name' => false,
  'has_internet_connection' => true,
  'check_for_working_webdav' => true,
  'check_for_working_htaccess' => true,
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0,
    'dbindex' => 0,
  ),
  'filesystem_check_changes' => 1,
  'updatechecker' => false,
  'mail_smtphost' => '127.0.0.1',
  'mail_smtpport' => '25',
);

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: IMAP

ownCloud log (data/owncloud.log)

{"reqId":"CIJ834DAv4xj8xaXC19y","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:14+01:00"}
{"reqId":"X5bmUzAHq1MEvf3A9Ofo","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:22+01:00"}
{"reqId":"4gBndksU9u9rPq\/7rZVa","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:23+01:00"}
{"reqId":"4gBndksU9u9rPq\/7rZVa","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:23+01:00"}
{"reqId":"+yR2E3QZfPLbBZPZ9mbc","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:29+01:00"}
{"reqId":"MDwTiYeGh8oY1xEB979W","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:33+01:00"}
{"reqId":"MDwTiYeGh8oY1xEB979W","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:33+01:00"}
{"reqId":"Vliemz9T4Mp2z1UEViTy","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:37+01:00"}
{"reqId":"iRikkVtzld+OdAIrzPZq","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:38+01:00"}
{"reqId":"u1QuJ5FC4plB0JdSLi2V","remoteAddr":"x.x.x.x","app":"files_sharing","message":"No owner found for reshare","level":3,"time":"2015-11-05T21:53:46+01:00"}
MorrisJobke commented 8 years ago

cc @rullzer @schiesbn

PVince81 commented 8 years ago

@stonerl do these entries appear when a specific user is displaying the folder contents ? Does that user receive or send shares ?

Would also be good to have a look at the oc_share table. Maybe one of the share owners is a deleted user ?

stonerl commented 8 years ago

@PVince81 I have around 60 users on this very server. As far as I can recall, I did not delete any user during the last 12 months. But it seems that I'm one of the users that is causing the log flood and I currently connect via the desktop-client only. I do have many files/folders shared with and by other users.

oc_sharecontains 400 entries. Is there anything specific I should look for? Is there any way to detect the problematic shares with the reqID from the log?

stonerl commented 8 years ago

One more question does No owner found for reshare mean what I think it means?

User A shared a file with User B and User B shares (reshares) this file with User C?

PVince81 commented 8 years ago

@stonerl if your user name is producing the logs, you could try a select * from oc_share where share_with=$YOURUSER or uid_owner=$YOURUSER

I also wonder if you might have shares that have orphaned parents: select * from oc_share where parent not in (select id from oc_share)

Regarding the error message, I don't know yet where it is supposed to happen, need to dive into the code.

stonerl commented 8 years ago

This select * from oc_share where share_with=USERrs02 or uid_owner=USERrs02 gave me this output:

"109","0","USERrs02","USERgd29",NULL,"folder","9792","/9792","9792","/Sachen von Stas","31","1415613952","0",NULL,NULL,"0"
"113","0","USERrs02","USERap01",NULL,"file","10148","/10148","10148","/WaDokuDa.tab","19","1415807998","0",NULL,NULL,"0"
"177","0","USERrs02","USERfa01",NULL,"folder","83848","/83848","83848","/Vereine","31","1418286805","0",NULL,NULL,"0"
"193","0","USERrs02","USERap01",NULL,"folder","88118","/88118","88118","/AusspracheAudioDateien","17","1421337626","0",NULL,NULL,"1"
"228","0","USERrs02","USERkd66",NULL,"folder","152550","/152550","152550","/Für Toni","31","1426516309","0",NULL,NULL,"0"
"464","0","USERrs02","USERfa01",NULL,"folder","158210","/158210","158210","/Projektarbeit SoSe 2015","31","1430140006","0",NULL,NULL,"0"
"487","1","Projekt","USERrs02",NULL,"addressbook","90","Projektmitglieder(USERrs02)",NULL,"Projektmitglieder(USERrs02)","17","1430913250","0",NULL,NULL,"0"
"491","0","USERme01","USERrs02",NULL,"file","159713","/159713","159713","/Bestandsliste.xlsx","19","1431095070","0",NULL,NULL,"0"
"573","1","Projekt","USERrs02",NULL,"calendar","45","USERrs02's Projekt",NULL,"USERrs02's Projekt","31","1431337934","0",NULL,NULL,"0"
"667","1","Gruppe I","USERrs02",NULL,"file","159947","/159947","159947","/genki2.apkg","19","1431350087","0",NULL,NULL,"0"
"672","1","Gruppe II","USERrs02",NULL,"file","159947","/159947","159947","/genki2.apkg","19","1431350094","0",NULL,NULL,"0"
"675","1","Gruppe III","USERrs02",NULL,"file","159947","/159947","159947","/genki2.apkg","19","1431350098","0",NULL,NULL,"0"
"682","1","Gruppe IV","USERrs02",NULL,"file","159947","/159947","159947","/genki2.apkg","19","1431350103","0",NULL,NULL,"0"
"689","1","PMO","USERrs02",NULL,"file","159947","/159947","159947","/genki2.apkg","19","1431350107","0",NULL,NULL,"0"
"694","1","Projekt","USERrs02",NULL,"file","159980","/159980","159980","/S21792615051215180.pdf","19","1431437701","0",NULL,NULL,"0"
"719","1","Projekt","USERrs02",NULL,"file","159981","/159981","159981","/PastedGraphic-5.png","17","1431437872","0",NULL,NULL,"0"
"784","1","Bibliothek","USERrs02",NULL,"file","1442","/1442","1442","/Ohne_Titel.ods","19","1431775205","0",NULL,NULL,"0"
"791","1","Bibliothek","USERrs02",NULL,"file","160632","/160632","160632","/ohne_Standort.ods","19","1431775216","0",NULL,NULL,"0"
"1467","0","USERrs02","USERog02",NULL,"file","167997","/167997","167997","/Übersetzung.rtf","19","1435067791","0",NULL,NULL,"1"
"1729","0","USERog02","USERrs02",NULL,"file","168568","/168568","168568","/zusammenfassung varietäten.txt","19","1435579962","0",NULL,NULL,"0"
"1840","0","USERms01","USERrs02",NULL,"file","168941","/168941","168941","/Inoue Tetsujirö (1855-1944) und die Ideologie des Götterlandes.pdf","19","1436276199","0",NULL,NULL,"0"
"1902","0","USERog02","USERrs02",NULL,"file","170880","/170880","170880","/Anki_Deck.apkg","19","1436876966","0",NULL,NULL,"0"
"1918","0","USERni16","USERrs02",NULL,"file","170880","/170880","170880","/Anki_Deck.apkg","19","1437655803","0",NULL,NULL,"0"
"1919","0","USERcf62","USERrs02",NULL,"file","170880","/170880","170880","/Anki_Deck.apkg","19","1439292431","0",NULL,NULL,"0"
"1927","0","USERni17","USERrs02",NULL,"file","170880","/170880","170880","/Anki_Deck.apkg","19","1439375042","0",NULL,NULL,"0"
"1929","1","Mitarbeiter","USERrs02",NULL,"file","198576","/198576","198576","/ownCloud.xlsx","17","1440021271","0",NULL,NULL,"0"
"2038","0","USERje01","USERrs02",NULL,"file","265233","/265233","265233","/_Hiwi.txt","19","1447087463","0",NULL,NULL,"0"

And this one select * from oc_share where parent not in (select id from oc_share)

"1879","1","Projekt","USERom06","1822","file","168723","/168723","168723","/Dritte Definition(Endprodukt) .pdf","17","1436379022","0",NULL,NULL,"0"

I'm a member of the group Projekt would removing this line solve it?

stonerl commented 8 years ago

After deleting this "1879","1","Projekt","USERom06","1822","file","168723","/168723","168723","/Dritte Definition(Endprodukt) .pdf","17","1436379022","0",NULL,NULL,"0" from oc_share, I got rid of the errors.

Naive question; shouldn't owncloud itself clean this up?

PVince81 commented 8 years ago

In an ideal world such entries should never exist in the first place. But you are right that there should be a mechanism in place that fixes broken entries.

Here is a ticket to make sure such entries are ignored by the API: https://github.com/owncloud/core/issues/20131 And here for a repair routine to clean them up: https://github.com/owncloud/core/pull/19871

PVince81 commented 8 years ago

The repair stuff will be in 8.2.1

stonerl commented 8 years ago

Thx allot