Skip to content

Conversation

@SystemKeeper
Copy link
Contributor

Summary

After updating to NC32, I noticed that cronjobs would not end anymore. Checking the DB revealed:

+----+----------------------------------------------+----------+------------+--------------+-------------+--------------------+------------------------------------------------------------------+----------------+
| id | class                                        | argument | last_run   | last_checked | reserved_at | execution_duration | argument_hash                                                    | time_sensitive |
+----+----------------------------------------------+----------+------------+--------------+-------------+--------------------+------------------------------------------------------------------+----------------+
|  5 | OCA\Files_Trashbin\BackgroundJob\ExpireTrash | null     | 1758741001 |   1758741001 |  1758741001 |               1800 | 74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b |              1 |
+----+----------------------------------------------+----------+------------+--------------+-------------+--------------------+------------------------------------------------------------------+----------------+

There seems to be no exit condition, so we loop over all users for 30 minutes. From the mysql log:

# grep background_job_expire_trash_offset /tmp/mysql.log 
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '20', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '30', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '40', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '50', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '0', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '10', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '20', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '30', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '40', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '50', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '0', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '10', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '20', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')
		531567 Query	UPDATE `oc_appconfig` SET `configvalue` = '30', `lazy` = 0, `type` = 8 WHERE (`appid` = 'files_trashbin') AND (`configkey` = 'background_job_expire_trash_offset')

The original PR is about parallel runs, we might need a different check in that case, not totally sure.

Checklist

Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@SystemKeeper SystemKeeper added this to the Nextcloud 33 milestone Sep 24, 2025
@SystemKeeper SystemKeeper self-assigned this Sep 24, 2025
@SystemKeeper SystemKeeper requested a review from a team as a code owner September 24, 2025 19:53
@SystemKeeper SystemKeeper requested review from come-nc and yemkareems and removed request for a team September 24, 2025 19:53
Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@solracsf
Copy link
Member

/backport to stable32

@AndyScherzinger AndyScherzinger merged commit edcae5b into master Sep 25, 2025
198 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/noid/exit-expire-trash-backgroundjob branch September 25, 2025 07:15
@backportbot
Copy link

backportbot bot commented Sep 25, 2025

The backport to stable32 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable32
git pull origin stable32

# Create the new backport branch
git checkout -b backport/55290/stable32

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 58440bfc

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/55290/stable32

Error: Failed to push branch backport/55290/stable32: remote: {"auth_status":"auth_error","body":"Invalid username or token. Password authentication is not supported for Git operations."}
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@AndyScherzinger
Copy link
Member

/backport to stable32

@solracsf
Copy link
Member

Since the original PR was backported to 31 and 30, should this be backported too (to 31 at least) ?

@SystemKeeper
Copy link
Contributor Author

/backport to stable31

@SystemKeeper
Copy link
Contributor Author

/backport to stable30

@SystemKeeper
Copy link
Contributor Author

/backport to stable31

@nextcloud nextcloud deleted a comment from backportbot bot Sep 25, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants