Public link-sharing has gone away

Nextcloud version : 15.0.7.0
Operating system and version : Debian 9
Apache or nginx version: nginx/1.15.9 built with OpenSSL 1.1.1b
PHP version: PHP 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2 with Zend OPcache v7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2

The issue you are facing: File sharing is only available within Nextcloud, public sharing is missing. Clicking on anchor icon is useless, as it doesn’t register as a hyperlink/JS action/whatever. Administration > Sharing is in order, but Personal > Sharing returns white page instantly, as if there was a PHP error internally.

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

Steps to replicate it:

  1. Disable/Enable/Disable “Email sharing / Social Email sharing” in order to fix the bug where you can’t remove accidental share (option is missing)
  2. ???
  3. Shit’s broken, yo.

The output of your Nextcloud log in Admin > Logging:

Level	App	Message		Time
Error	sharebymail	Swift_TransportException: Connection to ssl://smtp.[???]:465 Timed Out	
2019-04-10T20:33:21+0300
Fatal	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 313856 got 147456	
[...lots of SabreDAV-related errors, bumped limits in php-fpm for now]
2019-04-10T15:42:41+0300
Info	updater	\OC\Updater::resetLogLevel: Reset log level to Warning(2)	
2019-04-10T15:32:42+0300
Info	updater	\OC\Updater::maintenanceDisabled: Turned off maintenance mode	
2019-04-10T15:32:42+0300
Info	updater	\OC\Updater::updateEnd: Update successful	
2019-04-10T15:32:42+0300
Info	updater	\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check	
2019-04-10T15:32:42+0300
Info	updater	\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::step: Repair step: Extract the vcard uid and store it in the db	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::info: Repair info: No need to repair pending cron jobs.	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::step: Repair step: Repair pending cron jobs	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::step: Repair step: Queue a one-time job to cleanup old backups of the updater	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::step: Repair step: Add preview background cleanup job	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::step: Repair step: Clear every generated avatar on major updates	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::info: Repair info: JS cache cleared	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::info: Repair info: SCSS cache cleared	
2019-04-10T15:32:39+0300
Info	updater	\OC\Repair::info: Repair info: Image cache cleared	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::step: Repair step: Clear frontend caches	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::step: Repair step: Add log rotate job	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::step: Repair step: Repair invalid paths in file cache	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::info: Repair info: No mounts updated	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::step: Repair step: Fix potential broken mount points	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::info: Repair info: .step file moved to .step-previous-update	
2019-04-10T15:32:38+0300
Info	updater	\OC\Repair::info: Repair info: .step-previous-update removed	
2019-04-10T15:32:38+0300

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

<?php
$CONFIG = array (
  'instanceid' => '???',
  'passwordsalt' => '???',
  'secret' => '???',
  'trusted_domains' => 
  array (
    0 => 'cloud.intra',
  ),
  'datadirectory' => '/cloud/data',
  'dbtype' => 'mysql',
  'version' => '15.0.7.0',
  'overwrite.cli.url' => 'https://cloud.intra',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '???',
  'installed' => true,
  'updater.release.channel' => 'production',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'service',
  'mail_domain' => '???',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.???.???',
  'mail_smtpport' => '465',
  'mail_smtpname' => '???',
  'mail_smtppassword' => '???',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'mysql.utf8mb4' => true,
  'updater.secret' => '???',
);

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

I've skimmed through the /var/log/nginx/nextcloud-{access,error}.log, and no relevant data was in. The only noticeable part was about timed-out FPM sock, which was fixed by bumping pm.max_children, and didn't affect the outcome.

I’d like to point out that the issue is NOT server related, as the Nginx + PHP version bump was made long before the issue arose, and it started showing RIGHT AFTER I fiddled with E-mail addons by switching them on and off again. Thing is, public links have stopped generating as well, which is logically unrelated and confusing.

“Administration > Sharing” screenshot:

And for the record: I’ve tried both disabling and removing “Social sharing via e-mail”, as was suggested on a GitHub ticket, but it didn’t fix the issue for me. Disabling/re-enabling “Sharing by email” and “File sharing” also didn’t produce any positive effect.

Reuploaded the 15.0.7.0 distro - nothing changed. What the hell?

occ integrity:check-core and occ maintenance:repair also finish cleanly.