Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle postgres setup when we cant connect as admin #497

Merged
merged 1 commit into from
Dec 5, 2016

Conversation

icewind1991
Copy link
Member

Fixes #482

@pmattern can you check if this fixes the problem for you?

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Jul 21, 2016
@icewind1991 icewind1991 added this to the Nextcloud 10.0 milestone Jul 21, 2016
@mention-bot
Copy link

@icewind1991, thanks for your PR! By analyzing the annotation information on this pull request, we identified @bartv2, @DeepDiver1975 and @nickvergessen to be potential reviewers

@pmattern
Copy link
Contributor

pmattern commented Jul 21, 2016

963c0e8 behaves like the current release as described in #482: First, a connection attempt is made to database "postgres" instead of the one of Nextcloud which obviously fails. Next a connection attempt using correct database and database username is made but fails due to a wrong password besides the one filed in the wizard's form is definitely correct. The error message is
nextcloud_wizard-initial-postgres_963c0e8
Bits from Apache's error log can be found in this Gist, ./config/config.php reads

<?php
$CONFIG = array (
  'instanceid' => 'oc1fhm06dego',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
  0 => '<FQDN>',
  ),
  'datadirectory' => '/var/lib/nextcloud',
  'overwrite.cli.url' => '<FQDN>',
  'dbtype' => 'pgsql',
  'version' => '9.1.0.13',
  'dbname' => 'nextcloud1',
  'dbhost' => '<FQDN>',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'u_nextcloud1',
  'dbpassword' => 'on',
);

where at least 'dbpassword' => 'on' seems plain wrong.

@andreas-p
Copy link

Testing with 10 beta, I found the behaviour even more problematic. I've set up a postgres database upfront with full access granted to , including a specific pg_hba.conf entry, which should be sufficient for all nextcloud server access patterns.

First, the setup tries to connect using the www-data to the database (1xssl, 1x nonssl), then it tries to connect using the to the postgres database. Both is wrong, it obviously should connect to using , nothing else (at least as a first attempt).

@rullzer rullzer modified the milestones: Nextcloud 11.0, Nextcloud 10.0 Aug 8, 2016
@rullzer
Copy link
Member

rullzer commented Aug 8, 2016

Moved to NC11 since it is against master

@LukasReschke
Copy link
Member

@icewind1991 Any comments on above remarks?

@LukasReschke LukasReschke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Aug 27, 2016
@nebulade
Copy link

nebulade commented Sep 6, 2016

Ran into the same issue with our Cloudron app, where the database and db user are already pre-setup. Using that patch only worked by also adding

'dbname' => $this->dbName,

to the $connectionParams at https://github.com/nextcloud/server/blob/master/lib/private/Setup/AbstractDatabase.php#L111

@nebulade
Copy link

nebulade commented Sep 6, 2016

Most likely 'port' => $this->dbPort, should also be specified there, if the port is non standard.

@icewind1991
Copy link
Member Author

It now sets the dbname explicitly

@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 6, 2016
@pmattern
Copy link
Contributor

pmattern commented Sep 20, 2016

Running 787f0e5 the error messages shown above and in #482 can no longer be seen. Also, config.php seems to be correct, in particular directives dbpassword and installed are now included.

The first connection attempt is still made to database postgres instead of the one filed in the wizard and correctly written in config.php, though, as can be seen both in the PostgreSQL server's logs and in error_log of Apache.

787f0e5 on Arch Linux x86_64, PostgreSQL 9.5.4, Apache 2.4.23, PHP 7.0.11 via mod_php.

@MorrisJobke
Copy link
Member

@rullzer Would be nice to get this in - I will try to test this today too ;)

@MorrisJobke MorrisJobke self-assigned this Dec 1, 2016
@MorrisJobke
Copy link
Member

Rebased ontop of master ;)

@MorrisJobke
Copy link
Member

I tested this and setup via postgres works fine 👍

@MorrisJobke MorrisJobke removed their assignment Dec 5, 2016
@MorrisJobke
Copy link
Member

@rullzer @nickvergessen Mind to review this one here?

It's not a huge diff: https://github.com/nextcloud/server/pull/497/files?w=1

@MorrisJobke
Copy link
Member

MorrisJobke commented Dec 5, 2016

@karlitschek We need more people testing postgres or we should kill the support for it. I would vote for only go for one nice solution instead of 4 different ones that only work half of the time 🙈

We have 3,7% Postgres users as per survey server

@karlitschek
Copy link
Member

hmm. not sure it is realistic to drop support. Maybe we should ask in the forum for more testers?

@MorrisJobke
Copy link
Member

hmm. not sure it is realistic to drop support. Maybe we should ask in the forum for more testers?

We are should then check out how to get more traction on the postgres side. Because this is here sind end of July.

But maybe something like the Nginx guys also happen for the postgres support :)

Copy link

@Threeseven Threeseven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the issue for me. I've installed Nextcloud 10.0.1 with non admin postgres user and non standard port.

@MorrisJobke
Copy link
Member

@Threeseven Thanks for the feedback 👍

@MorrisJobke MorrisJobke merged commit a89b033 into master Dec 5, 2016
@MorrisJobke MorrisJobke deleted the postgres-setup-no-admin branch December 5, 2016 22:25
@andreas-p
Copy link

I'd consider dropping postgres support as a major drawback, please drop thinking about it...
This installation issue was quite long-lasting because users usually don't install too often. I have several NC-on-pgsql instances running, and will certainly give feedback on issues.

@LukasReschke
Copy link
Member

#1793 is another PGSQL issue that seems rather critical…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostgreSQL: faulty database connection upon completing installation wizard
10 participants