Problem/Motivation

Running Drupal 7.39 with PHP v 5.3.17 and database fully updated.
The problem: Cannot edit any nodes. Clicking EDIT triggers the PDOException error.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.status' in 'field list': SELECT base.rid AS rid, base.hash AS hash, base.type AS type, base.uid AS uid, base.source AS source, base.source_options AS source_options, base.redirect AS redirect, base.redirect_options AS redirect_options, base.language AS language, base.status_code AS status_code, base.count AS count, base.access AS access, base.status AS status FROM {redirect} base WHERE (base.redirect = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => node/201 ) in DrupalDefaultEntityController->load() (line 198 of /srv/www/htdocs/includes/entity.inc).

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mattstein created an issue. See original summary.

mattstein’s picture

Disabling the Redirect module has restored editing functionality to the rest of the site, but that's only a stop-gap measure (since I was using the redirect module for a reason).

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)

Can you confirm that the status field actually exists in the redirect table? Were you testing or have applied any Redirect module patches previously?

mattstein’s picture

Dave--
Thanks for responding. I recently ran a "drush up" so if there were any patches that would be applied through that automated process then the answer could be yes. But I didn't manually apply any patches. As for your status field question, I don't know. I don't have phpmyadmin privileges to the server, which is the one tool I'm familiar with for viewing the db tables. As you might have guessed from my response, I'm not a developer or sys admin so my skills and knowledge are limited.

johnennew’s picture

Hi both,

I was getting this same error. As far as I could tell I had somehow missed the 7101 update - this may have been due to using earlier patches for the module, I am not sure.

Anyway, I reset the version of the redirect module back to an early state and the reran update db using the drush commands below. This allowed the 7101 update to run before 7102 and this time there were no errors.

drush sqlq 'update system set schema_version=7100 where name="redirect"'
drush updb -y
xtfer’s picture

Status: Postponed (maintainer needs more info) » Active

I had the same issue after running drush up. The solution in #5 fixed it. Possibly update 7101 is broken?

mayabutterfield’s picture

I'm getting the exact same error. I haven't done any updates to the redirect module, just a single install of 7.x-1.0-rc3.
It was working for a while, and then while the client was doing some content edits we suddenly got this error when trying to edit:
Fatal error: Class 'RedirectController' not found in /home/cocon4/public_html/ucsf/includes/common.inc on line 7963

I turned off redirect, and the site started to function again. But that's not a long-term solution. When I turn redirect back on, I get the error listed above in the initial bug report.

I do have PHPMyAdmin, and no, when I drill down into Redirect, there is no column called status. There's only status_code.

I hope this adds a few more clues!

mattstein’s picture

StatusFileSize
new48.5 KB

Dave Reid: I found a way to access the database. I downloaded the site to my laptop and installed it via Acquia's Dev Desktop. The Dev Desktop framework provides PHPmyAdmin so I can look whatever you need. You just need to provide me with instructions since I'm not schooled in using PHPmyAdmiin.
I searched the db for "redirect" table so I exported it and just uploaded it "redirect.xls". Hope that helps.

mattstein’s picture

Ceng: I tested your drush commands on my downloaded site and it worked so I ran them in production. It looks like they worked like a charm!
I was able to reactivate the Redirect module (restoring the functionality) and the site is functioning properly.
Thanks so much!!!!

MattHalo’s picture

Confirm #5 worked.

hamrant’s picture

ceng, thank you, #5 worked!

Paul B’s picture

I get the same issue upgrading from7.x-1.0-rc1 to 7.x-1.0-rc3.
The updates don't run. The schema_version is -1 for some reason.
See also [1182804], [2515734], and [217533]

Paul B’s picture

I ran the database query in #5. After that the 7101 and 7102 updates would run.

xtfer’s picture

Struck this again today. Looks like 7101 never ran on the site in question.

dandaman’s picture

Yeah, found my schema_version was somehow set to -1, but once I changed it to 7100, the update ran correctly and the status column was added. Not sure why the -1 was set, though. Thanks for the help in troubleshooting the issue, everybody.

hkovacs’s picture

#5 worked for me. Thanks.

RAWDESK’s picture

#5 worked, but only after disabling and re-enabling the Redirect module again.

Mugé’s picture

#5 worked. Thanks to Ceng and OP!

I recently moved website to another host and thought perhaps there were some stuff in database misleading directions. Glad I found this post.

reepy’s picture

StatusFileSize
new753 bytes

I just ran into this problem while upgrading this module for a distro. I confirmed on two separate sites coming from rc1 to rc3, this error occurs.

In rc1, the `schema_version` is `7101`.

In rc2 and rc3, `redirect_update_7101` is code to add the field. This never runs because it has previously been used.

Attached is a patch that simply bumps the build numbers. This will work if you are coming from <= rc1. I'm not sure what the solution is with a schema mismatch if you are already on rc3.

sidharthap’s picture

#5 worked for me. Thank you

wylbur’s picture

Status: Active » Closed (outdated)

Closing this as Outdated as Drupal 7 is EOL.