Nextcloud update to 21.0

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
I tried to update nextcloud from 20.0.8 to 21.0 via the GUI by clicking on update. I also checked the box "Update Jail as well".
After the update I tried to open the webpage of nextcloud and received the following message:
Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Any suggestions how to fix this error?
I hope I can do more than reinstall the plugin. Don't want to the all the settings again.
 
Joined
Jan 7, 2015
Messages
1,150
Is the jail started and running?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
What's in the web server logs with respect to that internal error? Should give you more information about the fundamental problem.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,975
With nextcloud being available as a package I don't know why anyone would use the plugin.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Is the jail started and running?
Jail is started and running.

What's in the web server logs with respect to that internal error?
/mnt/VirtualMachine/iocage/jails/nextcloud/root/var/log/nginx/error.log
Code:
2021/02/28 01:00:00 [error] 33176#102280: *6 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /usr/local/www/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /usr/local/www/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery()
#3 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(286): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /usr/local/www/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /usr/local/www/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig-" while reading response header from upstream, client: 192.168.1.1, server: _, request: "GET /ocs/v1.php/cloud/user HTTP/1.1", upstream: "fastcgi://unix:/var/run/nextcloud-php-fpm.sock:", host: "192.168.1.18"

This is the only thing I found in the logs. Where else are logs stored?

I don't know why anyone would use the plugin.
Because it's easy to use and as official supported plugin I expect that everything is running smooth.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
My experience of plugins is that they are more likely to break when updating than a jail you've created yourself. The roll-your-own approach also gives you some understanding of how things work and are configured, so if/when they do break you have a much better chance of fixing them.

My Nextcloud jail updated to 21 without any issues, not that that helps you!

What version of PHP is the plugin using?
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
php is running in version 7.4
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Your Nextcloud cannot connect to the database. You can look in php-fpm.log if there are more errors. Possibly php74-mysqli package or something similar is missing.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
so in php-fpm.log is nothing pointing to further errors.
Code:
[10-Feb-2021 11:08:05] NOTICE: fpm is running, pid 3048
[10-Feb-2021 11:08:05] NOTICE: ready to handle connections
[27-Feb-2021 22:52:51] NOTICE: Finishing ...
[27-Feb-2021 22:52:51] NOTICE: exiting, bye-bye!
[27-Feb-2021 22:52:56] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

[27-Feb-2021 22:52:56] NOTICE: fpm is running, pid 31041
[27-Feb-2021 22:52:56] NOTICE: ready to handle connections
[27-Feb-2021 22:57:15] NOTICE: Finishing ...
[27-Feb-2021 22:57:15] NOTICE: exiting, bye-bye!
[27-Feb-2021 22:57:20] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

[27-Feb-2021 22:57:20] NOTICE: fpm is running, pid 33159
[27-Feb-2021 22:57:20] NOTICE: ready to handle connections
[28-Feb-2021 10:36:41] NOTICE: Terminating ...
[28-Feb-2021 10:36:41] NOTICE: exiting, bye-bye!
[28-Feb-2021 10:38:20] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

[28-Feb-2021 10:38:20] NOTICE: fpm is running, pid 75010
[28-Feb-2021 10:38:20] NOTICE: ready to handle connections


