Problem/Motivation
Drupal's installer depends on the on-demand cache table creation system. The current behavior is to generate queries that are expected to fail (and break if transactions were explicitly committed). Drupal will be successfully installed, but it will appear that something went wrong, and if something did go wrong, it might not be apparent to the end user.
This causes PostgreSQL's error log to spam messages about non-existing tables:
2021-09-20 18:14:49.710 UTC [71] ERROR: relation "config" does not exist at character 20
2021-09-20 18:14:49.710 UTC [71] STATEMENT: SELECT "data" FROM "config" WHERE "collection" = '' AND "name" = 'core.extension'
2021-09-20 18:14:49.711 UTC [71] ERROR: relation "config" does not exist at character 20
2021-09-20 18:14:49.711 UTC [71] STATEMENT: SELECT "data" FROM "config" WHERE "collection" = '' AND "name" = 'system.site'
Steps to reproduce
- Tail PostgreSQL logs (a docker container using "postgres" image will output this by default)
- Go to /core/install.php
- Errors above are present
- Continue until Drupal is "installing"
- "Relation does not exist" errors will continue to spam the postgresql log
Related issues:
#1025314: Transactions should be allowed to be committed explicitly
#2371709: Move the on-demand-table creation into the database API
#2356105: [meta] Refactor the installer
#1530756: [meta] Use a proper kernel for the installer
Proposed resolution
TBD
Remaining tasks
Decide if this is a support task and should be closed as a duplicate or works as designed.
If not, then add tasks.
API changes
TBD
Comment | File | Size | Author |
---|---|---|---|
Pgsql_log.txt | 510.82 KB | jhmnieuwenhuis |
Comments
Comment #2
cilefen CreditAttribution: cilefen commentedComment #3
cilefen CreditAttribution: cilefen commentedI posted a comment on #2001350: [meta] Drupal cannot be installed on PostgreSQL linking this issue.
Comment #4
mradcliffeIs there a specific error that is preventing you from installing Drupal, @jhmnieuwenhuis?
The "Error: relation x does not exist" error happens because of the way that Drupal 8 Storage layer was architected (for non-sql databases, but don't ask me why other than that). Cache and some other tables are not guaranteed to exist at run time, and are created as-needed. This means that cache operations fail transactions. The pgsql driver catches these with its mocked "implicit commit" behavior that I had to write.
Comment #5
cilefen CreditAttribution: cilefen commentedAgreed - It is good that people are paying attention to logs, but we need to know if this actually caused a problem.
@mradcliffe Is there a CR, a doc page, or something we could point people to, or create one?
Comment #6
mradcliffeNo, there is no change record or doc page. The relevant change is in #2181291: Prevent a query from aborting the entire transaction in pgsql back in 2014 (to mock implicit commits). Not sure about the storage layer docs.
I was looking for the equivalent of https://www.drupal.org/docs/7/system-requirements/database-server page on the Drupal 8 side, but couldn't find it. Good suggestion that it would be good to expand on this on a database server requirements doc page (or child page) for Drupal 8.
Comment #7
jhmnieuwenhuis CreditAttribution: jhmnieuwenhuis commented" Is there a specific error that is preventing you from installing Drupal, @jhmnieuwenhuis? "
No, this error does not prevent me from installing Drupal.
The installation runs and ends successfull.
It is just not nice to have so many errors in the log.
They may distract from "real" issues in the log.
Regards,
Hans Nieuwenhuis
Comment #10
quietone CreditAttribution: quietone as a volunteer commented@ jhmnieuwenhuis, Thank you for reporting this problem. We rely on issue reports like this to improve Drupal core.
I tested this on 9.3.x and was able to install Drupal without errors in the logs. I used ddev with postgre, 13.4 (Debian 13.4-1.pgdg100+1).
Therefore, closing as cannot reproduce. If you are experiencing this problem reopen the issue, by setting the status to 'Active', and provide complete steps to reproduce the issue (starting from "Install Drupal core").
Thanks!
Comment #11
mradcliffeThe PostgreSQL log does still output errors when installing Drupal or using the install page due to Drupal requiring to check cache (tables) during the installation process. This is currently expected behavior even though it's not the ideal behavior. This might be "Closed (duplicate)" or "Closed (works as designed)" :| rather than "Closed (cannot reproduce)" so I'm re-opening so this can be re-triaged.
I don't know what the default settings are in Debian, but when logging is visible, these do appear in PostgreSQL's log.
For instance, if we merely go to /core/install.php, then
Apache:
PostgreSQL:
When the install is actually in-progress, for each module being installed, there are many "relation does not exist" errors logged to postgresql's log.
I updated the issue summary to be more clear.