nextcloud / nextcloud/nextcloudpi
tmpl_php_max_filesize and tmpl_php_threads: command not found when updating to v1.51.0
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 2.9k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
When updating the docker image from 1.49.1 to 1.51.1 I get:
nextcloudpi | Install default configurations for new ncp apps
nextcloudpi | Installing template 'php/opcache.ini.sh'...
nextcloudpi | Installing template 'php/90-ncp.ini.sh'...
nextcloudpi | /usr/local/etc/ncp-templates/php/90-ncp.ini.sh: line 12: tmpl_php_max_filesize: command not found
nextcloudpi | Installing template 'php/pool.d.www.conf.sh'...
nextcloudpi | /usr/local/etc/ncp-templates/php/pool.d.www.conf.sh: line 14: tmpl_php_threads: command not found
nextcloudpi | Installing template 'ncp-metrics.cfg.sh'...
nextcloudpi | Starting PHP-fpm
nextcloudpi | [24-Jan-2023 20:27:48] ERROR: No pool defined. at least one pool section must be specified in config file
nextcloudpi | [24-Jan-2023 20:27:48] ERROR: failed to post process the configuration
nextcloudpi | [24-Jan-2023 20:27:48] ERROR: FPM initialization failed
nextcloudpi | Starting Redis
nextcloudpi | Starting Cron
nextcloudpi | Starting Postfix
nextcloudpi | ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)
nextcloudpi | Back up current instance...
nextcloudpi | Error reading data directory. Is NextCloud running and configured?
nextcloudpi | WARN: Backup creation failed
nextcloudpi | Init done
There could be 3 potential issues:
tmpl_php_max_filesizeandtmpl_php_threadsnot found- php-fpm: No pool defined
- Can't connect to local MySQL server
Let's start from the first one and let's see if that solves the other ones as well.
tmpl_php_max_filesize and tmpl_php_threads are called in 90-ncp.ini.sh and are defined in nc-limits.sh. The two functions have been introduced since here since ncp version 1.50.1 so after the version I'm upgrading from (1.49.1).
The template is loaded in 000ncp. Since it seems that the /data/bin directory contains the old version (1.49.1) of nc-limits.sh without the two functions the piece of code to further examine is the following:
# from 000ncp
# reset bin if we pull a more recent container
[[ -d /data/bin ]] && {
date_img=$(date "+%s" -r /.docker-image)
date_per=$(date "+%s" -r /data/bin)
[[ $date_img -gt $date_per ]] && {
rm -r /data/bin
}
}
persistent_cfg /usr/local/bin /data/bin
I'll add more info if I can.
System information
ncp-report using the image 1.49.1
NextCloudPi version v1.49.1
NextCloudPi image NextCloudPi_docker_09-14-22
OS Debian GNU/Linux 11. 5.4.0-137-generic (x86_64)
automount no
USB devices sde
datadir /ncdata
data in SD no
data filesystem zfs
data disk usage 1.8T/2.8T
rootfs usage 75G/233G
swapfile /swap.img
dbdir /data/database
Nextcloud check ok
Nextcloud version 24.0.3.2
HTTPD service up
PHP service up
MariaDB service up
Redis service up
HPB service down
Postfix service up
Internet check ok
public IP ***REMOVED SENSITIVE VALUE***
public IP ***REMOVED SENSITIVE VALUE***
Port check 80 closed
Port check 443 closed
IP ***REMOVED SENSITIVE VALUE***
Gateway 172.21.0.1
Interface eth0
certificates ***REMOVED SENSITIVE VALUE***
NAT loopback no
Uptime 11days
Nextcloud configuration
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": {
"0": "localhost",
"1": "172.21.0.3",
"5": "nextcloudpi.local",
"7": "nextcloudpi",
"8": "nextcloudpi.lan",
},
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "24.0.3.2",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"memcache.local": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"timeout": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"tempdirectory": "\/ncdata\/tmp",
"mail_smtpmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"jpeg_quality": "75",
"overwriteprotocol": "https",
"maintenance": false,
"loglevel": 0,
"theme": "",
"htaccess.RewriteBase": "\/",
"data-fingerprint": "283cac0d003f865914ce255a227ed0dc",
"versions_retention_obligation": "auto, 90",
"trashbin_retention_obligation": "auto, 30",
"mail_sendmailmode": "smtp",
"twofactor_enforced": "true",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [],
"updater.release.channel": "stable",
"allow_local_remote_servers": "true",
"app_install_overwrite": [
"files_external_dropbox",
"telephoneprovider",
"drawio",
"previewgenerator",
"files_bpm",
"files_3d"
],
"has_rebuilt_cache": true,
"simpleSignUpLink.shown": false,
"preview_max_x": "2048",
"preview_max_y": "2048",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
}
}
HTTPd logs
[Tue Jan 24 20:47:19.628647 2023] [ssl:error] [pid 158:tid 140603377765696] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 36CECA32EBFC894E240B89CB0184FD832F9A104B / notbefore: Sep 14 19:48:37 2022 GMT / notafter: Sep 11 19:48:37 2032 GMT]
[Tue Jan 24 20:47:19.628668 2023] [ssl:error] [pid 158:tid 140603377765696] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Tue Jan 24 20:47:19.640917 2023] [ssl:error] [pid 159:tid 140603377765696] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 36CECA32EBFC894E240B89CB0184FD832F9A104B / notbefore: Sep 14 19:48:37 2022 GMT / notafter: Sep 11 19:48:37 2032 GMT]
[Tue Jan 24 20:47:19.640931 2023] [ssl:error] [pid 159:tid 140603377765696] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Tue Jan 24 20:47:19.643572 2023] [mpm_event:notice] [pid 159:tid 140603377765696] AH00489: Apache/2.4.54 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Tue Jan 24 20:47:19.643604 2023] [core:notice] [pid 159:tid 140603377765696] AH00094: Command line: '/usr/sbin/apache2'
Database logs
tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory
Nextcloud logs
{"reqId":"xmR12NLfp52XUJttFXwJ","level":1,"time":"2023-01-24T21:25:08+01:00","remoteAddr":"","user":"--","app":"passwords","method":"","url":"--","message":"Passwords runs /var/www/nextcloud/occ in global mode","userAgent":"--","version":"24.0.3.2","data":{"app":"passwords"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"carnet","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"carnet"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"extract","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"extract"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"files_mindmap","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"files_mindmap"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"files_readmemd","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"files_readmemd"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"geoblocker","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"geoblocker"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"metadata","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"metadata"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"music","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"music"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"qownnotesapi","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"qownnotesapi"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"socialsharing_diaspora","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"socialsharing_diaspora"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"socialsharing_email","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"socialsharing_email"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"socialsharing_facebook","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"socialsharing_facebook"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"socialsharing_telegram","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"socialsharing_telegram"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"socialsharing_twitter","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"socialsharing_twitter"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:14+01:00","remoteAddr":"","user":"--","app":"video_converter","method":"","url":"--","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"--","version":"24.0.3.2","data":{"app":"video_converter"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:15+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Json","userAgent":"--","version":"24.0.3.2","data":{"app":"news"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:15+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Atom","userAgent":"--","version":"24.0.3.2","data":{"app":"news"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:15+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rss","userAgent":"--","version":"24.0.3.2","data":{"app":"news"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":0,"time":"2023-01-24T21:25:15+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rdf","userAgent":"--","version":"24.0.3.2","data":{"app":"news"}}
{"reqId":"LGwvwG7WNluHDRNqgc56","level":1,"time":"2023-01-24T21:25:15+01:00","remoteAddr":"","user":"--","app":"passwords","method":"","url":"--","message":"Passwords runs /var/www/nextcloud/occ in global mode","userAgent":"--","version":"24.0.3.2","data":{"app":"passwords"}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with build/docker/nextcloudpi/000ncp and trace how persistent_cfg handles /usr/local/bin and /data/bin during an image update. Compare the referenced php/90-ncp.ini.sh and php/pool.d.www.conf.sh templates with nc-limits.sh, focusing on availability of tmpl_php_max_filesize and tmpl_php_threads. Done means the upgrade no longer reports command-not-found errors and PHP-FPM starts with a defined pool.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, shell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100