In the _tracker_remove() we can find the next lines:

      $connection->update('tracker_node')
        ->fields([
          'changed' => $changed,
          'published' => $node->isPublished(),
        ])
        ->condition('nid', $nid)
        ->execute();

If $node->isPublished() returns FALSE we can see the next error:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22007]:
Invalid datetime format: 1366 Incorrect integer value: '' for column `tracker_node`.`published` at row 1:
UPDATE {tracker_node} SET changed=:db_update_placeholder_0, published=:db_update_placeholder_1 WHERE nid = :db_condition_placeholder_0; Array ( [:db_update_placeholder_0] => _TIMESTAMP_ [:db_update_placeholder_1] => [:db_condition_placeholder_0] => _NID_ ) in _tracker_remove()
(line 377 of /core/modules/tracker/tracker.module).

Simmilar issue was fixed by addign (int) and commited here 2887490
but not all the 'published' => $node->isPublished(), entries were fixed.

Issue fork drupal-3119131

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

gilmord created an issue. See original summary.

gilmord’s picture

StatusFileSize
new826 bytes
gilmord’s picture

Status: Active » Needs review

Please review the patch.

gilmord’s picture

Assigned: gilmord » Unassigned
hardik_patel_12’s picture

StatusFileSize
new771 bytes
new691 bytes

Patch at #2 looks good to me , but there is also duplicate code for updating tracker_node table , removing duplicate code also kindly review the patch.

Version: 8.8.2 » 8.8.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Version: 8.9.x-dev » 9.1.x-dev
Status: Needs review » Needs work
Issue tags: -bug +Needs tests, +Needs issue summary update

Is this reproducible from the UI? If, so please add step to reproduce.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Status: Needs work » Postponed (maintainer needs more info)

Which database engines does this occur on?

gilmord’s picture

@larowlan InnoDB

gilmord’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new108.75 KB

Not sure why this issue stuck, tracker_cron uses the exact same approach for a long time:
example

@larowlan I think we can rely on this and use the same fix in the _tracker_remove without digging into database engines etc.
Any thoughts on this?

larowlan’s picture

Status: Needs review » Needs work
Issue tags: -error, -Drupal 8.x, -Tracker

Yep, that will be fine

We need a test here

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gilmord’s picture

Hi @larowlan

I do not think there is a good way to cover this with tests
_tracker_remove() is already covered by tests, and it does not fail
as mentioned before - conditions may be specific, like database engine

gilmord’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests

Hi again, according to previous comment:
- we can`t cover with tests this environment-specific case (this functionality is already covered by tests, but it can not catch this type of issue)
- we have exactly the same fix for the similar code in the same module

Prepared MR (also includes the fix for the issue mentioned by @Hardik_Patel_12 about duplicated update)

Can we push on it to get merged?

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

For the Issue summary update.

quietone’s picture

Status: Needs work » Postponed

This extension is deprecated and scheduled for removal in Drupal 11.

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Project: Drupal core » Activity Tracker
Version: 11.x-dev » 1.0.x-dev
Component: tracker.module » Code
Status: Postponed » Needs work
Related issues: +#2186871: _tracker_remove does not properly update tracker_user and has a redundant db_update for tracker_node