Error login after updating 10.0.2 --> 10.0.3

Nextcloud version (10.0.2) upgrade to 10.0.3:
Operating system and version (Raspian last version):
Apache version (Apache 2.4.25):
PHP version (5.6):
Is this the first time you’ve seen this error?: YES

Can you reliably replicate it? (If so, please outline steps):

Erreur interne du serveur (internal serveur error)
Le serveur a rencontré une erreur interne et est incapable d'exécuter votre requête.
Veuillez contacter l'administrateur du serveur si cette erreur apparaît plusieurs fois. Veuillez joindre les détails techniques à votre rapport.
Le fichier journal du serveur peut fournir plus de renseignements.
Renseignements techniques
    Adresse distante : 127.0.0.1
    ID de la demande : ldV385AyNgb8O5CbqtGK

The issue you are facing:

I have upgrade nextcloud 10.0.2 to 10.0.3, everything was ok but after I click on the (+) to activate some application in the IHM. I have got this message and I can made anything. I have always this message. I don’t know why.

The output of your Nextcloud log in Admin > Logging: I can’t, but I have this in the nextcloud.log in the data folder.

{"reqId":"ldV385AyNgb8O5CbqtGK","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'INSERT INTO \\\"oc_authtoken\\\"(\\\"uid\\\",\\\"login_name\\\",\\\"password\\\",\\\"name\\\",\\\"token\\\",\\\"type\\\",\\\"remember\\\",\\\"last_activity\\\") VALUES(?,?,?,?,?,?,?,?)' with params [\\\"baimard\\\", \\\"baimard\\\", \\\"f2837cf7f89c7b29e4e4327174d93db8|jyB\\\\\\\/MHweRgdeLK8b|aed95493db75cc488e7f340f2f1316ec1d200f59dcfd9c35fd8f34987ba3388cf1cfcd9cf92702b5cbb0779134a59c4f63d46f64ed8cf4a34c88a24bea0edbc6\\\", \\\"Mozilla\\\\\\\/5.0 (X11; Ubuntu; Linux x86_64; rv:53.0) Gecko\\\\\\\/20100101 Firefox\\\\\\\/53.0\\\", \\\"2bf4e33d2761eb28a2ee0ea12ea8dafd2d6c60f86520fef87791e0fe1e880ae74995471663a4b62bc46fcd05eaa5b67e25a8f61a0a18e37b96c6e9bec008e3ae\\\", 0, 0, 1493710545]:\\n\\nSQLSTATE[HY000]: General error: 11 database disk image is malformed\",\"Code\":0,\"Trace\":\"#0 \\\/mnt\\\/usb\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(128): Doctrine\\\\DBAL\\\\Driver\\\\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/mnt\\\/usb\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Statement.php(178): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOSqlite\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'INSERT INTO \\\"oc...', Array)\\n#2 \\\/mnt\\\/usb\\\/nextcloud\\\/lib\\\/public\\\/AppFramework\\\/Db\\\/Mapper.php(252): Doctrine\\\\DBAL\\\\Statement->execute()\\n#3 \\\/mnt\\\/usb\\\/nextcloud\\\/lib\\\/public\\\/AppFramework\\\/Db\\\/Mapper.php(126): OCP\\\\AppFramework\\\\Db\\\\Mapper->execute('INSERT INTOP…’, Array)\n#4 \/mnt\/usb\/nextcloud\/lib\/private\/Authentication\/Token\/DefaultTokenProvider.php(97): OCP\\AppFramework\\Db\\Mapper->insert(Object(OC\\Authentication\\Token\\DefaultToken))\n#5 \/mnt\/usb\/nextcloud\/lib\/private\/User\/Session.php(566): OC\\Authentication\\Token\\DefaultTokenProvider->generateToken(** sensitive parameters replaced )\n#6 \/mnt\/usb\/nextcloud\/core\/Controller\/LoginController.php(245): OC\\User\\Session->createSessionToken(Object(OC\\AppFramework\\Http\\Request), ‘baimard’, ‘baimard’, ‘’, 0)\n#7 [internal function]: OC\\Core\\Controller\\LoginController->tryLogin( sensitive parameters replaced ***)\n#8 \/mnt\/usb\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(160): call_user_func_array(Array, Array)\n#9 \/mnt\/usb\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(90): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OC\\Core\\Controller\\LoginController), ‘tryLogin’)\n#10 \/mnt\/usb\/nextcloud\/lib\/private\/AppFramework\/App.php(114): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Core\\Controller\\LoginController), ‘tryLogin’)\n#11 \/mnt\/usb\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main(‘LoginController’, ‘tryLogin’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#12 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#13 \/mnt\/usb\/nextcloud\/lib\/private\/Route\/Router.php(299): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#14 \/mnt\/usb\/nextcloud\/lib\/base.php(1010): OC\\Route\\Router->match(’\/login’)\n#15 \/mnt\/usb\/nextcloud\/index.php(40): OC::handleRequest()\n#16 {main}",“File”:"\/mnt\/usb\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractSQLiteDriver.php",“Line”:85}",“level”:3,“time”:“2017-05-02T07:35:45+00:00”,“method”:“POST”,“url”:"/index.php/login?redirect_url=/index.php/apps/files/",“user”:“baimard”,“version”:“11.0.2.7”}`

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' => 
  array (
    0 => '',
    1 => '',
  ),
  'datadirectory' => '/mnt/usb/nextcloud/data',
  'overwrite.cli.url' => 'https://baim.freeboxos.fr',
  'dbtype' => 'sqlite3',
  'version' => '11.0.2.7',
  'logtimezone' => 'UTC',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '587',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_from_address' => '',
  'mail_domain' => 'gmail.com',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'updater.secret' => '',
);

