I installed the dev version (7.x.1.x-dev) today, and there was an instant message on my site saying I should run database update script immediately. Fair enough, but after doing so, I'm getting this error:

The following updates returned messages
subscriptions module
Update #7100

Failed: DatabaseSchemaObjectDoesNotExistException: Cannot add field subscriptions_user.secure_links: table doesn't exist. in DatabaseSchema_mysql->addField() (line 325 of /home/chwd1435/employmentencounter.com/includes/database/mysql/schema.inc).

I previously had Notifications module installed, which I had removed because having both Notifications and Subscriptions installed cause the site to break and produce a simple Error page. Anything here I should be worried about? I'm not sure if it's still conflicting with anything else on my site (running the latest Drupal 7).

Comments

salvis’s picture

You received a request to run update.php after installing Subscriptions? That is very strange. This should never happen, for any module.

Are you sure you have not had Subscriptions installed before?

Your database is in a strange state now. I would recommend disabling and uninstalling Subscriptions (to get rid of any left-overs) and to reinstall it. You should not be asked to run update.php. I've just tried this here and I didn't get such a request.

deen82’s picture

I removed all of Subscriptions and made sure there were no lingering tables on my DB either. I disabled any potentially conflicting modules as well. Re-installed it (used the current dev) and enabled all but Blog Subscriptions under the package. Immediately afterwards on my Configuration page, I see the "One or more problems were detected with your Drupal installation" message and went to my Reports page. There I see the error:

Database updates Out of date
Some modules have database schema updates to install. You should run the database update script immediately.

I just ran update.php and while running it says it's updating subscriptions module (only update it had waiting). Same error message.

When I went back to my Modules page, everything seemed fine - when I clicked Uninstall, I get a blank error page (with my site logo on top though) saying

The website encountered an unexpected error. Please try again later.

I'm going to see if removing Subscriptions using FTP, then re-uploading it and THEN hitting Uninstall works a bit better in terms of removing it completely. I'm not sure if I installed Subscriptions before for this site since I've been working on it for months and have gone through a large amount of modules, but I just wanted to see if this was a symptom of an incomplete uninstall from last time.

deen82’s picture

Re-uploaded everything, but I'm still getting the same error. Now whenever the module is uploaded, all the components of the package are already enabled. When I try and disable them, I get the blank error page as before.

deen82’s picture

Reverting to version 7.x.1.1 removed the database update prompt from my Reports page. However, whenever I try to go to admin/config/system/subscriptions, I'm getting an error page instead. I've definitely installed Subscriptions before it seems, because the package components are pre-enabled on my Modules page without me doing anything, and the permissions for various roles is already set.

EDIT: this is the error message in my logs that kept popping up several times:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'ee_drupal_db.subscriptions_queue' doesn't exist: SELECT COUNT(sqid) AS count, suspended FROM {subscriptions_queue} GROUP BY suspended; Array ( ) in _subscriptions_mail_form_subscriptions_settings_form_alter() (line 59 of /home/chwd1435/employmentencounter.com/sites/all/modules/subscriptions/subscriptions_mail.admin.inc).

salvis’s picture

Category: bug » support

Just to get this straight: "Disabling and Uninstalling" are two actions that you do in the Drupal UI only — they do not normally involve doing anything directly in your database or removing any files.

Once you start doing the latter, Drupal loses track of the state of your installation and you're quickly approaching the fubar state.

Manually removing a module involves much more than deleting files and dropping tables, depending on the module. If you've been doing this for a while, then you probably have many more broken pieces lying around, not just from Subscriptions, and going forward it'd probably make sense to scrap your installation and start over.

If you want to try to fix Subscriptions, then do the following:
-- Remove the Subscriptions files and database tables
-- Look for the Subscriptions* rows in the {system} table and remove them
-- Redownload the -dev version (there was a recent fix that you want to have, even though it's unrelated to what we're seeing here)
-- Install all Subscriptions modules and verify that you do NOT get asked to run update.php
-- Disable and uninstall all Subscriptions modules to remove additional left-overs

That should give you a clean site as far as Subscriptions is concerned, and you should be able to install it successfully.

deen82’s picture

Thanks salvis,

I definitely just went through those steps already - made sure the System table had Subscriptions entries removed (there were a few still remaining) and made sure there were no remaining database tables for the module. Whenever I disabled the module, I went through FTP to also manually remove all traces of the files from sites/all/modules.

I've uploaded the most recent dev, no weird database update prompts at all. So far so good - I enabled the main Subscriptions component from the package and nothing else - site didn't break and I even got to see the configuration page (it wasn't coming up before). I then went ahead enabling each component one by one. Weird thing is, when I enabled Subscriptions Mail next, the site crashed on the modules/list/confirm page with an error message. I went back to the Modules page and enabled Taxonomy module instead, and the modules/list/confirm came up properly prompting me to enable Content Subscriptions as well. Crossed my fingers, said Yes, and it went through perfectly. I then enabled Subscriptions UI, then Mail, and the whole module appears to be working just fine.

I'd say my issue is fixed, barring any other problems. Thank you for your time, I appreciate it!

salvis’s picture

I'm glad you got it to work now, but I hate unexplained bad behavior.

Weird thing is, when I enabled Subscriptions Mail next, the site crashed on the modules/list/confirm page with an error message.Weird thing is, when I enabled Subscriptions Mail next, the site crashed on the modules/list/confirm page with an error message.

What was that error message? I've just gone through this routine a couple of times, but I haven't been able to reproduce a crash.

deen82’s picture

Salvis -

as I've mentioned before in a previous post, this is a blank error page I get after hitting Save on my Modules page. The error is:

The website encountered an unexpected error. Please try again later.

It's a partial WSOD - my site's logo was still on top, but everything else was stripped away and the above message was all that was in the body of the webpage. The page Drupal was trying to load was modules/list/confirm - I guess it's the page that is supposed to prompt me to enable further dependent components of the Subscriptions package if I wanted to enable Mail Subscriptions, but it failed to load it entirely. I am unsure right now whether this is because of conflicting tables in my DB, or whether my site merely timed out.

Corresponding error in my logs was as follows (posted this before):

DatabaseSchemaObjectExistsException: Cannot add field mail_edit.subscriptions_comment_body: field already exists. in DatabaseSchema_mysql->addField() (line 328 of /home/chwd1435/employmentencounter.com/includes/database/mysql/schema.inc).

Apologies if I wasn't being clear in indicating when and where the errors were occurring. This may very well be a result of remnants of a previous installation of Subscriptions still remaining somewhere in my DB. Doing a clean sweep of my DB for old Subscriptions rows appears to have done the trick. If I get any more errors, I'll either respond here or make a new thread.

Thank you once again for your help.

salvis’s picture

Status: Active » Fixed

Cannot add field mail_edit.subscriptions_comment_body

I see. Seems like you did not go through a complete successful uninstall/reinstall cycle, but I think you could do it if you wanted.

Adding the subscriptions_comment_body column to the {mail_edit} is the last step of enabling subscriptions_mail.module. Uninstalling subscriptions_mail should remove that column.

I think we can mark this fixed, feel free to reopen if needed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.