Following tables are missing a primary key (which is required for database replication):

  • activity_notification_status
  • user_activity_digest
  • user_activity_send

Issue fork social-3204517

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Matthijs created an issue. See original summary.

matthijs’s picture

Status: Active » Needs review
ressinel’s picture

Version: 10.0.x-dev » 11.1.x-dev
rollins’s picture

Result of update commands:

[notice] Update started: activity_creator_update_8803
[error]  SQLSTATE[42000]: Syntax error or access violation: 1280 Incorrect index name 'ansid_tmp': ALTER TABLE "activity_notification_status" ADD PRIMARY KEY ("ansid"); Array

[error]  Update failed: activity_creator_update_8803
[notice] Update started: activity_send_update_8003
[error]  SQLSTATE[42000]: Syntax error or access violation: 1280 Incorrect index name 'uasid_tmp': ALTER TABLE "user_activity_send" ADD PRIMARY KEY ("uasid"); Array

[error]  Update failed: activity_send_update_8003
[notice] Update started: activity_send_email_update_8002
[error]  SQLSTATE[42000]: Syntax error or access violation: 1280 Incorrect index name 'uadid_tmp': ALTER TABLE "user_activity_digest" ADD PRIMARY KEY ("uadid"); Array

[error]  Update aborted by: activity_creator_update_8803, activity_send_update_8003, activity_send_email_update_8002
[error]  Finished performing updates.

rollins’s picture

Version: 11.1.x-dev » 12.4.4

rollins changed the visibility of the branch 3204517-add-primary-keys to active.

avig’s picture

I am using Drupal 10.2.7 and Open Social 12.4.2. In every installation I try I get the above error with the 3 missing keys activity_notification_status
user_activity_digest
user_activity_send
The way I managed to remove the error from the Status page is by creating the column on the database itself, like that:

ALTER TABLE `user_activity_send`
ADD COLUMN `uadid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;

and did that with the other 2 tables.

It removed the error. Hopefully, I won't get any issues further down the road.

nmridul’s picture

I updated to 12.4.5 and still has this issue.
https://www.drupal.org/project/social/issues/3204517#comment-15749361 -> It should be available from 12.4.4 according to this comment ?

trakoczi’s picture

I suspect this is the reason why notifications work unreliably in our project. Sometimes, quite randomly, the Activity Creator cron task ends up in a temporary DB lock, which is then automatically gone after a few minutes.

It would be important to have a bugfix release for this problem for the 12.4.x branch, because I fear if we fix it on our own now, even with the changes from the MR, it could later conflict with a different final solution.

socialnicheguru’s picture

Which MR is it, 12 or 73?

socialnicheguru’s picture