The output of your Apache/system log in /var/log/____:

root@raspserver:/var/log/apache2 # tail error.log
[Tue May 02 06:25:06.968166 2017] [ssl:warn] [pid 1080] AH01906: 127.0.1.1:2443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Tue May 02 06:25:06.968325 2017] [ssl:warn] [pid 1080] AH01909: 127.0.1.1:2443:0 server certificate does NOT include an ID which matches the server name
[Tue May 02 06:25:06.968994 2017] [mpm_prefork:notice] [pid 1080] AH00163: Apache/2.4.10 (Raspbian) OpenSSL/1.0.1t configured -- resuming normal operations
[Tue May 02 06:25:06.969031 2017] [core:notice] [pid 1080] AH00094: Command line: '/usr/sbin/apache2'

:cry:

Hi,

I wasn’t able to use the Web Updater neither (for a while already). What I noticed this weekend was: the updater from the shell
/var/www/nextcloud/updater/updater.phar

shows helpful error messages, while the web updater does not. You could try to run:
sudo -u www-data php /var/www/nextcloud/updater/updater.phar

Follow the instructions in this updater and see if it exits with more understandable error information. (You can post them here of course)

What I stumbled upon was, that no additional files are allow in the nextcloud installation folder. While I’m using the app “External Sites” and placed an HTML file in my installation folder, the updater always fails. So I have to move the additional files out of the folder first. Update runs then successful. Next time I will try that with the Web installer. Maybe it works then as well.

Good luck.

Done … the error message scare me …

Should the "occ upgrade" command be executed? [Y/n] y
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'DROP INDEX authtoken_last_activity_index':

**SQLSTATE[HY000]: General error: 11 database disk image is malformed**
Update failed
Maintenance mode is kept active
Reset log level

Keep maintenance mode active? [y/N] 

I think my case is desperate?

Check your tmp folder for a debug option file for your DB. Maybe:
/tmp/debug_kit.sqlite

