Updater deletes config.php while update 10.0.2 to 10.0.3

Steps to reproduce

  1. Upgrade oc from version 10.0.2 to 10.03 from command line (via occ upgrade command)
  2. After updater says that update was done correctly
  3. config/config.php disapears
  4. original config.php was lost, so i used config.php from backup of my older oc installation (9.x)

Expected behaviour

Updater should make some changes in database and oc files, and after that i can enter to system normally.

Actual behaviour

If you go to login page, it promts you to enter database name, user and password like it is a fresh install.

Server configuration

Operating system:
CentOS 7
Web server:
Apache 2.4
Database:
5.5.50-MariaDB
PHP version:
PHP 5.6.31
ownCloud version: (see ownCloud admin page)
10.0.2 to 10.0.3
Updated from an older ownCloud or fresh install:
Updated from older
Where did you install ownCloud from:
from .zip
Signing status (ownCloud 9.0 and above):

can't do that

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'blabl',
  'passwordsalt' => 'blablablablablablablablabla',
  'secret' => 'blablablablablablablablablablablablablablablablablablabla',
  'trusted_domains' => 
  array (
    0 => 'cloud.logos.es',
  ),
  'datadirectory' => '/home/owncloud/data',
  'overwrite.cli.url' => 'https://cloud.logos.es',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '10.0.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'blabla',
  'logtimezone' => 'Europe/Madrid',
  'default_language' => 'es',
  'asset-pipeline.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'has_internet_connection' => true,
  'installed' => true,
  'enable_previews' => true,
  'preview_max_x' => 1024,
  'preview_max_y' => 1024,
  'preview_max_scale_factor' => 10,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'preview_office_cl_parameters' => '',
  'loglevel' => 0,
  'mail_smtpmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'logos.es',
  'mail_smtphost' => 'smtp.logos.es',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'blabla@logos.es',
  'mail_smtppassword' => 'blabla',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'theme' => '',
  'maintenance' => 1,
  'mail_smtpsecure' => 'ssl',
);

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

LDAP configuration (delete this part if not used)

Don't have ldap

Hello,

can you tell me how you tried the upgrade?

Yeah. According documentation - move www folder to www-old, download archive with oc, unpack it to www
copy config.php from www-old to www, after run occ upgrade

There is upgrade log. After that config.php just disapears and if you go to the main cc page it will promt you to enter database data like it is new installation.

# sudo -u apache php occ upgrade -vvv
ownCloud 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
2017-10-09T20:56:13+03:00 Set log level to debug
2017-10-09T20:56:13+03:00 Repair step: Repair MySQL database engine
2017-10-09T20:56:13+03:00 Repair step: Repair MySQL collation
2017-10-09T20:56:13+03:00 Repair info: Change collation for oc_migrations ...
2017-10-09T20:56:13+03:00 Repair step: Repair SQLite autoincrement
2017-10-09T20:56:13+03:00 Repair step: Repair duplicate entries in oc_lucene_status
2017-10-09T20:56:13+03:00 Repair info: lucene_status table does not exist -> nothing to do
2017-10-09T20:56:13+03:00 Repair step: Upgrade app code from the marketplace
2017-10-09T20:56:13+03:00 Repair info: Using market to update existing apps
2017-10-09T20:56:13+03:00 Repair info: Attempting to update the following existing compatible apps from market: 
2017-10-09T20:56:13+03:00 Repair info: Fetching app from market: comments
2017-10-09T20:56:15+03:00 Repair info: App (comments) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: configreport
2017-10-09T20:56:15+03:00 Repair info: App (configreport) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: dav
2017-10-09T20:56:15+03:00 Repair info: App (dav) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: federatedfilesharing
2017-10-09T20:56:15+03:00 Repair info: App (federatedfilesharing) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: federation
2017-10-09T20:56:15+03:00 Repair info: App (federation) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files
2017-10-09T20:56:15+03:00 Repair info: App (files) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files_external
2017-10-09T20:56:15+03:00 Repair info: App (files_external) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files_sharing
2017-10-09T20:56:15+03:00 Repair info: App (files_sharing) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files_trashbin
2017-10-09T20:56:15+03:00 Repair info: App (files_trashbin) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files_versions
2017-10-09T20:56:15+03:00 Repair info: App (files_versions) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: files_videoplayer
2017-10-09T20:56:15+03:00 Repair info: App (files_videoplayer) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: firstrunwizard
2017-10-09T20:56:15+03:00 Repair info: App (firstrunwizard) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: market
2017-10-09T20:56:15+03:00 Repair info: 
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: notifications
2017-10-09T20:56:15+03:00 Repair info: App (notifications) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: provisioning_api
2017-10-09T20:56:15+03:00 Repair info: App (provisioning_api) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: systemtags
2017-10-09T20:56:15+03:00 Repair info: App (systemtags) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: templateeditor
2017-10-09T20:56:15+03:00 Repair info: App (templateeditor) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: Fetching app from market: updatenotification
2017-10-09T20:56:15+03:00 Repair info: App (updatenotification) is not known at the marketplace.
2017-10-09T20:56:15+03:00 Repair info: App was not updated: comments
2017-10-09T20:56:15+03:00 Repair info: App was not updated: configreport
2017-10-09T20:56:15+03:00 Repair info: App was not updated: dav
2017-10-09T20:56:15+03:00 Repair info: App was not updated: federatedfilesharing
2017-10-09T20:56:15+03:00 Repair info: App was not updated: federation
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files_external
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files_sharing
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files_trashbin
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files_versions
2017-10-09T20:56:15+03:00 Repair info: App was not updated: files_videoplayer
2017-10-09T20:56:15+03:00 Repair info: App was not updated: firstrunwizard
2017-10-09T20:56:15+03:00 Repair info: App was not updated: market
2017-10-09T20:56:15+03:00 Repair info: App was not updated: notifications
2017-10-09T20:56:15+03:00 Repair info: App was not updated: provisioning_api
2017-10-09T20:56:15+03:00 Repair info: App was not updated: systemtags
2017-10-09T20:56:15+03:00 Repair info: App was not updated: templateeditor
2017-10-09T20:56:15+03:00 Repair info: App was not updated: updatenotification
2017-10-09T20:56:15+03:00 Updating database schema
2017-10-09T20:56:17+03:00 Updated database
2017-10-09T20:56:17+03:00 Updating <federatedfilesharing> ...
2017-10-09T20:56:18+03:00 Updated <federatedfilesharing> to 0.3.1
2017-10-09T20:56:18+03:00 Updating <market> ...
2017-10-09T20:56:18+03:00 Updated <market> to 0.2.2
2017-10-09T20:56:18+03:00 Updating <dav> ...
2017-10-09T20:56:19+03:00 Updated <dav> to 0.3.0
2017-10-09T20:56:19+03:00 Updating <files_external> ...
2017-10-09T20:56:19+03:00 Updated <files_external> to 0.7.1
2017-10-09T20:56:19+03:00 Updating <files_sharing> ...
2017-10-09T20:56:20+03:00 Updated <files_sharing> to 0.10.1
2017-10-09T20:56:20+03:00 Updating <files_trashbin> ...
2017-10-09T20:56:21+03:00 Updated <files_trashbin> to 0.9.1
2017-10-09T20:56:21+03:00 Updating <notifications> ...
2017-10-09T20:56:22+03:00 Updated <notifications> to 0.3.1
2017-10-09T20:56:22+03:00 Repair step: Repair mime types
2017-10-09T20:56:22+03:00 Repair step: Generate ETags for file where no ETag is present.
2017-10-09T20:56:22+03:00 Repair info: ETags have been fixed for 0 files/folders.
2017-10-09T20:56:22+03:00 Repair step: Clean tags and favorites
2017-10-09T20:56:22+03:00 Repair info: 0 tags of deleted users have been removed.
2017-10-09T20:56:22+03:00 Repair info: 0 tags for delete files have been removed.
2017-10-09T20:56:22+03:00 Repair info: 0 tag entries for deleted tags have been removed.
2017-10-09T20:56:22+03:00 Repair info: 1 tags with no entries have been removed.
2017-10-09T20:56:22+03:00 Repair step: Drop old database tables
2017-10-09T20:56:22+03:00 Drop old database tables
2017-10-09T20:56:22+03:00 
                                                    2017-10-09T20:56:22+03:00  Done
 28/28 [============================] 100%2017-10-09T20:56:22+03:00 
