Federated recieve links keep trying to connect to remote cloud, although links were deleted

Hi all


Nextcloud version: 12.0.0
Operating system and version: Ubuntu 16.04.3 LTS
Apache or nginx: nginx/1.13.0
PHP version: PHP 7.1.8

Is this the first time you’ve seen this error?: yes (reappears in logs every 15 min)

Can you reliably replicate it? (If so, please outline steps):no

The issue you are facing:

A user of my nextcloud connected his profile to his own nextcloud setup via federated. He linked 4 directories between the clouds. His nextcloud is not running anymore and he deleted the federated links on my nextcloud.

However: every 15 min my nextcloud still tries to connect to the other cloud and apparently tries to access the federate links. Even when I turned of the federate cloud sharing entirely the error still occurs.

The error log states:

Error files_external Sabre\HTTP\ClientException: Failed to connect to XXX.XXX.XXX.XXX port 443: Connection refused
Error no app in context OCP\Files\StorageNotAvailableException: Sabre\HTTP\ClientException: Failed to connect to XXX.XXX.XXX.XXX port 443: Connection refused
Error files_external Failed to connect to XXX.XXX.XXX.XXX port 443: Connection refused 2017-
Error no app in context Sabre\HTTP\ClientException: Failed to connect to XXX.XXX.XXX.XXX port 443: Connection refused

The Traceback of Sabre\HTTP\ClientException: Failed to connect to XXX.XXX.XXX.XXX port 443: Connection refused

/var/www/nextcloud/3rdparty/sabre/http/lib/Client.php - line 103: Sabre\HTTP\Client->doRequest(Object(Sabre\HTTP\Request))
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Client.php - line 231: Sabre\HTTP\Client->send(Object(Sabre\HTTP\Request))
/var/www/nextcloud/lib/private/Files/Storage/DAV.php - line 263: Sabre\DAV\Client->propFind('https //45.32.1...', Array)
/var/www/nextcloud/lib/private/Files/Storage/DAV.php - line 577: OC\Files\Storage\DAV->propfind('')
/var/www/nextcloud/lib/private/Files/Storage/Common.php - line 444: OC\Files\Storage\DAV->stat('')
/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php - line 184: OC\Files\Storage\Common->test()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 467: OCA\Files_Sharing\External\Storage->test()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 52: OC\Files\Storage\Wrapper\Wrapper->test()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 66: OC\Files\Storage\Wrapper\Availability->updateAvailability()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 75: OC\Files\Storage\Wrapper\Availability->isAvailable()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php - line 458: OC\Files\Storage\Wrapper\Availability->checkAvailability()
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\Availability->getMetaData('')
/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 577: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 113: OC\Files\Storage\Wrapper\Wrapper->getMetaData('')
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 152: OC\Files\Cache\Scanner->getData('')
/var/www/nextcloud/apps/files_sharing/lib/External/Scanner.php - line 62: OC\Files\Cache\Scanner->scanFile('', true)
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 322: OCA\Files_Sharing\External\Scanner->scanFile('', true, -1, NULL, true)
/var/www/nextcloud/apps/files_sharing/lib/External/Scanner.php - line 41: OC\Files\Cache\Scanner->scan('', true, true, true)
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 491: OCA\Files_Sharing\External\Scanner->scan('', true, 1)
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 508: OC\Files\Cache\Scanner->OC\Files\Cache\{closure}()
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 492: OC\Files\Cache\Scanner->runBackgroundScanJob(Object(Closure), '')
/var/www/nextcloud/lib/private/Files/Utils/Scanner.php - line 175: OC\Files\Cache\Scanner->backgroundScan()
/var/www/nextcloud/apps/files/lib/BackgroundJob/ScanFiles.php - line 88: OC\Files\Utils\Scanner->backgroundScan('')
/var/www/nextcloud/apps/files/lib/BackgroundJob/ScanFiles.php - line 112: OCA\Files\BackgroundJob\ScanFiles->runScanner(Object(OC\User\User))
/var/www/nextcloud/lib/private/BackgroundJob/Job.php - line 59: OCA\Files\BackgroundJob\ScanFiles->run(NULL)
/var/www/nextcloud/lib/private/BackgroundJob/TimedJob.php - line 54: OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
/var/www/nextcloud/cron.php - line 124: OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
{main}

