504 error in Ghost when attempting to add Stripe API key

Hello all

I have just added Ghost to my yunohost install. Big thanks to @tituspijean for fixing the package!

I’m going through the setup/config steps in Ghost, and have come across at nginx 504 error when attempting to contact Stripe.

My YunoHost server

Hardware: Old computer - Mac Mini circa 2014
YunoHost version: 11.2.3 (running on VM via VirtualBox)
I have access to my server :

  • Through SSH
  • through the webadmin (currently hanging)
  • direct access via keyboard / screen (currently hanging)

Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

What you are trying to achieve
I am trying to configure Ghost running on Yunohost to accept my Stripe secret key.

The context

  • When I click on the ‘I have a stripe account’ button, this dialog opens:

What I tried
See below

Attempt 1

When I click on the ''I have a stripe account" button, I get a 504 nginx timeout error at this url:

https://mydomain.tld/ghost/api/admin/members/stripe_connect/?mode=live

Attempt 2

I tried signing into my Stripe account manually, and creating a custom API key for Ghost.

When I paste the custom api key into text box, I get an error stating its invalid. I’m guessing this is because the Ghost didn’t directly request it from Stripe.

My questions are:

  • Is anyone else having the same issue, and if so, how have you resolved it?

  • Is it likely increasing the timeout duration in the nginx .conf file will allow Yunohost to chug away and eventually be successful at the stripe integration?
    It only needs to be done once, or rarely at least. So a slow time to complete is not a big deal.

  • Is there a way to get a manually created API key in Stripe to be recognised by Ghost on Yunohost?

Thanks for reading! :rainbow:

Please reply if you have hunches about how I can stop the hung process.

Bump Has anyone else had this issue? Or something related? :crossed_fingers:

Hello,

I was able to replicate your issue, I think. Can you confirm that you see the following error in the Ghost service logs right after triggering the timeout?

Cannot connect to stripe unless site is using https://

(which well… is non-nonsensical since the site is indeed on https)


Edit: found the issue. Fix incoming.

Fix : Upgrade to v5.75.3 and fix Stripe integration by tituspijean · Pull Request #297 · YunoHost-Apps/ghost_ynh · GitHub

To be tested with sudo yunohost app upgrade ghost -u https://github.com/YunoHost-Apps/ghost_ynh/tree/testing -F

Hi @tituspijean

Thank you! Will test in the coming days and let you know the result.


Edit: I updated Ghost successfully using the prompt you suggested.

The stripe error still persists, as documented above. After update when I tried to connect Stripe I got a 504 timeout.

Any ideas on what to do/try next?

1 Like

I found this, re Stripe and Ghost…

Is it a clue or a red herring?

Damn, that does not sound right. Can you check that the URL returned by the following command is indeed with https?

sudo grep http /var/www/ghost/ghost/config.production.json

Just checked.

Nope, its under http. The command you suggested returned:

"url": "http://mydomain.tld/"

Would it be safe to add a force https line in my default YH nginx config file?

I’m thinking next I will try to add this line:

    return 301 https://mydomain.tld$request_uri;

At this location:

/etc/nginx/sites-available/default

But if there is a better/safer option, please let me know! :smiley:

Nope, that would not help, it’s a simple misconfiguration. Run the upgrade command again, I think I fixed it.

And please do make this kind of hacks, especially with NGINX. :sweat_smile:

Success! I was able to connect Ghost with Stripe. Thank you @tituspijean

And please do make this kind of hacks, especially with NGINX. :sweat_smile:

Erm, I would love to not have to. I’m currently dangerously tinkering with nginx with not enough knowledge (see here: Yunohost package 404 on admin page after first successful install - #4 by nqo). This is to try to get the YNH Processwire package to work. :grimacing:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.