#author("2023-08-25T08:28:59+09:00","default:kuji","kuji")
#author("2023-08-25T08:30:53+09:00","default:kuji","kuji")
CONTENTS
#contents
----
Lastmodified &lastmod;
----

 Allowed memory size of 4294967296 bytes exhausted (tried to allocate 4294971392 bytes) in Unknown on line 0

https://nextcloud.com/

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

* DB 接続エラーがでる [#g570d3f7]

以下の様なエラーが短時間に膨大に出て、/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"}




* web update 中に[#d50f5cb2]
 /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.
* sun1:: pkg autoremove したら、 [#h3432037]

 Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /usr/local/www/nextcloud/lib/private/DB/Connection.php:140
 Stack trace:
 #0 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
 #1 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1029): Doctrine\DBAL\Connection->getWrappedConnection()
 #2 /usr/local/www/nextcloud/lib/private/DB/Connection.php(262): Doctrine\DBAL\Connection->executeQuery('SELECT * FROM `...', Array, Array, NULL)
 #3 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(345): OC\DB\Connection->executeQuery('SELECT * FROM `...', Array, Array)
 #4 /usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(280): Doctrine\DBAL\Query\QueryBuilder->execute()
 #5 /usr/local/www/nextcloud/lib/private/AppConfig.php(418): OC\DB\QueryBuilder\QueryBuilder->execute()
 #6 /usr/local/www/nextcloud/lib/private/AppConfig.php(184): OC\AppConfig->loadConfigValues()
 #7 /usr/local/www/nextcloud/lib/private/AppConfig.php(374): OC\AppConfig->getApps()
 #8 /usr/local/www/nextcloud/lib/private/legacy/OC_App.php(803): OC\AppConfig->getValues(false, 'installed_versi...')
 #9 /usr/local/www/nextcloud/lib/private/Server.php(733): OC_App::getAppVersions()
 #10 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}(Object(OC\Server))
 #11 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
 #12 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet('OC\\Memcache\\Fac...')
 #13 /usr/local/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query('OC\\Memcache\\Fac...', true)
 #14 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query('OC\\Memcache\\Fac...')
 #15 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(193): OC\AppFramework\Utility\SimpleContainer->get('OC\\Memcache\\Fac...')
 #16 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(OC\Server))
 #17 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
 #18 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet('OCP\\ICacheFacto...')
 #19 /usr/local/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query('OCP\\ICacheFacto...', true)
 #20 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query('OCP\\ICacheFacto...')
 #21 /usr/local/www/nextcloud/lib/private/Server.php(1115): OC\AppFramework\Utility\SimpleContainer->get('OCP\\ICacheFacto...')
 #22 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}(Object(OC\Server))
 #23 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
 #24 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet('OCP\\Lock\\ILocki...')
 #25 /usr/local/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query('OCP\\Lock\\ILocki...', true)
 #26 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query('OCP\\Lock\\ILocki...')
 #27 /usr/local/www/nextcloud/lib/private/Server.php(2067): OC\AppFramework\Utility\SimpleContainer->get('OCP\\Lock\\ILocki...')
 #28 /usr/local/www/nextcloud/lib/private/Files/View.php(106): OC\Server->getLockingProvider()
 #29 /usr/local/www/nextcloud/lib/private/Server.php(467): OC\Files\View->__construct()
 #30 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(171): OC\Server->OC\{closure}(Object(OC\Server))
 #31 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(122): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}(Object(Pimple\Container))
 #32 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(138): Pimple\Container->offsetGet('OC\\Files\\Node\\H...')
 #33 /usr/local/www/nextcloud/lib/private/ServerContainer.php(171): OC\AppFramework\Utility\SimpleContainer->query('OC\\Files\\Node\\H...', true)
 #34 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(65): OC\ServerContainer->query('OC\\Files\\Node\\H...')
 #35 /usr/local/www/nextcloud/lib/private/Server.php(1469): OC\AppFramework\Utility\SimpleContainer->get('OC\\Files\\Node\\H...')
 #36 /usr/local/www/nextcloud/lib/base.php(638): OC\Server->boot()
 #37 /usr/local/www/nextcloud/lib/base.php(1180): OC::init()
 #38 /usr/local/www/nextcloud/cron.php(43): require_once('/usr/local/www/...')
 #39 {main}
と言うエラー

 portinstall lang/php81-extensions

で復旧

 php81-pdo_dblib-8.1.22         The pdo_dblib shared extension for php
 php81-pdo_firebird-8.1.22      The pdo_firebird shared extension for php
 php81-pdo_mysql-8.1.22         The pdo_mysql shared extension for php
 php81-pdo_odbc-8.1.22          The pdo_odbc shared extension for php
 php81-pdo_pgsql-8.1.22         The pdo_pgsql shared extension for php
あたりが、消えていた模様
* G7:: pkg autoremove したら、Nextcloud が Internal Server Error 500 [#xdaee355]

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





*pecl-APCu [#x08e37a1]
 # portinstall devel/pecl-APCu


/usr/local/www/nextcloud/config/config.php

  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',     ←この行追加
  'updater.secret' => '$2y$10$bKv9D................
 );


*nextcloud.log が巨大な件 [#d8cfbd37]

/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


*ERR_TOO_MANY_REDIRECTS [#zbedb02c]

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

*Server replied: service unavailable - operation cancelled [#bc1f6609]

Nextcloud を SV & CL で運用していて、CLで同期エラーがでる。

 Server replied: service unavailable - operation cancelled

という赤いバックに白文字のエラーが出て、そのファイル以後が同期されなくなる。と言う現象に遭遇。

この現象が出るのはWindows10のクライエントで、Windows7のクライエントはエラーなく同期している。

Windows10側の端末であれこれエラー回避操作してみるが、一向に治まる気配はなく、いつも同じファイルでエラーしてしまう。

【回避策】
回避策として好奏したのは、

+エラーの出ていない端末で、バックグラウンドジョブとして動いているnextcloudプロセスを一旦停止。
+そのディレクトリをそっくり外付けSSDなどへコピー。
+エラーする端末で、コピーしたディレクトリを書き込んで、サーバと同期設定をする。
+差分ではなく全ファイルをチェックするためか、初回のスキャンには相当な時間がかかるが、エラーも消える。

と、いったもので、取り敢えずは復活。

%%ひょっとすると、同期ディレクトリルートにある、%%

 ._sync_8a7ff09e8109.db

%%などの、nextcloud関連のドットファイルをいれかえるだけでも良いかも知れない。%%

*php71-extensions が腐ったら [#v858a045]

/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 &counter(total);:本日 &counter(today);:昨日 &counter(yesterday);
#counter([total|today|yesterday]);

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS