Files with apostrophe ' in their filename cause php-fpm to hang at 100% CPU load

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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, 12.0.2):
Operating system and version (eg, Ubuntu 17.04):
FreeBSD 11.2
Apache or nginx version (eg, Apache 2.4.25):
nginx 1.14.0
PHP version (eg, 7.1):

The issue you are facing:

When I try to upload a file (with the desktop client) whose filename contains an apostrophe ' the php-fpm processes start to hang at 100% CPU load until I manually restart the service.

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

Steps to replicate it:

  1. Try to upload this image as Betty’s Bay, SA 1920x1080.jpg

The output of your Nextcloud log in Admin > Logging:

  • nothing revelant in the nextcloud logs

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

$CONFIG = array (
  'instanceid' => 'something',
  'passwordsalt' => 'somethingsomething',
  'secret' => 'somethingsomethingsomething',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/mnt/storagebox/nextclouddata',
  'overwrite.cli.url' => '',
  'dbtype' => 'pgsql',
  'version' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'installed' => true,
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
  'mail_from_address' => 'something',
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => '',
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'integrity.check.disabled' => true,

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

  • nothing useful in php-fpm.log or the nginx logs :frowning:

I am using the nginx webroot settings from here:

I am wondering if this is an issue with my nginx/php-fpm config and not a Nextcloud bug? :thinking: Aside from the usual file size uploading hickups I had no big issues until I tried to upload some files with apostrophe in their names.

Does this happen only with files with apostrophes, or any other special characters as well?