If such a file exists, delete it and try the update again. On the Internet it says to delete all under /tmp/
rm /tmp/*

So if you can’t find such a debug file, you can try that.

I think my DB is dead …

root@raspserver:/tmp # ls -la
total 52
drwxrwxrwt 12 root root 4096 mai    2 11:07 .
drwxr-xr-x 22 root root 4096 avril  6 12:11 ..
drwx------  2 pi   pi   4096 mai    1 22:57 dhcpcd-(null)
drwxrwxrwt  2 root root 4096 mai    1 22:57 .font-unix
drwxrwxrwt  2 root root 4096 mai    1 22:57 .ICE-unix
srwxr-xr-x  1 pi   pi      0 mai    1 22:57 .menu-cached-:0-pi
srwxr-xr-x  1 pi   pi      0 mai    1 22:57 .pcmanfm-socket--0-pi
drwx------  2 root root 4096 mai    1 22:57 pulse-2L9K88eMlGn7
drwx------  2 pi   pi   4096 mai    1 22:57 ssh-bsLSgoAE1uQ8
drwx------  2 pi   pi   4096 mai    1 22:57 ssh-oea52jnigzkB
drwx------  3 root root 4096 mai    1 22:57 systemd-private-0802d902ca4e48888c22d3fcbb2bfd00-rtkit-daemon.service-N5aVrE
drwxrwxrwt  2 root root 4096 mai    1 22:57 .Test-unix
-r--r--r--  1 root root   11 mai    1 22:57 .X0-lock
drwxrwxrwt  2 root root 4096 mai    1 22:57 .X11-unix
drwxrwxrwt  2 root root 4096 mai    1 22:57 .XIM-unix
root@raspserver:/tmp # cd ..
root@raspserver:/ # rm /tmp/*
rm: impossible de supprimer « /tmp/dhcpcd-(null) »: est un dossier
rm: impossible de supprimer « /tmp/pulse-2L9K88eMlGn7 »: est un dossier
rm: impossible de supprimer « /tmp/ssh-bsLSgoAE1uQ8 »: est un dossier
rm: impossible de supprimer « /tmp/ssh-oea52jnigzkB »: est un dossier
rm: impossible de supprimer « /tmp/systemd-private-0802d902ca4e48888c22d3fcbb2bfd00-rtkit-daemon.service-N5aVrE »: est un dossier
root@raspserver:/ # rm -r /tmp/*
root@raspserver:/ # sudo -u www-data php /mnt/usb/nextcloud/updater/updater.phar 
Nextcloud Updater - version: 1.0.3

Current version is 11.0.3.

Update to Nextcloud 11.0.3 available. (channel: "stable")
Following file will be downloaded automatically: https://download.nextcloud.com/server/releases/nextcloud-11.0.3.zip

Steps that will be executed:
[✔] Check for expected files
[✔] Check for write permissions
[✔] Enable maintenance mode
[✔] Create backup
[✔] Downloading
[✔] Extracting
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Continue update? [y/N] y

Info: Pressing Ctrl-C will finish the currently running step and then stops the updater.

[✔] Check for expected files
[✔] Check for write permissions
[✔] Enable maintenance mode
[✔] Create backup
[✔] Downloading
[✔] Extracting
[✔] Replace entry points
[✔] Delete old files
[✔] Move new files in place
[✔] Done

Update of code successful.

Should the "occ upgrade" command be executed? [Y/n] y
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'DROP INDEX authtoken_last_activity_index':

SQLSTATE[HY000]: General error: 11 database disk image is malformed
Update failed
Maintenance mode is kept active
Reset log level

Keep maintenance mode active? [y/N] y
Maintenance mode kept active
root@raspserver:/ #

Do you know where the Database File is located ?

(…/nextcloud/data/nextcloud.db ?)

And if it’s possible to transfert data from app calendar to a new instance ? (except if the data is store in the database …)

Hi,

Sorry, I use mysql on my system, so I cannot look on my system for the sqlite3 DB files.
However I guess the DB files have their own folder as defined by sqlite3.

For comparison, my DB files are found in /var/lib/mysql/mysql/ as defined in the mysql config file /etc/mysql/mysql.conf.d/mysqld.cnf