Cannot disconnect while there are members with active Stripe subscriptions

Hello again,
I have a big problem this time.

Url: private
Ghost version:

  • Version 3.22.1
  • Environment production
  • Database mysql
  • Mail SMTP

I updated Ghost to the latest version today, and I realized that Stripe Connect was implemented, so what was configured before was no longer active.

So before moving to the live version, I activated the test-mode check, and I authorized Stripe Connect with Ghost, everything was activated correctly.

I made a test payment and it turned out to be successful.

So I wanted to switch to the live version, by deactivating the test-mode. I try to click on “Disconnect” and find the following error:

Connected to ***** Test mode
Cannot disconnect while there are members with active Stripe subscriptions.

I logged in with the account with which I did the test, from the profile I clicked on “cancel subscription” and I tried again to disable the test-mode by clicking on “Disconnect”, but without success.

I connected to the Stripe Dashboard, I deleted the test data, then I tried again from the Ghost panel to disconnect Stripe but I still have not succeeded, always the same error.

So it looks like from Stripe I have revoked the Ghost application permission and tried once again, but nothing.

Therefore:

  • I deleted Stripe’s test data
  • I have revoked permission from Stripe of the Ghost application
  • I deleted the test user from Ghost.
  • I also canceled customers from the Live version of Stripe (they were my tests with real payments)

So now on Stripe I have neither customers nor live subscriptions nor test.

The main problem is that now even paid subscription does not work anymore on my site as Stripe no longer has Ghost permissions, and I can’t even give them anymore.

I thought about restarting Ghost, but I have about 2k daily users, I am afraid that some errors do not allow the correct restart and the site remains offline.

Maybe it is somehow related to this problem I previously had?

Now if I try to delete these users I get the following error:

PUT https://domain.it/ghost/api/v3/admin/members/***********/?include=labels 401 (Unauthorized)

I guess because I revoked Ghost’s permissions from the Stripe Dashboard

One solution that comes to mind is to delete all users associated with Stripe in some way, from the database with a mysql query. I have no real active paying users, so it’s something I could do.

Hoping that later I will be able to click on “disconnect” and re-associate the permissions.

updated Ghost to the latest version today, and I realized that Stripe Connect was implemented, so what was configured before was no longer active.

This was an incorrect assumption. Your old API keys were still there, we’re just adding a new UI to get people to swap to connect.

I realise you’re now in a weird state, and we’ll consider whether we need to change the logic. In the meantime you’d need to go into your database and manually delete the 2 stripe connect keys from the settings table.

When you do that, the old API key method will become active again until you reconnect Stripe connect.

Thanks to the immediate response.

I was definitely wrong to consider the old configuration no longer active. I assumed it was disabled as it asked me to enter the key, there is no icon or text indicating that the previous one was still active

Strange however is that I could not “Disconnect” after having canceled the subscription - deleted the test data - deleted the user - revoked the permissions etc. Maybe I made a few mistakes.

In any case, would you be kind enough to help me create the right query to use in the terminal? I would absolutely not want to make a mistake again.

Sure thing.

Can you share the output from

select `key` from settings;

Just so I can check the state of your db? This is keys only - no sensitive data.

yes, already doing it! I believe this is the information you need, otherwise I can send you all the output of the query you sent me: https://paste.notify.me/ayikagunam.md

EDIT
this is your request: https://paste.notify.me/hilukayobe.rb

The query I used is:

update settings set `value` = NULL where `key` LIKE 'stripe_connect%';

After running this:

  • restart Ghost
  • refresh Ghost admin

Connect settings should be blank and you should be able to reconnect.

1 Like

I did as you said: query → restart Ghost → I was able to reconnect:

When I try to checkout I encounter the following error:

Shouldn’t my address be on Stripe among the authorized apps, instead of ghost.org?

Json response:

{
  "errors": [
    {
      "code": null,
      "context": null,
      "details": null,
      "help": null,
      "id": "***********************",
      "message": "Resource not found",
      "property": null,
      "type": "NotFoundError"
    }
  ]
}

Any updates regarding the possibility of deleting users on Ghost associated with Stripe, but no longer existing in Stripe?

I have the same error “Cannot disconnect while there are members with active Stripe subscriptions.”

Did it work out @giacomosilli ?

EDIT : it worked with Hannah’s query update settings set value= NULL wherekey LIKE 'stripe_connect%'; + ghost restart

update settings set value = NULL where key LIKE ‘stripe%’;

Will disable Stripe for this error:

Message: Ghost was able to start, but errored during boot with: Cannot run Ghost without SSL when Stripe is connected. Please update your url config to use “https://”.