I just updated to drupal 7, installed all contributed modules from my D6 site and am now installing Ubercart. as I run update.php it locks up at
Completed 11 of 46 26%
uc_order module

It has been sitting here for over and hour. Is there anyway I can see what is going wrong or why it might be locking up?

Comments

longwave’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

We need to know the update number that causes this issue. Please rerun update.php and note which updates are still left to run, try running them again, if it still hangs please reply with the list of updates.

smptebars1’s picture

It never returned an error code so I was unable to give you a number. I just kept running update.php about 4 different time and if finally completed. I don't think it ever reported any errors. thanks If there is a log file that I can look back at, let me know and I will go find the error

longwave’s picture

Any errors should be logged in Reports > Recent log entries.

longwave’s picture

Status: Postponed (maintainer needs more info) » Fixed

As it eventually worked, marking as fixed. But if you do find what the error message was, please post back with the information as it might be useful to other people.

Status: Fixed » Closed (fixed)

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

Leo Pitt’s picture

I ran into the same issue and by running update a few times also got it done, albeit with these errors:

Update #7301
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => view own invoices [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of user.module).
uc_store module

Update #7007
Failed: DrupalUpdateException: Rules and Views are now dependencies of Ubercart, but are not currently available. Please download them to sites/all/modules and run update.php again. in uc_store_update_7007() (line 272 of uc_store.install).
Leo Pitt’s picture

Status: Closed (fixed) » Active

It seems to be hanging on uc_order_update_7004

restarting the update a few times eventually finishes it. Nothing that seems relevant in the error log.

It's as if the logic in uc_order_update_7004 never signals completion - but I'm not very familiar with the update hook so don't know how to check this.

longwave’s picture

The error in update 7301 is new, I have pushed a fix for this.

The error in update 7007 is valid; you need Rules and Views available during upgrades to Drupal 7, as these are now required modules.

I am unable to reproduce the error in 7004, and you say it completes eventually; how many products do you have? Is there a possibility that your database may have been manually modified? I can see that it may get stuck if the node and uc_products tables do not match up correctly for some reason.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Awaiting clarification about update 7004. Is this still an issue?

Cayenne’s picture

Version: 7.x-3.2 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

With both the dev (7.x-3.4+21-dev) version and the 3.4 version, I am getting the 7301 problem, which is with only this task outstanding:
7301 - Convert view invoices checkbox to permission.
the update never completes. I see that the item appears to be parked in the queue in the database, though I lack the background to understand if that matters.

I do note that when running cron, I get the following notices:

Notice: Trying to get property of non-object in uc_order_order_entity_access() (line 874 of /var/www/d7/sites/all/modules/ubercart/uc_order/uc_order.module).
Notice: Trying to get property of non-object in uc_order_order_entity_access() (line 874 of /var/www/d7/sites/all/modules/ubercart/uc_order/uc_order.module).

Anyway, this does seem to still be a problem. Am I alone? I will be happy to supply other information if needed.

longwave’s picture

7301 shouldn't hang, as it only does a single query. In 7.x-3.4 you might see the error noted in #6, but this should have been resolved in recent versions of 7.x-3.x-dev. What do you mean by "parked in the queue in the database"?

I think the notices on cron are a separate issue, and can see why they might be generated, but haven't actually seen this in practice either.

Cayenne’s picture

"Parked in the queue" means that I see a task referencing 7301 in the "queue" table of the database relating to my installation. I'm pretty unfamiliar with that area of the system, so I do not know whether it is relevant or not.

Now, I have to also note that this is not happening in other installations, so perhaps there is some conflict with other parts of the installation. If it's a single query, perhaps I can just find it and run it manually?

longwave’s picture

The queue table contains in-progress or failed batch jobs, in this case that was the update process; this failed job should be cleared on the next cron run. So if you run update.php again now, what happens? Is uc_order 7301 the only remaining update listed?

Cayenne’s picture

Yes, 7301 is the only update listed.

a:2:{i:0;s:13:"update_do_one";i:1;a:3:{i:0;s:8:"uc_order";i:1;i:7301;i:2;a:0:{}}}

Maybe I can work around this by tweaking a table?

Cayenne’s picture

Well, deleting the following function from the install script hides the problem, but it is really no solution, of course.
Oddly, I cannot even find an error message anywhere.

Checling the databases, uc_cust_view_order_invoices is NOT set anywhere in the variable table, so the merge command will run, it seems.

/**
 * Convert view invoices checkbox to permission.
 */
