How to repair damaged config.php

Ask all your questions regarding OC 8.0 and 8.1 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: How to repair damaged config.php

Postby tflidd » Sun Jul 19, 2015 6:06 pm

In mysql, you have to flush privileges after changes in the user-db (or restart the db server). Maybe you need to do the same for Postgres. But as long as you can't login to your database from your terminal, it's no owncloud problem :lol:

There should be plenty of tips in the web. Logfiles are always helpful (also for database servers).

rvanhouten
Beginner
Posts: 16
Joined: Fri Jul 10, 2015 9:47 am
ownCloud version: 8.0.4
Webserver: nginx
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Re: How to repair damaged config.php

Postby rvanhouten » Sun Jul 19, 2015 8:30 pm

Update:
From the command line (via psql) I can now login as user 'oc_admin' to database 'owncloud'. Do all kinds of queries. Runs fine. So from a db perspective, all is good (or so it seems at least).

When I run 'sudo -u www-data php occ -V' it crashes with following msg:
    An unhandled exception has been thrown:
    exception 'Doctrine\DBAL\DBALException' with message 'An exception occured in driver: SQLSTATE[08006] [7] FATAL: password authentication failed for user "oc_admin"
    FATAL: password authentication failed for user "oc_admin"' in /var/www/owncloud/lib/private/db/connection.php:33

In config.php it says 'dbuser' => 'oc_admin' and 'dbpassword' => '...ciwuyef98y9y8388...' .

To be continued...

rvanhouten
Beginner
Posts: 16
Joined: Fri Jul 10, 2015 9:47 am
ownCloud version: 8.0.4
Webserver: nginx
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Re: How to repair damaged config.php

Postby rvanhouten » Sun Jul 19, 2015 10:46 pm

Update:
Since db access was working fine, I finally specified in config.php in 'dbpassword' my actual password (the same I was using for testing db access) in plaintext. Guess what, owncloud's web interface worked again!!! Simply asked for my username and password. Entered oc_admin and password and was allowed in again.

The only thing is that config.php now contains my password in plaintext. Need to look into this.

The other thing is that sync isn't working properly. Windows client and Android apps don't sync at the moment. Need to look into this as well.

Still, very glad I got this far today.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to repair damaged config.php

Postby RealRancor » Sun Jul 19, 2015 11:20 pm

rvanhouten wrote:The only thing is that config.php now contains my password in plaintext. Need to look into this.


This is a normal and wanted behavior. The password in there is always in plaintext.
*gone*

rvanhouten
Beginner
Posts: 16
Joined: Fri Jul 10, 2015 9:47 am
ownCloud version: 8.0.4
Webserver: nginx
Database: PostgreSQL
OS: Linux
PHP version: 5.4

Re: How to repair damaged config.php

Postby rvanhouten » Mon Jul 20, 2015 9:15 am

Well, the dbpassword entry in config.php most certainly had a hashed value in it. But never mind, since the owncloud webinterface is working again, this thread can be closed.

I'll open another one for the sync error.

Many thanks for all the help,
Reinier.

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: How to repair damaged config.php

Postby RealRancor » Mon Jul 20, 2015 9:59 am

Hi,

as already stated in a previous post this was no hashed password. It just was a strong auto-generated plaintext password.
*gone*

User avatar
mariostevenson
Beginner
Posts: 15
Joined: Tue May 17, 2016 12:31 am
ownCloud version: 9.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: PHP5
Location: Tucson
Contact:

Re: How to repair damaged config.php

Postby mariostevenson » Thu Jun 09, 2016 7:51 am

DTS-06082016:22:16

In Response,

It doesn't matter if the entries such as user and pwd are as they once were because the database server will generate a _1, _2 or_3 as needed. Each failed attempt to install creates a new process entirely. Guess you didn't realize the original information was printed to the PHP database connector. Your first mistake was not copying a fresh take from the config.php sample. Second failing to change installed => false to installed => true where it would have blocked triggering the re-installation.

The original database is still there. Go into the database server, search for users and matching database. Take note of the user and database. Change pwd for the user. In the config.php change the user, pwd and database to match keeping installed => true. It should operate just fine. Remember to add trusted domains.

Thank you,

MAS
Thank you,

MAS


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.0 and 8.1”

Who is online

Users browsing this forum: No registered users and 3 guests