CONTENTS
Lastmodified 2023-08-25 (金) 08:30:53
MySql 5.7.x
# /usr/local/libexec/mysqld --verbose --help > /dev/null 2019-02-12 08:31:49 0 [Note] /usr/local/libexec/mysqld (mysqld 5.6.43) starting as process 8434 ... 2019-02-12 08:31:49 8434 [Note] Plugin 'FEDERATED' is disabled. 2019-02-12 08:31:49 8434 [Note] Binlog end 2019-02-12 08:31:49 8434 [Note] Shutting down plugin 'MyISAM' 2019-02-12 08:31:49 8434 [Note] Shutting down plugin 'CSV'
PHP7.x と必要な、php7x-* (extensions)
cd /usr/local/www/ unzip nextcloud-14.0.1.zip chown -R www:www nextcloud
以下の様なエラーが短時間に膨大に出て、/var/log/http-access.log が一気に数GB単位で生成されてしまう。httpd のcpuw も上昇してしまう。
[Thu Jan 31 13:53:43.078979 2019] [php7:error] [pid 59707:tid 35255366656] [client 219.117.246.208:63392] PHP Fatal error: Uncaught Doctrine\\DBAL\\DBALException: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1040] Too many connections in /usr/local/www/nextcloud/lib/private/DB/Connection.php:64\nStack trace:\n #0 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect()\n #1 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion()\n #2 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(328): Doctrine\\DBAL\\Connection->detectDatabasePlatform()\n #3 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): Doctrine\\DBAL\\Connection->getDatabasePlatform()\n #4 /usr/local/www/nextcloud/lib/private/DB/Connection.php(151): Doctrine\\DBAL\\Connection->setTransactionIsolation(2)\n #5 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\\DB\\Connection->__construct(Array, Object(Doctr in /usr/local/www/nextcloud/lib/private/DB/Connection.php on line 64
で、
# apachectl restart
すると、一旦落ち着く。
https://help.nextcloud.com/t/nextcloud-13-php-7-1-mysql-8-error-500/34443
[Thu Jan 31 13:54:25.879562 2019] [mpm_worker:notice] [pid 59705:tid 34397577216] AH00295: caught SIGTERM, shutting down [Thu Jan 31 13:54:29.249208 2019] [:notice] [pid 69639:tid 34397577216] mod_python: Creating 8 session mutexes based on 16 max processes and 25 max threads. [Thu Jan 31 13:54:29.249396 2019] [:notice] [pid 69639:tid 34397577216] mod_python: using mutex_directory /tmp [Thu Jan 31 13:54:29.258820 2019] [mpm_worker:notice] [pid 69639:tid 34397577216] AH00292: Apache/2.4.38 (FreeBSD) OpenSSL/1.0.2o-freebsd PHP/7.1.26 SVN/1.11.1 mod_python/3.5.0 Python/2.7.15 configured -- resuming normal operations [Thu Jan 31 13:54:29.258898 2019] [core:notice] [pid 69639:tid 34397577216] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT' [Thu Jan 31 13:54:54.734583 2019] [php7:notice] [pid 69642:tid 35255478272] [client 210.255.122.209:61772] {"reqId":"hogehgeofugagugaaaaa","level":3,"time":"2019-01-31T04:54:54+00:00", "remoteAddr":"210.255.122.209","user":"kuji","app":"PHP","method":"GET","url":"\\/nextcloud\\/remote.php\\/dav\\/avatars\\/kuji\\/128.png","message":"imagepng() expects parameter 1 to be resource, boolean given at \\/usr\\/local\\/www\\/nextcloud\\/apps\\/dav\\/lib\\/Avatars\\/AvatarNode.php#66", "userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.5.1final (build 20181204) (Nextcloud)","version":"15.0.2.0"} [Thu Jan 31 13:54:54.760578 2019] [php7:notice] [pid 69642:tid 35255478272] [client 210.255.122.209:61772] {"reqId":"hogehgeofugagugaaaaa","level":3,"time":"2019-01-31T04:54:54+00:00","remoteAddr":"210.255.122.209","user":"kuji","app":"PHP","method":"GET","url":"\\/nextcloud\\/remote.php\\/dav\\/avatars\\/kuji\\/128.png","message":"chmod(): Operation not permitted at \\/usr\\/local\\/www\\/nextcloud\\/lib\\/private\\/Log\\/File.php#141","userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.5.1final (build 20181204) (Nextcloud)","version":"15.0.2.0"}
/usr/bin/su -m www -c "php /usr/local/www/nextcloud/occ upgrade"
したら、黄色い文字で
Nextcloud is in maintenance mode - no apps have been loaded <warning>Nextcloud is in maintenance mode</warning> Maybe an upgrade is already in process. Please check the logfile (data/nextcloud.log). If you want to re-run the upgrade procedure, remove the "maintenance mode" from config.php and call this script again.
Nextcloud は、ports にもあるが、手動インストールしたので、必要なライブラリが、削除されたようだ。
# portinstall devel/pecl-APCu
で、復旧した。
因みにログの最後ブロックに、
"message":{"Exception":"OC\\HintException","Message":"Memcache \\OC\\Memcache\\APCu not available for local cache"
の文字列を発見して、原因にたどり着いた。ふぅ~
他に、/usr/ports/www/nextcloud/Makefile に出てくるports もインストールしておいた。
894 12:36 portinstall graphics/pecl-imagick -m "DISABLE_VULNERABILITIES=yes" --batch 895 12:46 portinstall databases/pecl-redis --batch 896 12:48 portinstall net/pecl-smbclient --batch 897 13:20 portinstall devel/pecl-APCu --batch
# portinstall devel/pecl-APCu
/usr/local/www/nextcloud/config/config.php
'maintenance' => false, 'memcache.local' => '\\OC\\Memcache\\APCu', ←この行追加 'updater.secret' => '$2y$10$bKv9D................ );
/usr/local/www/nextcloud/data
total 117047840 -rw-r--r-- 1 www www 324 Sep 12 06:18 .htaccess -rw-r--r-- 1 www www 0 Sep 12 06:18 .ocdata drwxr-xr-x 4 www www 512 Sep 17 15:53 USR1/ drwxr-xr-x 10 www www 512 Sep 17 15:34 appdata_oci90hzxwqre/ drwxr-xr-x 5 www www 512 Mar 10 2018 appdata_ocm43l8nn4gu/ drwxr-xr-x 10 www www 512 Oct 19 2017 appdata_ocyn1r792jyd/ drwxr-xr-x 2 www www 512 Sep 12 06:19 files_external/ drwxr-xr-x 4 www www 512 Sep 17 21:02 foo/ -rw-r--r-- 1 www www 0 Sep 12 06:18 index.html drwxr-xr-x 7 www www 512 Sep 28 11:25 Mydata/ -rw-r----- 1 www www 119811864566 Sep 28 10:56 nextcloud.log -rw-r--r-- 1 www www 15761408 Mar 10 2018 owncloud.db # rm nextcloud.log # touch nextcloud.log # df -h Filesystem Size Used Avail Capacity Mounted on /dev/ada0s1a 899G 548G 279G 66% / devfs 1.0K 1.0K 0B 100% /dev
ふと気付いたら119 GB にもなっていたので、
/usr/local/etc/newsyslog.conf.d/nextcloud.conf
# configuration file for newsyslog for necxtcloud # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /usr/local/www/nextcloud/data/nextcloud.log 644 12 * @01T05 Z
/usr/local/www/nextcloud/data/nextcloud.log
Nextcloud Install 画面からの遷移で、
このページは動作していません Server_Name でリダイレクトが繰り返し行われました。 Cookie を消去してみてください. ERR_TOO_MANY_REDIRECTS
となる。
/usr/local/www/nextcloud/data/nextcloud.log
You are using a fallback implementation of the intl extension. Installing the native one is highly recommended instead. at \/usr\/local\/www\/nextcloud\/3rdparty\/patchwork\/utf8\/src\/Patchwork\/Utf8\/Bootup\/intl.php#18", "userAgent":"Mozilla\/5.0 (Windows NT 6.1; WOW64; Trident\/7.0; rv:11.0) like Gecko","version":"14.0.1.1"}
とのことなので、/usr/ports/lang/php71-extensions の makeconfig でチェックして、インストールする。
php71-intl
Nextcloud を SV & CL で運用していて、CLで同期エラーがでる。
Server replied: service unavailable - operation cancelled
という赤いバックに白文字のエラーが出て、そのファイル以後が同期されなくなる。と言う現象に遭遇。
この現象が出るのはWindows10のクライエントで、Windows7のクライエントはエラーなく同期している。
Windows10側の端末であれこれエラー回避操作してみるが、一向に治まる気配はなく、いつも同じファイルでエラーしてしまう。
【回避策】 回避策として好奏したのは、
と、いったもので、取り敢えずは復活。
ひょっとすると、同期ディレクトリルートにある、
._sync_8a7ff09e8109.db
などの、nextcloud関連のドットファイルをいれかえるだけでも良いかも知れない。
/var/log/httpd-error.log
[Fri Nov 30 11:15:34.924252 2018] [php7:error] [pid 921:tid 35001720320] [client 210.255.122.209:63954] PHP Fatal error: Uncaught Error: Call to undefined method PDO::getAttribute() in /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:68\nStack trace: \n#0 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(436): Doctrine\\DBAL\\Driver\\PDOConnection->getServerVersion() \n#1 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBAL\\Connection->getDatabasePlatformVersion() \n#2 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(364): Doctrine\\DBAL\\Connection->detectDatabasePlatform() \n#3 /usr/local/www/nextcloud/lib/private/DB/ReconnectWrapper.php(43): Doctrine\\DBAL\\Connection->connect()\n#4 /usr/local/www/nextcloud/lib/private/DB/Connection.php(61): OC\\DB\\ReconnectWrapper->connect()\n#5 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(429): OC\\DB\\Connection->connect() \n#6 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(389): Doctrine\\DBA in /usr/local/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 68
428 11:24 cd /usr/ports/lang/php71-extensions 429 11:24 make install 430 11:24 make config 431 11:25 make install 432 11:30 apachectl restart 433 11:30 tail -100 /var/log/httpd-error.log
Total access 4989:本日 2:昨日 0