Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thank Reviewer action crashes on main #10388

Closed
jardakotesovec opened this issue Sep 11, 2024 · 8 comments
Closed

Thank Reviewer action crashes on main #10388

jardakotesovec opened this issue Sep 11, 2024 · 8 comments
Assignees
Labels
Bug:2:Moderate A bug that is causing problems for a substantial minority of users. Try Me This issue might be good for a new contributor. Can you help us?
Milestone

Comments

@jardakotesovec
Copy link
Contributor

Describe the bug
After the review is confirmed, its possible to thank to reviewer. This action is now resulting in 500

To Reproduce
Steps to reproduce the behavior:

  1. Go to Submission, which has confirmed review
  2. Click on 'Thank Reviewer'
  3. Click on 'Thank Reviewer' button to confirm the action
  4. See error
[Wed Sep 11 14:39:54 2024] PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:160
Stack trace:
#0 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(160): serialize(Object(APP\jobs\orcid\DepositOrcidReview))
#1 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(129): Illuminate\Queue\Queue->createObjectPayload(Object(APP\jobs\orcid\DepositOrcidReview), 'queue')
#2 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(107): Illuminate\Queue\Queue->createPayloadArray(Object(APP\jobs\orcid\DepositOrcidReview), 'queue', '')
#3 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/DatabaseQueue.php(92): Illuminate\Queue\Queue->createPayload(Object(APP\jobs\orcid\DepositOrcidReview), 'queue', '')
#4 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Queue/Queue.php(59): Illuminate\Queue\DatabaseQueue->push(Object(APP\jobs\orcid\DepositOrcidReview), '', 'queue')
#5 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(247): Illuminate\Queue\Queue->pushOn('queue', Object(APP\jobs\orcid\DepositOrcidReview))
#6 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(230): Illuminate\Bus\Dispatcher->pushCommandToQueue(Object(Illuminate\Queue\DatabaseQueue), Object(APP\jobs\orcid\DepositOrcidReview))
#7 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(77): Illuminate\Bus\Dispatcher->dispatchToQueue(Object(APP\jobs\orcid\DepositOrcidReview))
#8 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php(193): Illuminate\Bus\Dispatcher->dispatch(Object(APP\jobs\orcid\DepositOrcidReview))
#9 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(413): Illuminate\Foundation\Bus\PendingDispatch->__destruct()
#10 /Users/jarda/git/pkp/pkp-main/ojs-main/classes/orcid/actions/SendReviewToOrcid.php(25): dispatch(Object(APP\jobs\orcid\DepositOrcidReview))
#11 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/controllers/grid/users/reviewer/form/ThankReviewerForm.php(128): APP\orcid\actions\SendReviewToOrcid->execute()
#12 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/classes/controllers/grid/users/reviewer/PKPReviewerGridHandler.php(867): PKP\controllers\grid\users\reviewer\form\ThankReviewerForm->execute()
#13 [internal function]: PKP\controllers\grid\users\reviewer\PKPReviewerGridHandler->thankReviewer(Array, Object(APP\core\Request))
#14 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/classes/core/PKPRouter.php(329): call_user_func(Array, Array, Object(APP\core\Request))
#15 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/classes/core/PKPComponentRouter.php(265): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array)
#16 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/classes/core/Dispatcher.php(158): PKP\core\PKPComponentRouter->route(Object(APP\core\Request))
#17 /Users/jarda/git/pkp/pkp-main/ojs-main/lib/pkp/classes/core/PKPApplication.php(392): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#18 /Users/jarda/git/pkp/pkp-main/ojs-main/index.php(21): PKP\core\PKPApplication->execute()
#19 {main}

What application are you using?
OJS, OMP or OPS version 3.5

@jardakotesovec jardakotesovec added Try Me This issue might be good for a new contributor. Can you help us? Bug:2:Moderate A bug that is causing problems for a substantial minority of users. labels Sep 11, 2024
@jardakotesovec jardakotesovec added this to the 3.5 Internal milestone Sep 11, 2024
@asmecher
Copy link
Member

@ewhanson, I think this is related to your recent work on ORCiD?

@ewhanson ewhanson self-assigned this Sep 11, 2024
@ewhanson
Copy link
Collaborator

@asmecher, I'll have a look!

@ewhanson
Copy link
Collaborator

I did a bit of digging and it appears that including the submission in the job while it's being serialized is what's causing the issue. My best guess is that the publications are a LazyCollection which has/is a closure. I'm not sure why it would only be affecting this job, though. @asmecher, are there any other jobs that aren't serializing correctly now that include submissions in them? Are there any recent changes that may have led to this?

@ewhanson
Copy link
Collaborator

I did some more digging and it is, indeed LazyCollections that are causing the issue. This should be affecting other jobs as well.

@ewhanson
Copy link
Collaborator

So it seems the Laravel solution is to use the SerializesModels trait on for Eloquent models which won't help here. @asmecher, in this case, do you think it would be better to just serialize the Submission ID and and load the submission once the job is actually run? I suppose it's possible the submission could change in the meantime, but I'm not sure about any other approaches.

@asmecher
Copy link
Member

In general, I would recommend that we try not to duplicate data by serializing model details with jobs. We should store IDs and include some sanity checks when the job/invitation starts processing to handle some basic cases where the database has changed in the meantime (e.g. submission deleted).

@ewhanson
Copy link
Collaborator

Sounds good. I'll get this and any other ORCID jobs updated.

ewhanson added a commit to ewhanson/ojs that referenced this issue Sep 12, 2024
@ewhanson
Copy link
Collaborator

ewhanson commented Sep 12, 2024

ewhanson added a commit to ewhanson/pkp-lib that referenced this issue Sep 12, 2024
ewhanson added a commit to ewhanson/pkp-lib that referenced this issue Sep 12, 2024
ewhanson added a commit to ewhanson/ojs that referenced this issue Sep 12, 2024
ewhanson added a commit to ewhanson/pkp-lib that referenced this issue Sep 12, 2024
ewhanson added a commit to ewhanson/ojs that referenced this issue Sep 12, 2024
ewhanson added a commit to pkp/ojs that referenced this issue Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug:2:Moderate A bug that is causing problems for a substantial minority of users. Try Me This issue might be good for a new contributor. Can you help us?
Projects
None yet
Development

No branches or pull requests

3 participants