craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.29k stars 638 forks source link

PostgreSQL 10.2: Craft 3 RC 13 Install not completing properly #2528

Closed sentientnebula closed 6 years ago

sentientnebula commented 6 years ago

Description

Craft 3 RC 13 is not working properly with Postgresql 10.2 on an Ubuntu 16.04 server.

It accesses the database just fine, sets up all the tables, and reports success, but won't proceed to the login screen and show the dashboard. It just stays on the screen with the install button.

If you press the install button again and re-enter all your parameters, you'll get a table exists error as it tries to re-create tables that it had already previously created.

If you drop and recreate the database in postgreSQL to empty it out before hitting install again, it will repeat the whole process again, report success, and then go back to the screen with the install button again; an endless loop.

Changing the URL to [site]/admin, or [site]/admin/dashboard doesn't work either. It just gets redirected back to [site]/admin/install.

I can only end the loop by pointing it to a mariadb database, instead of a PostgreSQL one. When I do that, everything works great and I can log right into the dashboard after successful database setup.

The problem is, I don't want to use mysql/mariadb. I only fired it up to test if my problem is exclusive to PostgreSQL, and confirmed that it is.

Steps to reproduce

  1. Install/config PostgreSQL 10.2; create a blank database/assign owner.
  2. Install Craft, pointing it to the PostgreSQL 10.2 database you just created
  3. Watch it succeed, but not proceed.

Additional info

angrybrad commented 6 years ago

I see you also submitted a ticket from your Craft Support widget, but it doesn't include any log files. Can you zip up your craft/storage/logs folder and send it to support@craftcms.com so we can see what the underlying error is?

sentientnebula commented 6 years ago

I intentionally excluded the log files so I wouldn't lead you down the wrong path.

1) I submitted the file from a functional setup after changing to mariadb. I wouldn't have been able to use the support widget with PostgreSQL, because I couldn't get that far in the first place.

2) There were no new errors reported in the craft/storage/log files. There were, however, some older dated messages referring to already resolved issues. But you'd have had no way to know that.

To recap. Craft install reports SUCCESS! I verified that it did, indeed, connect to and populate the PostgreSQL database I directed it to. The problem is that it just wants to keep recreating the database over and over, and won't move on to actually use it.

angrybrad commented 6 years ago

Just tested this with the Craft 3 RC13 on PostgreSQL 10.3 and I'm not able to reproduce, unfortunately... it installs find and I get redirected to the dashboard fine afterwards. Try updating to 10.3?

sentientnebula commented 6 years ago

When tried to access the dashboard with the mysql service stopped, Craft sent me straight to the install page. I assume this is not the desired behavior. This gave me a pretty good hint about what went wrong with my PostGreSQL install attempt.

It appears that Craft 3 responds to any type of database access issue by sending the user back to the install page rather than reporting an appropriate error message. Knowing this, I reinstalled using PostgreSQL again, and checked the PostgreSQL error log. There was a wrong password error.

I then checked to see how Craft 3 stores the db password and found that it is stored in clear text between double quote marks. I use a password keeper that generates random passwords including special characters.

The Craft 3 installer accepts any legal database password, connects and populates the database just fine, but then messes up passwords with certain special characters when it retrieves them from the .env file and resends to the database.

After I generated a new password with special characters excluded, I got Craft 3 working with PostgreSQL without a hitch.

Please reopen as 2 bugs:

1) Sending users to the Install page rather than reporting a database access error message. 2) Setup being able to accept and use any password that the database allows, but not being able to properly process passwords with certain special character when retrieving from .env.

Steps to recreate:

Install Craft 3 with PostgreSQL using this database password:

Zpw<s'U3+ST(eN'YP(@2