4

I've been chasing this for a full 8 hours now.

I'm using the Focus Lab Master Config.

All files on the front end - both locally and on my staging server - display perfectly fine.

I can log into CP locally.

I *cannot log into CP on staging. I get the white screen of death.

I turned on debugging. When I access the CP, I get this error:

A Database Error Occurred Error
Number: 1054
Unknown column 'session_id' in 'field list'
INSERT INTO exp_security_hashes (date, hash, session_id) VALUES (1375809948,'fa2ebb013799a26b30d4acb1964d3156111bb5ff',0) Filename: core/EE_Security.php Line Number: 158

I've attempted as many solutions as I could dig up from Google. Does anything in this particular situation stand out as being the most likely culprit?

  • 2
    I turned on debugging. When I access the CP, I get this error: A Database Error Occurred Error Number: 1054 Unknown column 'session_id' in 'field list' INSERT INTO exp_security_hashes (date, hash, session_id) VALUES (1375809948,'fa2ebb013799a26b30d4acb1964d3156111bb5ff',0) Filename: core/EE_Security.php Line Number: 158 – Bardo_J Aug 6 '13 at 18:26
  • 4
    hopefully this will help out another numbskull like myself in the future. My staging server was running a newer copy of EE than my production server (I was testing out the update process). In order to have the most recent content, I imported the production server's database to my staging server. These tables are not structured the same, and that was causing the above error. – Bardo_J Aug 6 '13 at 18:34
  • 4
    Go ahead and post that as your answer... then later (whenever stack exchange allows you to), accept your answer. This suggestion on behalf of EESE having asked-and-answered questions posted here. – auntialias Aug 6 '13 at 21:03
  • 3
    Hi Bardo - to help out future googlers looking for a solution, if would be great if you can post your comment as an "answer" in the box below. – Adrian Macneil Aug 7 '13 at 15:28
2

The error "Unknown column 'session_id'" points to the session_id column not being present in the "exp_security_hashes" table on your production server... Why it's missing is not clear to me but should be an easy fix.

First, compare the tables on both servers to see what's different.

Do you see the session_id column in the exp_security_hashes table on production? If you do see it, I'd guess the exp_security_hashes table has crashed and needs to be repaired. You can run the repair in phpmyadmin or your DB tool of choice.

If you don't see the session_id column in the exp_security_hashes table, you'll need to add it... Best way to do that is to export the table from your local DB, delete the table from production and import the sql to recreate the table... Or you can manually create it to match your local DB.

NOTE: BACKUP YOUR PRODUCTION DATABASE before you start making changes.

EDIT: This SE answer has the SQL you can run to create the column in the DB.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.