function uc_order_update_7301() {
  if (variable_get('uc_cust_view_order_invoices', TRUE)) {
    // user_role_grant_permissions() is not allowed during upgrades from D6.
    db_merge('role_permission')
      ->key(array(
        'rid' => DRUPAL_AUTHENTICATED_RID,
        'permission' => 'view own invoices',
      ))
      ->fields(array(
        'module' => 'uc_order',
      ))
      ->execute();
  }
  variable_del('uc_cust_view_order_invoices');
}
Leo Pitt’s picture

Sorry for delay - didn't see your reply

#8
I can confirm that the issue with 7301 is fixed now.

Regarding 7004 - I have about 120 products, not enough to make the update take a long time, I would have thought? Also - I can leave the update running for 5, 10, 15 minutes and it remains stuck. However, I can run the update twice and it will complete in a total of a few seconds - so I don't think the quantity of data is an issue.

Cayenne’s picture

More information: my update is hanging on other modules too, even with this commented out. I don't think we should be blaming this module. So, I can't blame 7301 right now.

The search continues.

longwave’s picture

Status: Active » Fixed

@leopitt: I am not really sure why it only works if you run the 7004 update twice, but if it completes successfully then there should be nothing to worry about.

@Cayenne: Indeed, it sounds like you have further problems with your update process, and 7301 is not the culprit here.

tgldesign’s picture

it also hung for me on this module, see error below, and seems like the only problem. i've upgraded my other websites ok, just this one had ubercart on it.

I imagine I'll need to go into the database to fix this, can anyone provide help for what I would need to edit if that is the solution?

ERROR:

uc_order module
Update #7301

Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => view own invoices [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of /home/sites/*mywebsite*.com/public_html/modules/user/user.module).

After database update for this:

1 pending update
uc_order module

7301 - Convert view invoices checkbox to permission.

tgldesign’s picture

just looking again at #8

I have edited the database in the past to mass update product prices. could this be a cause, and something I can look at for fixing the problem?

longwave’s picture

uc_order update 7301 will fail as you describe on 7.x-3.4, this has now been fixed in 7.x-3.x-dev. If you don't want to use the -dev version you can safely ignore this until 7.x-3.5 is released.

dgtlmoon’s picture

Status: Fixed » Active

Still seems to be a problem in "7.x-3.x-dev tar.gz (619.76 KB) | zip (887.86 KB) 2013-Mar-28"

It's doing the main query for your loop

SELECT n.nid, n.title, p.weight_units FROM node n JOIN uc_products p ON n.vid = p.vid WHERE n.nid > '493' ORDER BY n.nid LIMIT 0, 200 

which is returning an empty set, where it keeps looping

$sandbox['progress'] = 44 always
$sandbox['current_nid'] = 493 always
$sandbox['max'] = 45 always

longwave’s picture

@dgtlmoon: This suggests you have 45 products in the uc_products table, but only 44 product nodes in the node table for some reason?

dgtlmoon’s picture

Right you are!

dgtlmoon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

RaulMuroc’s picture

Status: Postponed (maintainer needs more info) » Active

This issue stands to be fixed but no solution is given at all :S

Update from 7.x-3.3 to 7.x-3.4 raises the following error as well:

The following updates returned messages
uc_order module
Update #7301

Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 2 [:db_insert_placeholder_1] => view own invoices [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3058 of /var/www/.../httpdocs/modules/user/user.module).

Thank you.

longwave’s picture

Version: 7.x-3.x-dev » 7.x-3.4
Category: support » bug
Status: Closed (fixed) » Postponed (maintainer needs more info)

@RaulMuroc: It would help if you specified exactly which error are you talking about - there have been several different error messages reported in this thread, and many solutions have also been offered.

longwave’s picture

Status: Active » Fixed

As I said in #21

uc_order update 7301 will fail as you describe on 7.x-3.4, this has now been fixed in 7.x-3.x-dev. If you don't want to use the -dev version you can safely ignore this until 7.x-3.5 is released.

RaulMuroc’s picture

Version: 7.x-3.4 » 7.x-3.x-dev

Just for the record:

I update from 7.x-3.4 to -dev version but the error persists. I do not know if I am the only one but ok :S

longwave’s picture

You have downloaded 7.x-3.x-dev today and still get the exact same error after running update.php? I am not sure how, as uc_order_update_7301() no longer calls user_role_grant_permissions() which is quoted in the error message.

Status: Fixed » Closed (fixed)

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