Can't upload, create and delete files and folders

Somehow I am unable to create new folders and upload files to my Nextcloud-instance. It started with my Nextcloud-client (running on Linux/Nixos): I was able to download my files, but newly created folders and files were not uploaded, and the following message was returned Server replied: "503 Service Unavailable" to "MKCOL https://data.timid.nl/remote.php/dav/files/..."

I tried adding a folder in the Nextcloud-UI. That didn’t work either. However, creating a file did work. But if I’m trying to delete the newly created file, it doesn’t work. So I am able to create new files, and not able to: create new folders, upload folders/files and delete files.

Here’s my NCP-report: <details><summary>NextCloudPi diagnostics</summary>NextCloudPi version v1 - Pastebin.com

I think it has something to do with my redis-server, as my nextcloud-logs indicate.
Perhaps anyone in the community here has some pointers on where to check my config.

Things I already tried:

  • Fix permissions (ncp-tool)
  • Scan files (both ncp and ncc)
  • Restart redis/mysql services
  • Checking the redis-logs → nothing weird in there, perhaps even too silent
  • Full reboot (thrice)
  • Manually try to add a folder on the server sudo -u www-data mkdir test → worked
  • redis-cli ping → “Could not connect to Redis at 127.0.0.1:6379: Connection refused” (not sure if that’s even a meaningful way to test Redis’ reachability)

In addition: systemctl status mariadb.service gives me the following result:

nov 07 21:10:13 odroidn2 mariadbd[104093]: 2022-11-07 21:10:13 112 [Warning] Aborted connection 112 to db: 'nextcloud' user: 'ncadmin' host: 'localhost' (Got an error reading communication packets)
nov 07 21:10:13 odroidn2 mariadbd[104093]: 2022-11-07 21:10:13 114 [Warning] Aborted connection 114 to db: 'nextcloud' user: 'ncadmin' host: 'localhost' (Got an error reading communication packets)
nov 07 21:10:13 odroidn2 mariadbd[104093]: 2022-11-07 21:10:13 116 [Warning] Aborted connection 116 to db: 'nextcloud' user: 'ncadmin' host: 'localhost' (Got an error reading communication packets)
nov 07 21:10:13 odroidn2 mariadbd[104093]: 2022-11-07 21:10:13 113 [Warning] Aborted connection 113 to db: 'nextcloud' user: 'ncadmin' host: 'localhost' (Got an error reading communication packets)

Could this issue be related to database-permission-issues?

My Nextcloud-cookbook is also returning 503 server errors. This increases my suspicion for database/mysql-problems

I found this for you. Maybe you can change some MariaDB settings. Also post your settings. When does the error appear? With specific apps? Regularly?

Hi @devnull , thanks for your reply!

I’ll check out the link you provided!

With regards to settings: I see that the 6th of November (the day that my server started acting weird) the following file was modified/created:

/etc/mysql/mariadb.conf.d# cat 91-ncp.cnf 
[mysqld]
transaction_isolation = READ-COMMITTED
innodb_large_prefix=true
innodb_file_per_table=1
innodb_file_format=barracuda

[server]
# innodb settings
skip-name-resolve
innodb_buffer_pool_size = 910173184
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
innodb_log_file_size = 32M

# disable query cache
query_cache_type = 0
query_cache_size = 0

# other
tmp_table_size= 64M
max_heap_table_size= 64M

Perhaps there’s something in here that’s not right

With regards to which apps: for now it is just the “Files”-app and my Cookbook (for the latter, specifically when opening a recipe).
Other apps such as News work perfectly fine

Hmm I also inspected my apache-logs:

Thu Nov 10 20:46:53.320456 2022] [proxy_fcgi:error] [pid 368327:tid 281473212248448] [client 192.168.2.254:49234] AH01067: Failed to read FastCGI header
[Thu Nov 10 20:46:53.320537 2022] [proxy_fcgi:error] [pid 368327:tid 281473212248448] (104)Connection reset by peer: [client 192.168.2.254:49234] AH01075: Error dispatching request to : 
[Thu Nov 10 20:49:41.217404 2022] [proxy_fcgi:error] [pid 368327:tid 281473212248448] [client 192.168.2.254:55554] AH01067: Failed to read FastCGI header
[Thu Nov 10 20:49:41.217535 2022] [proxy_fcgi:error] [pid 368327:tid 281473212248448] (104)Connection reset by peer: [client 192.168.2.254:55554] AH01075: Error dispatching request to :

I expect some PHP-config-error here

Edit:

/var/log# tail -n 4 php8.1-fpm.log
[10-Nov-2022 20:49:41] WARNING: [pool www] child 386617 exited on signal 11 (SIGSEGV) after 3922.771670 seconds from start
[10-Nov-2022 20:49:41] NOTICE: [pool www] child 388961 started
[10-Nov-2022 21:04:57] WARNING: [pool www] child 386604 exited on signal 11 (SIGSEGV) after 4843.190966 seconds from start
[10-Nov-2022 21:04:57] NOTICE: [pool www] child 389559 started

Edit (2):
This file was edited the 5th of November, is this something that came with NCP?

/etc/php/8.1/fpm/pool.d# cat www.conf 
[www]
user = www-data
group = www-data
listen = /run/php/php8.1-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = static
pm.max_children = 6
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.status_path = /status
slowlog = log/$pool.log.slow

Edit (3):
The problem looks very much like described here: linux - php-fpm child process exited on signal 11 - Stack Overflow

My PHP-extensions:

php -r "print_r(get_loaded_extensions());"
Array
(
    [0] => Core
    [1] => date
    [2] => libxml
    [3] => openssl
    [4] => pcre
    [5] => zlib
    [6] => filter
    [7] => hash
    [8] => json
    [9] => pcntl
    [10] => Reflection
    [11] => SPL
    [12] => session
    [13] => standard
    [14] => sodium
    [15] => mysqlnd
    [16] => PDO
    [17] => xml
    [18] => bcmath
    [19] => bz2
    [20] => calendar
    [21] => ctype
    [22] => curl
    [23] => dom
    [24] => mbstring
    [25] => FFI
    [26] => fileinfo
    [27] => ftp
    [28] => gd
    [29] => gettext
    [30] => gmp
    [31] => iconv
    [32] => igbinary
    [33] => intl
    [34] => ldap
    [35] => exif
    [36] => mysqli
    [37] => pdo_mysql
    [38] => Phar
    [39] => posix
    [40] => readline
    [41] => redis
    [42] => shmop
    [43] => SimpleXML
    [44] => sockets
    [45] => sysvmsg
    [46] => sysvsem
    [47] => sysvshm
    [48] => tokenizer
    [49] => xmlreader
    [50] => xmlwriter
    [51] => xsl
    [52] => zip
    [53] => Zend OPcache
)

Alright, I found the magic bullet! In the end it was just a matter of… deleting the “.opcache”-folder :thinking:

After doing so, Apache was satisfied again, and could communicate with its peers like before.

For any future me’s: I found the location of the opcache as follows:

php --ini

This results in a list of all php-modules/extensions/…
Find the line with “opcache”. For me it was /etc/php/8.1/cli/conf.d/10-opcache.ini

Then, print the contents of this file, e.g.:

cat /etc/php/8.1/cli/conf.d/10-opcache.ini

Finally, find the line that says opcache.file_cache=(...). There you have your (probably corrupted) opcache!

I just moved it aside (e.g. mv .opcache opcache123) and reloaded my php-fpm (systemctl restart php8.1-fpm.service)

2 Likes