2017-10-09T20:56:22+03:00 Repair step: Drop old background jobs
2017-10-09T20:56:22+03:00 Repair step: Remove getetag entries in properties table
2017-10-09T20:56:22+03:00 Repair info: Removed 0 unneeded "{DAV:}getetag" entries from properties table.
2017-10-09T20:56:22+03:00 Repair step: Repair outdated OCS IDs
2017-10-09T20:56:22+03:00 Repair step: Repair invalid shares
2017-10-09T20:56:22+03:00 Repair step: Remove old share propagation app entries
2017-10-09T20:56:22+03:00 Repair step: Fix permissions so avatars can be stored again
2017-10-09T20:56:22+03:00 Fix permissions so avatars can be stored again
                                                    2017-10-09T20:56:22+03:00  Done
 2/2 [============================] 100%2017-10-09T20:56:22+03:00 
2017-10-09T20:56:22+03:00 Repair step: Move user avatars outside the homes to the new location
2017-10-09T20:56:22+03:00 Repair step: Remove shares of a users root folder
2017-10-09T20:56:22+03:00 Repair step: Repair unmerged shares
2017-10-09T20:56:22+03:00 Starting code integrity check...
2017-10-09T20:56:31+03:00 Finished code integrity check
2017-10-09T20:56:31+03:00 Update successful
2017-10-09T20:56:31+03:00 Maintenance mode is kept active
2017-10-09T20:56:31+03:00 Reset log level

Also if you run occ maintenance:repair config.php desapears.

# sudo -u apache php occ maintenance:repair
ownCloud 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
 - Repair mime types
 - Generate ETags for file where no ETag is present.
     - ETags have been fixed for 0 files/folders.
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 0 tags with no entries have been removed.
 - Drop old database tables
 28/28 [============================] 100%
 - Drop old background jobs
 - Remove getetag entries in properties table
     - Removed 0 unneeded "{DAV:}getetag" entries from properties table.
 - Repair outdated OCS IDs
 - Repair invalid shares
 - Remove old share propagation app entries
 - Fix permissions so avatars can be stored again
 2/2 [============================] 100%
 - Move user avatars outside the homes to the new location
 - Remove shares of a users root folder
 - Repair unmerged shares

Even if copy config.php by hands after upgrade, and run command sudo -u apache php occ maintenance:mode --off config.php desapears anyway :frowning:

Your owncloud is sure a magical place with wizards and unicorns. :sweat_smile:

I will investigate and get back to you on this one

Rename your current ownCloud directory, for example owncloud-old.

The path to owncloud should be /var/www/owncloud/

Have you tried to search for the file? with `find / -name "config.php"?

also you should grant your web user the right permissions

Dima,

You will laugh, but finally after more than 8 hours I found problem. I had no more disk space on hdd where owncloud was stored in. That's it.

Anyway thanks a lot for your answers!

Well I am glad that you did it :slight_smile:

I have never seen something like this and not for that reason.