Invalid Api Key error

Hi, A user tried to install our app and we see these error in our logs: unable to get discountNodes resource "errors": "[API] Invalid API key or access token (unrecognized login or wrong password)" unable to list resource GGT_SHOPIFY_AUTHENTICATION_ERROR: Unable to list recurring application charges for shop Would you know what these mean? I am not sure if this is related to Gadget or not?
22 Replies
Chocci_Milk
Chocci_Milk•8mo ago
Hello, This would be a permissions issue related to discounts. Have you added the appropriate scopes in the conneciton and made sure to reauth? You might need special permissions and the store might need to be plus in order to query discount nodes
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Hi Antoine, Other users are able to download and use the app. Only this particular user is facing this issue.
Chocci_Milk
Chocci_Milk•8mo ago
Do you know what plan their store is?
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
oh sorry most of our customers have a plan called "Shopify". I see only this one as "Basic"
Chocci_Milk
Chocci_Milk•8mo ago
I think that the plan might be the issue. That would be a question for the Shopify docs and support though. I don't know what plans get what functionality
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Got it. Thanks so much for helping me reach this point.
Chocci_Milk
Chocci_Milk•8mo ago
No problem!
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
My app is integrated with Mantel and integrated Mantel recorded and user and saw install as activated So far it seems even basic plan should have been able to use the app 😕 Would it be possible for you Antoine to check if there is any more information on this Traceid - d301c7f85242e70d4974db9059dd2885 One direction from community was to check this - "Are you certain this merchant’s API key is correct? One potential issue is if the merchant uninstalled and then later reintalled, but your app kept their old token and didn’t overwrite it with their new one." But merchant has uninstalled the app so I dont have any way to check now. would be able to check this?
Chocci_Milk
Chocci_Milk•8mo ago
The Mantel integration wouldn't have anything to do with access to the Shopify API. Did you look at the planName field on the shopifyShop record? There would be no way for the Gadget platform to keep the api key or accessToken as the incorrect one. We nullify auth related fields on uninstall. Let me take a look at the trace and your app. Whats the id of the shop?
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Thanks, The app is https://buymore.gadget.app/
Chocci_Milk
Chocci_Milk•8mo ago
Whats the id of the shop?
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
68984733948
Chocci_Milk
Chocci_Milk•8mo ago
Did they uninstall after this error? The application seems to be uninstalled on their store
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Yes, they uninstalled and are not responding now to us but I see these errors in the logs and am assuming they uninstalled because of this
Chocci_Milk
Chocci_Milk•8mo ago
I can't really dig into this if we don't have the state in which the issue happened. Could you try installing your production application on a dev store to see if you can reproduce this?
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Yep checked that already. Created another store as well to check and that also works 🙂 There is something specific to this store most likely..
Chocci_Milk
Chocci_Milk•8mo ago
Its definitely possible
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Checking with Shopify as well. Will post if I find something there Thanks
Chocci_Milk
Chocci_Milk•8mo ago
No problem! Please let us know what you find Hmmm, looking at the logs in our backend I saw that they also had the issue for querying products. That just seems like there was something wrong on their end with auth. Might be a good idea to delete their shop record in case something with the record information caused issues with auth on our end as well
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
Okay.. so I think this is the issue 1/30/2025, 7:50:32 PM - App install and shop sync starts automatically 1/30/2025, 7:56:02 PM - shopifyProduct is getting synced 1/30/2025, 8:04:09 PM - We see GGT_SHOPIFY_AUTHENTICATION_ERROR: Unable to query products for shop thepetscz.myshopify.com (68984733948): Response code 401 (Unauthorized) 1/30/2025, 8:04:33 PM - I got an email that they uninstalled from hey mantle which means that must have started uninstall a little back I read below on - https://docs.gadget.dev/api/example-app/development/errors#ggt_database_not_ready GGT_SHOPIFY_AUTHENTICATION_ERROR This error is thrown when we receive 401 Unauthorized when accessing Shopify on your behalf. This can happen when we sync a shop that has uninstalled your app. To remedy this, you can click the "Mark As Uninstalled" button next to the affected shop on the shop installs page. So is if a fair understanding then that errors occured because they uninstalled before sync completed and there is no issue with any system 🙂
Chocci_Milk
Chocci_Milk•8mo ago
Its definitely possible Based on the timeline, thats totally possible
Gaurav Agarwal
Gaurav AgarwalOP•8mo ago
I would have liked if you would have said "Yes thats it" so I can relax hahaha 😄

Did you find this page helpful?