-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
OrderUpdatedJob and OrderCreatedJob is not firing. #232
Comments
@tariqbilal do you have the correct scopes for the webhooks? You will need to be able to Can you also share your config file with the webhook array so I can see the format of it. |
@Kyon147 yes, I have added all the scopes. I am sharing the config file
|
@Kyon147 I have also flushed my queues and restarted it. Lastly I have not set any variables in .env just the |
What have you set the We do only install webhooks on authenticate I believe from memory. So you might not to go back through the |
SHOPIFY_WEBHOOK_1_ADDRESS=https://20b4-2407-aa80-116-93e8-e0ad-a5a4-5ac4-b3d9.ngrok-free.app |
root@5fcd19010dcd:/var/www# php artisan queue:work INFO Processing jobs from the [default] queue. 2023-11-12 19:32:01 App\Jobs\ProductsUpdateJob ................................................................................................................................................................................... RUNNING |
@tariqbilal I can see you are using the free ngrok. Does this URL changes each time you run the ngrok cli? |
@Kyon147 yes correct, the URL changes everytime I turn it on for development. My normal practice is I turn on NGROK. |
@Kyon147 I have also deployed on server again same issue, I fired the orderUpdated queue but it's still not fired root@wordpress-ubuntu-s-1vcpu-1gb-ams3-01:/var/www/orders_analytics# php artisan queue:work INFO Processing jobs from the [default] queue. 2023-11-13 17:40:36 Osiset\ShopifyApp\Messaging\Jobs\WebhookInstaller ............................................................................................................................................................ RUNNING |
@tariqbilal webhooks can be easily dropped off due to set up errors or incorrect set up on local. If you are using ngrok free and the url keeps changing, you probably have multiple webhooks registered under older urls which could also be a problem. Have you tried receiving webhooks on a proper production-like environment? Local development for webhooks can be unreliable. I've not seen any issues with webhooks recently with the package and v19 added in a new scopes middleware that makes sure to check if api_scopes have changed as the package did not auto push to I'd check to make sure that your app has this middleware on the app routes and see if the app have the correct and most up to date permissions. |
@Kyon147 thank you so much for the response. I have also tested on server. My domain was static this time https://analytics.craftconcept.co But again other jobs work but orders jobs are not working. I am curious about this issue as I have shown you my configuration too. Any help would be great as for now I have to run cronjobs to get the orders data but webhooks need to work as it will be much better solution for my app. I would love to provide more information if we can diagnose this. |
Have you tried outputting what webhooks have been set up in your app? Can you check using the webhook api endpoint and check to see if indeed you have a webhook registered? |
You likely need to go to API access against your app and allow it to access customer protected data, otherwise you'll be getting this error silently: "This app is not approved to subscribe to webhook topics containing protected customer data.". This module does not handle errors that are returned from GraphQL for failed webhooks subscriptions currently. |
@matthewhaworth that is great point - we should handle this better if we can. I'll take a look to see if we should throw an exception |
@Kyon147 @matthewhaworth let me try accessing it but as I am still in development mode plus I have filled the form to get protected customer data. That is why I can still hit the order api and fetch the data from /admin/api/2023-10/orders.json Problem is webhook isn't firing even after registering the app. If I am not wrong api won't return if the scope wasn't added already. |
@tariqbilal, if you're able to hit the API, try hitting As a quick 'hack', if you find the webhook isn't registered, you can put |
@matthewhaworth thanks for the response this one is a tricky issue. I have hit the I am pasting the response. I am getting convinced it's a bug which we have to fix.
|
@tariqbilal if the webhook has been registered which is looks like it is, then the package is sending the request to create the webhook as intended. What have you called your Job which is meant to handle this webhook? From your config it should be called This might be your issue as mentioned in the wiki. |
@tariqbilal did this fix your issue? |
@Kyon147 no the issue has not been resolved and in my first comment I misspelled the job but the job is called |
@tariqbilal i've updated one of my apps which I know order create / update works to the latest version of this package. I can still get order webhook events coming through for an installed store and a new store on the app. So I feel at the moment this might be an issue with your set up rather than a package one until I get more information as I can't replicate it. |
@Kyon147 this is strange. I have followed all the steps provided in the documentation. Should I install a new app and try again? What information do you think I can provide more so we can reach to the bottom of this. I will provide all the details. |
@tariqbilal have you tried a new shop install on the app - then seeing if that store can trigger the webhooks? |
@Kyon147 I can try that and see if things work. Will update you on this. |
Its not working, not sure what it is missing, app uninstall webhook is firing, but after orders create webhook not firing, I am trying to get the webhook once user placed the order in shopify and needs to get the order id in webhook with order details, Any other way i can try ?? Any suggestion |
@Kyon147 I have tested on multiple stores and I can confirm, the orders jobs are working perfectly fine, I believe it would be a reason for webhooks being attached to ngrok. I am testing on server and it works great. Do you think should I use ngrok for local development? @sumantaakeans2020 please try to reinstall again on the store jobs do work and try to copy my configurations which is in this thread. |
@tariqbilal ngrok is fine to use most of the time, but as you are still pushing them to local sometimes there can be issues which you've seen. I use ngrok (paid version) now mainly for app development locally, as it is much more consistent and you can have a single static url which makes testing webhooks a lot easier. Glad you managed to get it sorted though 👍 |
@tariqbilal my package version is 19.1, reinstall means i means i needs to reinstall the package again or create the order job again like running this php artisan shopify-app:make:webhook OrdersCreateJob orders/create and about the config i verified it same only as per your one. now i am running laravel code in server. So please suggest what to do? Thank you |
@sumantaakeans2020 I think @tariqbilal means reinstall the app on your store that you are testing with. |
@Kyon147 Yes tried same already but not luck, i dont know now how i will debug try to fix this or any other way i can get the webhook respose?? |
@sumantaakeans2020 please share your configurations. check if the webhooks are connected already or not. |
Here is my Configuration return [
]; |
@Kyon147 @tariqbilal i tried to call /admin/api/2023-10/webhooks.json and i saw only one webhook i.e app/uninstalled one, so i how i can register the order webhook?? so i think this is the issue |
@sumantaakeans2020 I can clearly see you have added alot of scopes. Better to start with less scopes registered and also you have registered orders create webhook two times. Why is that so? |
@tariqbilal thanks for reply, i used other scopes because i need for some other purpose, but i used one create orders not which one you are saying as two, i used one for read and other is for write. |
@Kyon147 @tariqbilal hi any idea why webhook is not registering ? |
@sumantaakeans2020 webhooks are registered on /authenticate - so you probably need to go through the If they still are not registering, then you probably don't have the right permissions to set them and will need to investigate why. I plan to add some better error capturing in the webhook installer but I don't have an ETA so you will need to look yourself for the time being. |
@Kyon147 Ok thanks for your response, actually i uninstalled and reinstalled the app again but still its not registering |
@Kyon147 Were you able to resolve this situation? I have the same problem with OrdersCreateJob and I don't know how to solve it. |
There is no issue the package I could find for the webhooks, they all work as expected on my apps and spinning up a test one. Check your app permissions and also make sure you have the correct Customer Protected Data permission from Shopify for the fields. |
Hi @brunocoelhosilva package works great, most of the time issue is with the permissions or you have to reinstall the app. I have published a few apps after I raised this issue and all of them work great. |
The OrdersUpdatedJob and OrdersCreatedJob are not functioning as expected, while other jobs like ProductCreateJob and ProductUpdateJob are working fine. The jobs were created using the following commands:
OrdersUpdatedJob: php artisan shopify-app:make:webhook OrdersUpdateJob orders/updated
OrdersCreatedJob: php artisan shopify-app:make:webhook OrdersCreateJob orders/create
These jobs have been successfully created in a Laravel project with the specified versions and setup. However, the events associated with OrdersUpdatedJob and OrdersCreatedJob are not triggering. There are no logs generated, and the webhook is not firing.
Setup Information:
The text was updated successfully, but these errors were encountered: