Missing Table After Upgrading from 13.0.0 to 13.01 to 13.06


#1
Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version 13.06:
Operating system and version FreeBSD 12.0-RELEASE-p3:
Apache or nginx version : Apache/2.4.38
PHP version 7.1:

The issue you are facing:
I have been happily running 13.0.0 for some time. That was my original installation. Then I realized I’d gotten a bit behind in updating so I attempted to update via the FreeBSD ports system. Although my goal was to get to version 15, I read and learned I should do only one major version at a time. I also learned some things had changed between 13.0.0 and 13.0.1 so I upgraded to it first instead of straight to version 14. I did not receive any errors when I ran the occ upgrade as my web user. However, after the upgrade, I noticed I received errors when attempting to access the settings menu. I failed to capture the error but it was a SQL error about being unable to access a table.

I thought well I’ll upgrade to 13.0.6 and maybe that will solve it. But this time when trying to run occ upgrade, I get an error about a missing table. This is the output from the CLI:

# su -m www -c "php ./occ upgrade"
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
Updating database schema
Updated database
Updating <oauth2> ...
Doctrine\DBAL\Exception\TableNotFoundException: An exception occurred while executing 'SELECT `class` FROM `oc_admin_settings` WHERE `class` = ? LIMIT 1' with params ["OCA\\OAuth2\\Settings\\Admin"]:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'nextcloud.oc_admin_settings' doesn't exist
Update failed
Maintenance mode is kept active
Reset log level

So I check my database and sure enough, I do not have this table. These are my tables:

root@localhost [nextcloud]> show tables;
+--------------------------------+
| Tables_in_nextcloud            |
+--------------------------------+
| oc_accounts                    |
| oc_activity                    |
| oc_activity_mq                 |
| oc_addressbookchanges          |
| oc_addressbooks                |
| oc_appconfig                   |
| oc_audioplayer_albums          |
| oc_audioplayer_artists         |
| oc_audioplayer_genre           |
| oc_audioplayer_playlist_tracks |
| oc_audioplayer_playlists       |
| oc_audioplayer_stats           |
| oc_audioplayer_streams         |
| oc_audioplayer_tracks          |
| oc_authtoken                   |
| oc_bruteforce_attempts         |
| oc_calendarchanges             |
| oc_calendarobjects             |
| oc_calendarobjects_props       |
| oc_calendars                   |
| oc_calendarsubscriptions       |
| oc_cards                       |
| oc_cards_properties            |
| oc_comments                    |
| oc_comments_read_markers       |
| oc_credentials                 |
| oc_dav_shares                  |
| oc_federated_reshares          |
| oc_file_locks                  |
| oc_filecache                   |
| oc_files_trash                 |
| oc_flow_checks                 |
| oc_flow_operations             |
| oc_group_admin                 |
| oc_group_user                  |
| oc_groups                      |
| oc_jobs                        |
| oc_migrations                  |
| oc_mimetypes                   |
| oc_mounts                      |
| oc_notifications               |
| oc_notifications_pushtokens    |
| oc_oauth2_access_tokens        |
| oc_oauth2_clients              |
| oc_preferences                 |
| oc_privatedata                 |
| oc_properties                  |
| oc_schedulingobjects           |
| oc_share                       |
| oc_share_external              |
| oc_storages                    |
| oc_systemtag                   |
| oc_systemtag_group             |
| oc_systemtag_object_mapping    |
| oc_trusted_servers             |
| oc_twofactor_backupcodes       |
| oc_twofactor_providers         |
| oc_users                       |
| oc_vcategory                   |
| oc_vcategory_to_object         |
| oc_whats_new                   |
+--------------------------------+
61 rows in set (0.00 sec)

So how can I fix this? I’d really appreciate your assistance as my Googling hasn’t turned up any answers that seem to apply to me.

Is this the first time you’ve seen this error? Y:

The output of your Nextcloud log in Admin > Logging:

I can't access Nextcloud.  Is there a log I can paste from the CLI that would be helpful?

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

 # cat config.php
<?php
$CONFIG = array (
  'debug' => 'true',
  'instanceid' => 'removed',
  'passwordsalt' => 'removed',
  'secret' => 'removed',
  'trusted_domains' => 
  array (
    0 => 'removed.com',
  ),
  'datadirectory' => '/usr/local/www/nextcloud/data',
  'overwrite.cli.url' => 'http://removed.com',
  'dbtype' => 'mysql',
  'version' => '13.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'removed',
  'dbpassword' => 'removed',
  'installed' => true,
  'mail_from_address' => 'removed',
  'mail_smtpmode' => 'php',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_domain' => 'removed',
  'appstoreenabled' => false,
  'loglevel' => 0,
  'logtimezone' => 'America/Los_Angeles',
  'maintenance' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.secret' => 'removed',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 => 
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => false,
    ),
  ),
  'theme' => '',
);

