Server Error During App Installation Redirect

Hi everyone,

I’m facing a serious issue with my Shopify app. During the installation process, when users are redirected, a server error sometimes occurs. This error may prevent users from completing the full initialization flow, leading to app uninstalls.

The biggest challenge is that I’m unable to capture and send this error to my server, making it difficult to diagnose the root cause. Interestingly, I haven’t encountered any systematic errors when testing in my local environment.

Has anyone experienced a similar issue? Are there any best practices or potential solutions to prevent or resolve this problem? Any insights would be greatly appreciated!

Thanks in advance!

Hey @allen :wave: - I’m from the Shopify Dev Support team.

It’s a little tricky to diagnose an issue without direct logs like you said (we usually request X-Request-ID values from the API response headers since this lets us grab exact call logs), but if you’re able to share/grab an example of the issue happening and can share some details like the Shop ID where it happened, your app’s ID and a timestamp (down to the second if possible).

Generally, the most common cause for an error during app installation would be authorization info not being passed over correctly during token creation/exchange (for example if you’re creating a custom app for merchants), but if we can track down a specific example, I’d be able to say for sure. We would usually expect to see a 400-level error though in those instances, so if you’re seeing 5xx errors, that would be odd.

@Alan_G I’m running in to the same issue during installation on Mobile.

Please see attached screenshots and logs on our end that show that show the URL we sent to shopify for installations. I’ll DM you the shopid in question.
In Shopify Mobile App after clicking on + button (Apps) opens up the app store on safari. Seaching for the app and click the install button.

Clicking install button opens the shopify app where a blank screen appears in place of the consent screen.

Backend logs show verify that the user is redirected to the URL (will DM you the exact store details)
https://mystore.myshopify.com/admin/oauth/authorize?grant_options[]=value&response_type=code&redirect_uri=https%3A%2F%2Fvideoselz.gadget.app%2Fapi%2Fconnections%2Fauth%2Fshopify%2Fcallback&scope=read_customer_events%2Cwrite_files%2Cwrite_metaobject_definitions%2Cwrite_pixels%2Cwrite_products&state=JYd_XUZpzpnatP5ctB...&client_id=7ad274151c81979a569fea448ae77

Couldnt find a way to DM here Profile - Alan_G - Shopify Developer Community Forums

So here you go with the shopid 90511114539

Hey @Yash_Ranadive :waving_hand: - sorry about the wait here. I think I was able to replicate this - just to confirm, you’re only seeing this happen on mobile?

What I saw on my end was that initially, after trying to install the app on my Android phone via Chrome, I was taking to an authentication URL and the installation seemed to fail (I saw an error that read “Unexpected error has occured” in a red pop up box).

Once I retried the installation again from the App Store though, it seemed to work. I think my next step will be to touch base with our developers to investigate further, but I just wanted to confirm this is what you/your users are seeing as well.

Hope to hear from you soon - we’ll get this looked in to.

So far yes. We’ve seen this happen only on mobile @Alan_G . We see installation from desktop works fine.

There is very likely a bug in the link generated by the Shopify App when clicked on the “+” button next to the app. Or if that’s not the place, then there is a problem rendering the webview in the Shopify App itself. I think it

It is possible that I’m part of some holdout group experiment that’s why this is not widely reported yet. Just my guesses. The developers will know more. Please let me know if I can provide more data.

The final step in the pre-consent OAuth flow is for the app to send the scope etc. back to Shopify which we do. So it is definitely not a problem on our app’s end. Also, since install works from desktop, there’s further more evidence that there is a corner case bug introduced somewhere.

Many thanks @Alan_G for looking in to this.

Many shop owners exclusively run their business on the Shopify Mobile app - and I personally saw one store owner after another (4 in total) get this screen while they tried to install.

Thanks for confirming @Yash_Ranadive and no worries- I tried uninstalling the app and reinstalling it again to see if I could trigger the error on my phone, but it seems to work - is this just happening intermittently for you/your merchants?

I think that’s the last bit I’d need to confirm with you, once I have that info just to see if you’re able to determine any patterns where the error is popping up, I’ll reach out to our developers and loop back with you here when I have more info.

So far we’ve seen it happen on ALL new stores that have NEVER installed the app before.

You will need a store that has never installed the Videoselz app before.

In summary, to replicate the issue:

  1. Open the Shopify app and make sure you’re in the store where you want to install the app.
  2. Tap 3 dash menu
  3. Click + next to apps to get redirected to the app store.
  4. Search for videoselz
  5. Tap Install
  6. The shopify app will now open

Expected Behavior: The loading icon appears momentarily and then consent screen shows up.

Observed Behavior: The loading icon appears momentarily and then blank page shows up.

@Alan_G let me know if you have more questions.

@Alan_G friendly ping on this. Many thanks.

Thanks, Alan. Through customer feedback, we found the problem. It was some Chrome plugins that caused our code to fail to load.

1 Like

No worries @allen - sorry about the late reply on this (I was out for the weekend), I’m glad to hear this is all fixed though!

@Yash_Ranadive - are you still seeing the same issue ( I think it may be different than what Allen mentioned here)? If so, could you let me know if the issue persists if you install the app after clearing your mobile browser’s cache/cookies (I think we redirect to the mobile browser to install the app even after the install is triggered within the Shopify app itself). I’m wondering if it’s related to the cookie/cache settings on mobile.

@Alan_G Yes this happened as early as Saturday. I also have a video that shows a merchant getting the blank consent screen during installation on mobile. LMK if you’d like me to send it to you. For some merchants installation works as you’d expect. But for others it doesn’t work at all.

Could it be because they might not have 2 fac authentication setup? I know at least 1 merchant that did not have 2fac setup that got the blank consent screen.

mobile browser’s cache/cookies

Do you mean the mobile browser inside the shopify app? I reckon there’s a webview that opens in the shopify app that shows the consent screen. I’m not sure how to clear the cache/coookies for the inbuilt shopify browser - any idea on how I can do that?

Hi @Yash_Ranadive - that video would be great! I’ll follow up with you in DMs shortly here so that you can share that with me there and we can look into this further (just want to be cautious about sharing specific merchant info publicly :slight_smile: )