So here is a list with all installed packages related to php.
Code:
perl5-5.32.1_1                 Practical Extraction and Report Language
php74-7.4.15                   PHP Scripting Language
php74-bcmath-7.4.15            The bcmath shared extension for php
php74-bz2-7.4.15               The bz2 shared extension for php
php74-ctype-7.4.15             The ctype shared extension for php
php74-curl-7.4.15              The curl shared extension for php
php74-dom-7.4.15               The dom shared extension for php
php74-exif-7.4.15              The exif shared extension for php
php74-fileinfo-7.4.15          The fileinfo shared extension for php
php74-filter-7.4.15            The filter shared extension for php
php74-gd-7.4.15                The gd shared extension for php
php74-gmp-7.4.15               The gmp shared extension for php
php74-iconv-7.4.15             The iconv shared extension for php
php74-intl-7.4.15              The intl shared extension for php
php74-json-7.4.15              The json shared extension for php
php74-ldap-7.4.15              The ldap shared extension for php
php74-mbstring-7.4.15          The mbstring shared extension for php
php74-opcache-7.4.15           The opcache shared extension for php
php74-openssl-7.4.15           The openssl shared extension for php
php74-pdo-7.4.15               The pdo shared extension for php
php74-pdo_mysql-7.4.15         The pdo_mysql shared extension for php
php74-pecl-APCu-5.1.19         APC User Caching
php74-pecl-imagick-im7-3.4.4_2 PHP wrapper to the ImageMagick/GraphicsMagick library version 7
php74-posix-7.4.15             The posix shared extension for php
php74-session-7.4.15           The session shared extension for php
php74-simplexml-7.4.15         The simplexml shared extension for php
php74-xml-7.4.15               The xml shared extension for php
php74-xmlreader-7.4.15         The xmlreader shared extension for php
php74-xmlwriter-7.4.15         The xmlwriter shared extension for php
php74-xsl-7.4.15               The xsl shared extension for php
php74-zip-7.4.15               The zip shared extension for php
php74-zlib-7.4.15              The zlib shared extension for php
pkg-1.16.3                     Package manager


don't know if something is missing. only thing what I can say is, that I have not deleted any package.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Can you try to find if the occ command can do a sanity check of your installation? If you invoke it without a parameter, it prints a large (and complete) usage overview.

cd /usr/local/www/nextcloud && su -m www -c "/usr/local/bin/php occ"

And of course you did the necessary occ upgrade, didn't you?

cd /usr/local/www/nextcloud && su -m www -c "/usr/local/bin/php occ upgrade"

BTW - I just update my own Nextcloud: nextcloud-php74: 20.0.7 -> 21.0.0. Worked like a charm as always. I did upgrade my MySQL database from 5.7 to 8.0 in the process. If you did that, too, your MySQL server might abort startup due to removed options. You might want to check the status of your database server, too.

service mysql-server status

if it is not running, try to start it:

service mysql-server start

If it is still not running, look in /var/db/mysql/<your jail hostname>.err.
 
Last edited:

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Can you try to find if the occ command can do a sanity check of your installation? If you invoke it without a parameter, it prints a large (and complete) usage overview.

cd /usr/local/www/nextcloud && su -m www -c "/usr/local/bin/php occ"
Here is the output:
Code:
root@nextcloud:~ # cd /usr/local/www/nextcloud && su -m www -c "/usr/local/bin/php occ"
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /usr/local/www/nextcloud/lib/private/DB/Connection.php:85
Stack trace:
#0 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /usr/local/www/nextcloud/lib/private/DB/Connection.php(226): Doctrine\DBAL\Connection->executeQuery()
#3 /usr/local/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /usr/local/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(286): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /usr/local/www/nextcloud/lib/private/AppConfig.php(345): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /usr/local/www/nextcloud/lib/private/AppConfig.php(110): OC\AppConfig->loadConfigValues()
#7 /usr/local/www/nextcloud/lib/private/AppConfig.php(301): OC\AppConfig->getApps()
#8 /usr/local/www/nextcloud/lib/private/legacy/OC_App.php(957): OC\AppConfig->getValues()
#9 /usr/local/www/nextcloud/lib/private/Server.php(678): OC_App::getAppVersions()
#10 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#11 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#13 /usr/local/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#14 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#15 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(177): OC\AppFramework\Utility\SimpleContainer->get()
#16 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#19 /usr/local/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#20 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#21 /usr/local/www/nextcloud/lib/private/Server.php(1018): OC\AppFramework\Utility\SimpleContainer->get()
#22 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#23 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#25 /usr/local/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#26 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#27 /usr/local/www/nextcloud/lib/private/Server.php(1977): OC\AppFramework\Utility\SimpleContainer->get()
#28 /usr/local/www/nextcloud/lib/private/Files/View.php(119): OC\Server->getLockingProvider()
#29 /usr/local/www/nextcloud/lib/private/Server.php(426): OC\Files\View->__construct()
#30 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(155): OC\Server->OC\{closure}()
#31 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(122): Pimple\Container->offsetGet()
#33 /usr/local/www/nextcloud/lib/private/ServerContainer.php(137): OC\AppFramework\Utility\SimpleContainer->query()
#34 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#35 /usr/local/www/nextcloud/lib/private/Server.php(1340): OC\AppFramework\Utility\SimpleContainer->get()
#36 /usr/local/www/nextcloud/lib/base.php(588): OC\Server->boot()
#37 /usr/local/www/nextcloud/lib/base.php(1076): OC::init()
#38 /usr/local/www/nextcloud/console.php(49): require_once('/usr/local/www/...')
#39 /usr/local/www/nextcloud/occ(11): require_once('/usr/local/www/...')
#40 {main}root@nextcloud:/usr/local/www/nextcloud # 