These log entries appear 4 times every 15 min.
My monitoring App, also still claims that there are 4 federated receive links (pink bar in web-GUI).

I confirmed with my user, that the federated links were certainly deleted and even some of the 4 directories were entirely deleted from the cloud.

Otherwise the cloud seems to run fine.


The output of my config.php:
<?php
$CONFIG = array (
‘instanceid’ => ‘xxxx’,
‘passwordsalt’ => ‘xxxx’,
‘secret’ => ‘xxxx’,
‘trusted_domains’ =>
array (
0 => ‘xxxx’,
1 => ‘xxxx’,
),
‘datadirectory’ => ‘/nc_data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘12.0.0.29’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘nextcloud’,
‘mysql.utf8mb4’ => true,
‘htaccess.RewriteBase’ => ‘/’,
‘overwrite.cli.url’ => ‘/’,
‘overwriteprotocol’ => ‘https’,
‘loglevel’ => 2,
‘logtimezone’ => ‘Europe/Berlin’,
‘logfile’ => ‘/var/nc_data/nextcloud.log’,
‘log_rotate_size’ => 104857600,
‘cron_log’ => false,
‘installed’ => true,
‘filesystem_check_changes’ => 1,
‘quota_include_external_storage’ => false,
‘knowledgebaseenabled’ => false,
‘memcache.local’ => ‘\OC\Memcache\APCu’,
‘filelocking.enabled’ => ‘true’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
),
‘maintenance’ => false,
‘theme’ => ‘’,
‘integrity.check.disabled’ => false,
‘updater.release.channel’ => ‘stable’,
‘enable_previews’ => true,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtphost’ => ‘mail.xxx.xx’,
‘mail_smtpport’ => ‘xxxx’,
‘mail_smtpsecure’ => ‘ssl’,
‘mail_from_address’ => ‘xxxx’,
‘mail_domain’ => 'xxxx,
‘mail_smtpauth’ => 1,
‘mail_smtpname’ => ‘xxxx’,
‘mail_smtppassword’ => ‘xxxx’,
);


The output of my nginx error log in /var/log/nginx (not sure if this is connected since it occurred yesterday and the error I am describing here is periodic):

2017/08/06 15:13:20 [error] 860#860: *50 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:61
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrin…
PHP message: PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory in /var/www/nextcloud/lib/private/DB/Connection.php:61
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\DBAL\Connection->getDatabasePlatformVersion()
#2 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\DBAL\Connection->detectDatabasePlatform()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\DBAL\Connection->getDatabasePlatform()
#4 /var/www/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)
#5 /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManage

Thanks in advance for any clues!

Hi,

I have the same problem now. To try out Federated Sharing I shared a file from my test server to my production server. Yesterday I had to delete my test server and now my logs are flooded with this error message and what is even worse: the files app and now the whole server became extremely slow.
I’m not sure if the error message is really triggered by the Federation app or the files_external app. Besides the federation share I also included an external storage in the external_files app, which I removed as well.

Hi!
I’m afraid, i have the same problem. I accidently added a server with its private ip. Now, everytime i want to access Nextcloud, its extremely slow and i have to wait for a timeout until i can start the next action. I already deleted the federation server and disabled all options at “Federation-Cloud-Sharing”. The share was removed as well.

Hi, I just solved the problem for me.

Here is what I did:

Don’t just mess around with the database yourself. Please report this issue to the developers on https://github.com/nextcloud/server/issues to get a proper solution.

Sorry :frowning:
But for it was really urgent to fix that problem. I’m aware that messing in the DB could corrupt the data, but I was careful :stuck_out_tongue:

However you are absolutely right!

tflidd is surely right, but i can’t wait several hours or even days until its fixed. My boss would kill me. :wink:
I just wanted to say, that Schmu’s fix solved the problem. It was just one entry in the table and that was the one with the wrong ip. Thanks for the quick help! :slight_smile:

You guys have a dirty workaround, this can be a temporary solution but we must have this fixed in the code. Please report it and leave us a link here.

1 Like

I am reporting the bug/issue right at the moment to git hub … give me some time …

see issue report: https://github.com/nextcloud/server/issues/6029

(I am bit of noob maybe someone can professionally link these to threads together … thanks)

2 Likes