Attempted to install a clean version of D8 today, and I'm getting a fatal error on the 2nd step of the install (right after selecting an install profile). Here are the fatal errors...

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'd8mappingdev.users'

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO {sessions} (sid, ssid, uid, hostname, session, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => NLUw1Bvu4ra30CJkNaZNxVvWcsjG4U9ASUkPmkqzihY [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 127.0.0.1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 1362021900 ) in Drupal\Core\Database\Connection->query() (line 551 of /Users/bmorrison/htdocs/d8mappingdev/core/lib/Drupal/Core/Database/Connection.php).

I was able to install a clean version of D8 a few days ago, so the error has probably been introduced since then. It doesn't make a difference which install profile I chose.

I didn't bump the priority up to critical, but if somebody else can verify, then it probably should be pushed up.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Others reported this in irc, creating a new database seemed to fix it. Ie with a new database name too.

Brandonian’s picture

Title: Can't install a clean version of D8 » Fatal error on install when database is already created
Status: Active » Fixed

Was able to get it working based on @larowlan's advice. Marking as fixed.

jenlampton’s picture

Status: Closed (cannot reproduce) » Active

Changing this back to active. And bumping up priority.
We should be able to install Drupal without a fatal if a database already exists. No?

Here's how to reproduce:

1) take a working drupal 8 site
2) drop the database in MySQL by typing drop databsse whatever;
3) create a new databse in MySQL by typing create databsse whatever;
4) sudo rm -rf sites/default/files/*

Now run the installer.

On step 3 of the installer you get:
Uncaught exception thrown in session handler.

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: INSERT INTO {sessions} (sid, ssid, uid, hostname, session, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => 1TwwmAUT86fuBkwHZtCsMLmHsRtRxwIJ4azmuqHPUfo [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 127.0.0.1 [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => 1362123832 ) in Drupal\Core\Database\Connection->query() (line 551 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Database/Connection.php).

And since you asked... I also tried adding a step 5:
5) delete sites/default/settings.php

When I do this then the installer gets to the next step, 'Database configuration'
and then fatals with the same error when you hit 'save and continue' at the bottom.

ParisLiakos’s picture

for any folks that having this one..settings.php contains $config_directories, so should be removed before reinstalling

rm sites/default/settings.php
cp sites/default/default.settings.php sites/default/settings.php
ParisLiakos’s picture

Priority: Normal » Major
Status: Fixed » Active

oops..x-post..seems there is sth else there for jenlampton..restoring status while troubleshooting with chx on irc

chx’s picture

I can't reproduce this. I am running PHP 5.4.11 and MySQL 5.5.30 on Linux 3.5.6.

jenlampton’s picture

I am running PHP 5.3.6 and MySQL 5.5.9 on MAMP 2.0.2.

ParisLiakos’s picture

Cant reproduce this either:
PHP 5.4.4 MySQL 5.5.29 Linux 3.7.0

jenlampton’s picture

Status: Active » Closed (cannot reproduce)

Closing since apparently my computer likes to play tricks on me.
With a sudo rm -rf on my whole drupal 8 directory, and a fresh download, things seems to be working fine now.
Sorry for the false alarm.

jenlampton’s picture

Just confirmed this error with 5 computers at exactly the same time, see https://twitter.com/jenlampton/status/344600938486566912/photo/1

Uncaught exception thrown in session handler.

Drupal\Core\Database\IntegrityConstraintViolationException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'hostname' cannot be null: INSERT INTO {sessions} (sid, ssid, uid, hostname, session, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => OnqCRLAydyTSUC3k_I1Up3zNI-DugaPYMyT-TUfVyzE [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => batches|a:1:{i:1;b:1;} [:db_insert_placeholder_5] => 1370995289 ) in Drupal\Core\Database\Connection->query() (line 568 of /Users/jlampton/Sites/_drupal/drupal-8.x-dev/core/lib/Drupal/Core/Database/Connection.php).

All machines are running:
- latest version of MAMP 2.1.3
- php.5.3.20
- mysql 5.5.29

This was the first time 4 of the 5 machines installed drupal - ever.
Fresh checkouts from 8.x branch for all involved.
New Databases created via mysql command line.
Credentials plugged in to installer via UI.

adamcowboy’s picture

I just got this error:

"The service definition "request" does not exist."

We changed the mysql permissions to grant all on this database and tried to reinstall and got this error instead.

echoz’s picture

I too just got same error as #10, with a recent git pull, doing the same - drop database, delete settings.php, install fresh - that I've been doing since last year.

ekl1773’s picture

Yep, #10, me too. Using MAMP, fresh install, new db, wiped php files etc. You're not alone!

effulgentsia’s picture

Title: Fatal error on install when database is already created » Fatal error on web-based install
Component: other » install system
Priority: Major » Critical
Status: Active » Needs review
FileSize
3.8 KB

I'm also getting this error, on MAMP, PHP 5.4.10, whenever doing a fresh web-based install (i.e., no sites/default/files, no sites/default/settings.php), regardless whether I have an empty db or no db at all. That seems like critical priority to me.

Via git bisect, I found that this error started as a result of #1623114-34: Remove drupal_exit(). I suspect due to the lack of exiting where we used to exit, and therefore, the writing of session in places we didn't used to.

However, that's not the bug itself, just the surfacing of it. The underlying bug is that Drupal::request() sometimes returns a request object that's incomplete (e.g., doesn't have client IP info in it, triggering the error in #10), and that needs to be fixed in #2004086: The Request service must be synthetic.

In the meantime, here's a patch that preserves a valid $request object, at least throughout installation. I don't really know if this moves us closer to a real solution for #2004086: The Request service must be synthetic or is just more band-aids, so I'll leave comments on the other issues to solicit that feedback.

chx’s picture

Assigned: Unassigned » katbailey
Issue tags: +Stalking Crell

Adding reviewers to the issue. I only assigned it to @katbailey for review, feel free to unassign.

effulgentsia’s picture

By the way, the RTBC stopgap patch in #2004086: The Request service must be synthetic also solves this problem, so if that's committed first, then #14 doesn't need to be, though the code in it will likely make its way into the final patch of that issue in any case.

jenlampton’s picture

Confirming, the patch in #2004086: The Request service must be synthetic fixed the problem for me.

alexpott’s picture

Status: Needs review » Closed (duplicate)