And of course you did the necessary occ upgrade, didn't you?
I did the update via the plugin GUI within TrueNAS, so I hope the plugin did the occ upgrade manually.

If it is still not running, look in /var/db/mysql/<your jail hostname>.err.
Code:
2021-02-28 19:57:52 0x80236c000  InnoDB: Assertion failure in thread 34396880896 in file ut0ut.cc line 921
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
18:57:52 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=268435456
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 322098 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000
0x14477e8 <my_print_stacktrace+0x38> at /usr/local/libexec/mysqld
0x13a358e <handle_fatal_signal+0x2be> at /usr/local/libexec/mysqld
0x801df53c0 <_pthread_sigmask+0x530> at /lib/libthr.so.3
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
2021-02-28T18:57:52.6NZ mysqld_safe mysqld from pid file /var/db/mysql/nextcloud.pid ended

This is the result of my last trie to start mysql manually.
 
Last edited:

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Some important Nextcloud information:
Nextcloud has A TON of required packages, like: The most of ANY TrueNAS plugin.

However: They only break compatibility on Major version increases (for example 20.0.6->21.0.0, Major.Minor,Patch), somewhat in accordance with semantic versioning.

Which means: When you update Nextcloud to a new major version from the commandline, it also requires you to check all packages if they need changes. This is something the Nextcloud updater does NOT do for you. (thats also why scripts like the one from @danb35 always take a little while to be updated to a new major version.)
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
BTW - I just update my own Nextcloud: nextcloud-php74: 20.0.7 -> 21.0.0. Worked like a charm as always. I did upgrade my MySQL database from 5.7 to 8.0 in the process. If you did that, too, your MySQL server might abort startup due to removed options. You might want to check the status of your database server, too.
How have you installed nexcloud, via plugin or manually in a jail?
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Which means: When you update Nextcloud to a new major version from the commandline, it also requires you to check all packages if they need changes. This is something the Nextcloud updater does NOT do for you. (thats also why scripts like the one from @danb35 always take a little while to be updated to a new major version.)
I did not update via the command line. I updated via the GUI of TrueNAS within the plugin chapter. OK at the end it will also run in the command line, but I expect that the automatism of the update process will take care of that.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
I did not update via the command line. I updated via the GUI of TrueNAS within the plugin chapter. OK at the end it will also run in the command line, but I expect that the automatism of the update process will take care of that.
Ahh, I misunderstood you, I thought you meant updated from the Nextcloud GUI.
Well in that case, you're right: you should be able to expect it to work 100%
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory in /usr/local/www/nextcloud/lib/private/DB/Connection.php:85
Your database is probably not running.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Thanks for all your suggestions how to fix that problem. I gave up!
I used now the easy way and installed nexcloud plugin completely new.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
...until the next time it breaks :rolleyes:
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
That's true. I will have a look to some tutorials how to install nextcloud manually.
 
Top