Copying a book does not trigger a webhook event #3420

Closed
opened 2026-02-05 06:39:32 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Mailstorm-ctrl on GitHub (Dec 29, 2022).

Describe the Bug

When you copy a book that's in a shelf and have a webhook active where one of the events is "book_create", the webhook will never fire.

Steps to Reproduce

  1. Make a webhook with the event "book_create" or "bookshelf_update"
  2. Copy a book in a shelf
  3. Observe the webhook never firing

Expected Behaviour

I expect a webhook to be fired to run my scripts to update book permissions

Screenshots or Additional Context

image
image

Browser Details

No response

Exact BookStack Version

22.10.1

PHP Version

7.4

Hosting Environment

Azure App Service Instance

Originally created by @Mailstorm-ctrl on GitHub (Dec 29, 2022). ### Describe the Bug When you copy a book that's in a shelf and have a webhook active where one of the events is "book_create", the webhook will never fire. ### Steps to Reproduce 1. Make a webhook with the event "book_create" or "bookshelf_update" 2. Copy a book in a shelf 3. Observe the webhook never firing ### Expected Behaviour I expect a webhook to be fired to run my scripts to update book permissions ### Screenshots or Additional Context ![image](https://user-images.githubusercontent.com/53045430/209982651-45923868-e7ac-4fb7-87d1-0bba433bdfd7.png) ![image](https://user-images.githubusercontent.com/53045430/209982769-2bce671f-a0b5-4878-a558-d17c794cae93.png) ### Browser Details _No response_ ### Exact BookStack Version 22.10.1 ### PHP Version 7.4 ### Hosting Environment Azure App Service Instance
OVERLORD added the 🐛 Bug label 2026-02-05 06:39:32 +03:00
Author
Owner

@Mailstorm-ctrl commented on GitHub (Dec 29, 2022):

So, this webhook actually just doesn't fire period. I've recreated it and it doesn't even attempt to try any more.

@Mailstorm-ctrl commented on GitHub (Dec 29, 2022): So, this webhook actually just doesn't fire period. I've recreated it and it doesn't even attempt to try any more.
Author
Owner

@ssddanbrown commented on GitHub (Dec 29, 2022):

Copying a book should log a book create activity, and therefore call the webhook action of the same name.

  • Do you see a book-create activity logged in the audit-log/homepage?
  • Do you have a QUEUE_CONNECTION option defined in your .env file at all?
@ssddanbrown commented on GitHub (Dec 29, 2022): Copying a book should log a book create activity, and therefore call the webhook action of the same name. - Do you see a book-create activity logged in the audit-log/homepage? - Do you have a `QUEUE_CONNECTION` option defined in your `.env` file at all?
Author
Owner

@Mailstorm-ctrl commented on GitHub (Dec 29, 2022):

Copying a book should log a book create activity, and therefore call the webhook action of the same name.

* Do you see a book-create activity logged in the audit-log/homepage?

* Do you have a `QUEUE_CONNECTION` option defined in your `.env` file at all?

I do have a QUEUE_CONNECTION in my env:

CACHE_DRIVER=database
SESSION_DRIVER=database
QUEUE_CONNECTION=database

I do see an audit log for the book create but I still don't see the webhook being fired. Even my other webhook for page updates isn't firing.

image
image

I'd like to add that I upgrade everything after submitting this report. Running latest Bookstack version with PHP 8.1. Issue exist still