#2

There is no oc_admin_settings in Nextcloud 14.0.6, 15.0.2, 15.0.4 .
So somewhere between Nextcloud 13 and 14 it seems it got obsolete. Sorry i can’t help more …

see Upgrade con 13.0.6 auf 14.03 gründlich schief gegangen


#3

Thank you for the information. Based upon what you said, I thought let me try upgrading to 14.0.4. While that worked and I didn’t get an error during occ upgrade, it seems I’ve lost my user info. Here is the output from the web page now when I attempt to access:

## Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

### Technical details

* Remote Address: 172.68.141.224
* Request ID: 3MFJfx2J9v3OUjBxT8Vw
* Type: BadFunctionCallException
* Code: 0
* Message: passwordInvalid is not a valid attribute
* File: /usr/local/www/nextcloud/lib/public/AppFramework/Db/Entity.php
* Line: 115

### Trace

#0 /usr/local/www/nextcloud/lib/public/AppFramework/Db/Entity.php(146): OCP\AppFramework\Db\Entity-&gt;setter('passwordInvalid', Array) #1 /usr/local/www/nextcloud/lib/public/AppFramework/Db/Entity.php(70): OCP\AppFramework\Db\Entity-&gt;__call('setPasswordInva...', Array) #2 /usr/local/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenMapper.php(86): OCP\AppFramework\Db\Entity::fromRow(Array) #3 /usr/local/www/nextcloud/lib/private/Authentication/Token/PublicKeyTokenProvider.php(79): OC\Authentication\Token\PublicKeyTokenMapper-&gt;getToken('1871a5f8df5dff9...') #4 /usr/local/www/nextcloud/lib/private/Authentication/Token/Manager.php(115): OC\Authentication\Token\PublicKeyTokenProvider-&gt;getToken('c9bbad948e9dd54...') #5 /usr/local/www/nextcloud/lib/private/User/Session.php(728): OC\Authentication\Token\Manager-&gt;getToken('c9bbad948e9dd54...') #6 /usr/local/www/nextcloud/lib/private/User/Session.php(260): OC\User\Session-&gt;validateToken('c9bbad948e9dd54...') #7 /usr/local/www/nextcloud/lib/private/User/Session.php(235): OC\User\Session-&gt;validateSession() #8 /usr/local/www/nextcloud/lib/private/L10N/Factory.php(168): OC\User\Session-&gt;getUser() #9 /usr/local/www/nextcloud/lib/private/L10N/Factory.php(127): OC\L10N\Factory-&gt;findLanguage('core') #10 /usr/local/www/nextcloud/lib/private/Server.php(1480): OC\L10N\Factory-&gt;get('core', NULL) #11 /usr/local/www/nextcloud/lib/private/Server.php(224): OC\Server-&gt;getL10N('core') #12 /usr/local/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\Server-&gt;OC\{closure}(Object(OC\Server)) #13 /usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(117): Pimple\Container-&gt;offsetGet('EncryptionManag...') #14 /usr/local/www/nextcloud/lib/private/ServerContainer.php(132): OC\AppFramework\Utility\SimpleContainer-&gt;query('EncryptionManag...') #15 /usr/local/www/nextcloud/lib/private/Server.php(1258): OC\ServerContainer-&gt;query('EncryptionManag...') #16 /usr/local/www/nextcloud/lib/base.php(845): OC\Server-&gt;getEncryptionManager() #17 /usr/local/www/nextcloud/lib/base.php(730): OC::registerEncryptionWrapper() #18 /usr/local/www/nextcloud/lib/base.php(1068): OC::init() #19 /usr/local/www/nextcloud/index.php(40): require_once('/usr/local/www/...') #20 {main}

Thus, it seems I need to figure out how to make at least an admin user so I can access and recreate any missing accounts. The good news for me is that the only account is mine and a few files I’ve shared with passwords. So it shouldn’t be that much to fix once I get my account created. :wink:

I appreciate the help.

Cheers,

Drew


#4

If you have no own backup you will find backups of your former installations in:

data/updater-<something>/backups

without db-tables of course …