NC21 Cannot share folders

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 21.0.0
Operating system and version (eg, Ubuntu 20.04): 20.04.2
Apache or nginx version (eg, Apache 2.4.25): 2.4.41
PHP version (eg, 7.4): 8.0.3

The issue you are facing:
Share a folder from a NC user to another generates an error
Error creating the share: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘ocinternal:35’ for column ‘object_id’ at row 1

Is this the first time you’ve seen this error? (Y/N): Yes!

Steps to replicate it:

  1. Click share on a folder
  2. type the user you want to share the folder with
  3. wait for the error

The output of your Nextcloud log in Admin > Logging:

Warning	no app in context	Invalid data provided to provideInitialState by files		aprile 29, 2021 19:48:23
Error	PHP	Required parameter $mode follows optional parameter $a at /var/www/cloud/core/Controller/PreviewController.php#155

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

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'trusted_domains' =>
  array (
    0 => 'my ip',
    1 => 'my fqdn',
  ),
  'datadirectory' => '/mnt/nc_data',
  'trashbin_retention_obligation' => '90, 120',
  'versions_retention_obligation' => 'auto, 30',
  'filelocking.enabled' => false,
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloudDB',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => '',
  'session_lifetime' => 1800,
  'remember_login_cookie_lifetime' => 0,
  'session_keepalive' => false,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => '',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'PLAIN',
'mail_smtpauth' => true,
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtphost' => '',
  'mail_smtpport' => '587',
  'mail_smtpsecure' => 'tls',
  'theme' => '',
  'htaccess.RewriteBase' => '/owncloud',
  'appstore.experimental.enabled' => true,
  'updater.release.channel' => 'beta',
  'installed' => true,
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud.log',
  'logfilemode' => 416,
  'loglevel' => '2',
  'logdateformat' => 'F d, Y H:i:s',
  'updatechecker' => false,
  'maintenance' => false,
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
    1 => 'ocsms',
    2 => 'files_external_dropbox',
    3 => 'keeweb',
    4 => 'admin_notifications',
    5 => 'twofactor_rcdevsopenotp',
    6 => 'music',
    7 => 'bruteforcesettings',
  ),
  'default_phone_region' => 'IT',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' =>
  array (
    0 => 'users',
  ),
  'data-fingerprint' => 'f1cb1c1215c2a3a90b665af2ee00b2aa',
  'updater.secret' => ''
);

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

[Thu Apr 29 00:00:10.621772 2021] [ssl:warn] [pid 959] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 00:00:10.624383 2021] [ssl:warn] [pid 959] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 00:00:10.626759 2021] [mpm_prefork:notice] [pid 959] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Thu Apr 29 00:00:10.626781 2021] [core:notice] [pid 959] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 29 19:11:00.999837 2021] [proxy_fcgi:error] [pid 99026] (70008)Partial results are valid but processing is incomplete: [client 31.44.174.109:52108] AH01075: Error dispatching request to :16177: (reading input brigade)
[Thu Apr 29 19:11:01.247218 2021] [proxy_fcgi:error] [pid 98413] (70008)Partial results are valid but processing is incomplete: [client 31.44.174.109:23137] AH01075: Error dispatching request to :16177: (reading input brigade)
[Thu Apr 29 19:32:01.399140 2021] [mpm_prefork:notice] [pid 959] AH00169: caught SIGTERM, shutting down
[Thu Apr 29 19:32:02.068025 2021] [ssl:warn] [pid 100876] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:32:02.069083 2021] [ssl:warn] [pid 100876] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagik.so' (tried: /usr/lib/php/20190902/imagik.so (/usr/lib/php/20190902/imagik.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/imagik.so.>
[Thu Apr 29 19:32:03.437235 2021] [ssl:warn] [pid 100885] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:32:03.438131 2021] [ssl:warn] [pid 100885] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:32:03.503386 2021] [mpm_prefork:notice] [pid 100885] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Thu Apr 29 19:32:03.503445 2021] [core:notice] [pid 100885] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 29 19:35:50.364597 2021] [mpm_prefork:notice] [pid 100885] AH00169: caught SIGTERM, shutting down
[Thu Apr 29 19:35:50.624491 2021] [ssl:warn] [pid 101023] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:35:50.625397 2021] [ssl:warn] [pid 101023] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagik.so' (tried: /usr/lib/php/20190902/imagik.so (/usr/lib/php/20190902/imagik.so: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/imagik.so.>
[Thu Apr 29 19:35:50.845551 2021] [ssl:warn] [pid 101030] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:35:50.846436 2021] [ssl:warn] [pid 101030] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:35:50.885543 2021] [mpm_prefork:notice] [pid 101030] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Thu Apr 29 19:35:50.885596 2021] [core:notice] [pid 101030] AH00094: Command line: '/usr/sbin/apache2'
[Thu Apr 29 19:37:33.757841 2021] [mpm_prefork:notice] [pid 101030] AH00169: caught SIGTERM, shutting down
[Thu Apr 29 19:37:33.970608 2021] [ssl:warn] [pid 101087] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:37:33.974755 2021] [ssl:warn] [pid 101087] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:37:34.114112 2021] [ssl:warn] [pid 101092] AH01909: 127.0.1.1:11419:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:37:34.119083 2021] [ssl:warn] [pid 101092] AH01909: 127.0.1.1:25308:0 server certificate does NOT include an ID which matches the server name
[Thu Apr 29 19:37:34.168490 2021] [mpm_prefork:notice] [pid 101092] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1i configured -- resuming normal operations
[Thu Apr 29 19:37:34.168545 2021] [core:notice] [pid 101092] AH00094: Command line: '/usr/sbin/apache2'

It is something related to STRICT_TRANS_TABLES mode in mysql.
I have removed the mode by setting /lib/systemd/system/mysql.service

ExecStart=/usr/sbin/mysqld --sql-mode='ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION' 

then reloaded the daemon and the service with

systemctl daemon-reload
systemctl restart mysql