@Mailstorm-ctrl commented on GitHub (Dec 29, 2022): > Copying a book should log a book create activity, and therefore call the webhook action of the same name. > > * Do you see a book-create activity logged in the audit-log/homepage? > > * Do you have a `QUEUE_CONNECTION` option defined in your `.env` file at all? I do have a QUEUE_CONNECTION in my env: CACHE_DRIVER=database SESSION_DRIVER=database QUEUE_CONNECTION=database I do see an audit log for the book create but I still don't see the webhook being fired. Even my other webhook for page updates isn't firing. ![image](https://user-images.githubusercontent.com/53045430/209996583-5499c565-a90a-4104-8692-080344c5b097.png) ![image](https://user-images.githubusercontent.com/53045430/209996660-363ec7e5-4e4f-4380-86d2-4cc89eac4716.png) I'd like to add that I upgrade everything after submitting this report. Running latest Bookstack version with PHP 8.1. Issue exist still
Author
Owner

@ssddanbrown commented on GitHub (Dec 30, 2022):

I do have a QUEUE_CONNECTION in my env: QUEUE_CONNECTION=database

Yeah, that would do it. With this set to database emails and webhooks will be queued onto the database. A separate service is used to pull these jobs off the queue and action them.

The "Queue Worker Process" part of our webhook docs details the required setup. If that separate service is not running then jobs (webhook and email sends) will just sit on standby. Comment/remove the QUEUE_CONNECTION to go back to normal non-async webhook sending or ensure the queue worker is active.

Just be aware that, if you re-run the queue worker right now it'll send everything queued up (All non-sent emails/webhooks) almost at once. I think you can clear existing queued jobs via php artisan queue:clear.

@ssddanbrown commented on GitHub (Dec 30, 2022): > I do have a QUEUE_CONNECTION in my env: QUEUE_CONNECTION=database Yeah, that would do it. With this set to `database` emails and webhooks will be queued onto the database. A separate service is used to pull these jobs off the queue and action them. The ["Queue Worker Process" part of our webhook docs](https://www.bookstackapp.com/docs/admin/email-webhooks/#queue-worker-process) details the required setup. If that separate service is not running then jobs (webhook and email sends) will just sit on standby. Comment/remove the `QUEUE_CONNECTION` to go back to normal non-async webhook sending or ensure the queue worker is active. Just be aware that, if you re-run the queue worker right now it'll send everything queued up (All non-sent emails/webhooks) almost at once. I think you can clear existing queued jobs via `php artisan queue:clear`.
Author
Owner

@Mailstorm-ctrl commented on GitHub (Dec 30, 2022):

I do have a QUEUE_CONNECTION in my env: QUEUE_CONNECTION=database

Yeah, that would do it. With this set to database emails and webhooks will be queued onto the database. A separate service is used to pull these jobs off the queue and action them.

The "Queue Worker Process" part of our webhook docs details the required setup. If that separate service is not running then jobs (webhook and email sends) will just sit on standby. Comment/remove the QUEUE_CONNECTION to go back to normal non-async webhook sending or ensure the queue worker is active.

Just be aware that, if you re-run the queue worker right now it'll send everything queued up (All non-sent emails/webhooks) almost at once. I think you can clear existing queued jobs via php artisan queue:clear.

I think this is the 3rd time you have pointed that I just can't read.

I remember doing what I was trying to do...then I got pulled away and I completely forgot what I did. So I never did the part where I actually make it work.

Thank you...again!

@Mailstorm-ctrl commented on GitHub (Dec 30, 2022): > > I do have a QUEUE_CONNECTION in my env: QUEUE_CONNECTION=database > > Yeah, that would do it. With this set to `database` emails and webhooks will be queued onto the database. A separate service is used to pull these jobs off the queue and action them. > > The ["Queue Worker Process" part of our webhook docs](https://www.bookstackapp.com/docs/admin/email-webhooks/#queue-worker-process) details the required setup. If that separate service is not running then jobs (webhook and email sends) will just sit on standby. Comment/remove the `QUEUE_CONNECTION` to go back to normal non-async webhook sending or ensure the queue worker is active. > > Just be aware that, if you re-run the queue worker right now it'll send everything queued up (All non-sent emails/webhooks) almost at once. I think you can clear existing queued jobs via `php artisan queue:clear`. I think this is the 3rd time you have pointed that I just can't read. I remember doing what I was trying to do...then I got pulled away and I completely forgot what I did. So I never did the part where I actually make it work. Thank you...again!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3420