Nextcloud Upload/sync fails randomly

Hi Everyone

Nextcloud 28, ubuntu 20
Webserver: Apache

I am facing issues randomly my upload from webUI and sync from client fail randomly. Then i have to run command service apache2 restart. After this command all works well till a week then again upload starts fails. When this issue occurs, i cannot upload a file of 1KB. And editing in document could not be saved with a single word. Then i have to restart apache.

Size of file does not matter, in php.ini i have defined 4 gb upload limit.

Check your Apache error log for hints about what is going on.

For that matter, also your Nextcloud log.

Also, are you using mod_php or php-fpm?

its mod_php

Hi i have checked error_log of apache, it says it cannot write temporary files. Permissions issues.

Where temporary files are saved while uploading? But for a week all remains smooth and after a week this issues repeats.

Please post the actual error message / log entry.

Wed Aug 07 03:49:53.880806 2024] [php:warn] [pid 3908101] [client 192.168.0.200:20294] PHP Warning: Unknown: POST data can’t be buffered; all data discarded in Unknown on line 0
[Wed Aug 07 03:50:32.260084 2024] [php:warn] [pid 3905455] [client 192.168.0.200:58551] PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
[Wed Aug 07 03:50:32.260179 2024] [php:warn] [pid 3905455] [client 192.168.0.200:58551] PHP Warning: Unknown: POST data can’t be buffered; all data discarded in Unknown on line 0
[Wed Aug 07 03:51:24.332886 2024] [php:warn] [pid 3908123] [client 192.168.0.200:49388] PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
[Wed Aug 07 03:51:24.333058 2024] [php:warn] [pid 3908123] [client 192.168.0.200:49388] PHP Warning: Unknown: POST data can’t be buffered; all data discarded in Unknown on line 0
[Wed Aug 07 03:51:38.874081 2024] [php:warn] [pid 3908107] [client 192.168.0.200:15471] PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
[Wed Aug 07 03:51:38.874224 2024] [php:warn] [pid 3908107] [client 192.168.0.200:15471] PHP Warning: Unknown: POST data can’t be buffered; all data discarded in Unknown on line 0
[Wed Aug 07 03:52:38.864040 2024] [php:warn] [pid 3905455] [client 192.168.0.200:46423] PHP Warning: Unknown: Unable to create temporary file, Check permissions in temporary files directory. in Unknown on line 0
[Wed Aug 07 03:52:38.864129 2024] [php:warn] [pid 3905455] [client 192.168.0.200:46423] PHP Warning: Unknown: POST data can’t be buffered; all data discarded in Unknown on line 0
[Wed Aug 07 04:00:56.918212 2024] [mpm_prefork:notice] [pid 3728712] AH00169: caught SIGTERM, shutting down

‘tempdirectory’ => ‘/mnt/data/tempfiles’, in config.php

drwxrwxr-x+ 2 www-data www-data 0 Aug 7 13:46 tempfiles

i have recently added in php.ini

upload_tmp_dir = /mnt/data/tempfiles

will it help?

Also this data directory mounted it with this command

mount -t cifs //192.168.0.x/nextcloud /mnt/data -o username=nextcloud,password=“pass”,uid=33,gid=33,forceuid,forcegid,file_mode=0770,dir_mode=0770,vers=1.0

then i create tempfiles directory inside /mnt/data/tempfiles,

can it be a problem?