Subscription and logins not working - how can I fix this error?

Hi,

I am having problems with users subscribing or logging in. (these are not real users, they are just users I created to use as tests while developing the blog). They used to work perfectly fine, but I can no longer log in this morning and subscribe.

This is my system:

URL: https://blog.jaytelford.me 

stored @ /var/www/blog
dir permissions: drwxr-xr-x 4 jay:jay  

Nodejs: v16.18.1
Ghost-CLI version: 1.23.1
Ghost version: 5.25.2

MySQL: 8.0.31

OS: Ubuntu 22.04.1 LTS - 5.15.0-56-generic

My DNS provider is Cloudflare.

Here is a screenshot of what ghost reports as its setup:

My Ghost Config - with some redacted info that I have tested and know works:

{
  "url": "https://blog.jaytelford.me",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "redacted",
      "password": "redacted",
      "database": "redacted"
    }
  },
  "mail": {
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 465,
      "secure": true,
      "auth": {
        "user": "redacted",
        "pass": "redacted"
      }
    }
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/blog/content"
  }

Here are the results from Ghost Doctor that shows everything is working correctly:

✔ Checking system Node.js version - found v16.18.1
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-jaytelford-me
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.18.1

As you can see from all the ticks, the configuration is correct.

Everything seems to be perfectly fine settings-wise. The blog loads, I can log in to the admin panel, and I can even log in as one of my test users if I “impersonate” them with the link acquired from the admin panel. However, I can not log in as the user directly. Doing so gets me this error.

Trying to subscribe also gives an error message that says “unable to send magic link, please try later”. I can not get a screenshot of that message as it disappears quickly.

I have logged in to the admin panel and checked, and the test user I tried to subscribe with does not show there. I also checked my database, and it was not entered into the database either.

I thought I was ready to start scheduling content to be posted, but it is no good if users can’t subscribe or login.

Does anybody know what the problem might be and how to solve it? I have tried everything I can think of, including stopping ghost, running “ghost setup” to regenerate the various files and restarting ghost.

Nothing seems to work.

Thanks for your help, as I am very stuck on this problem.

– edit: corrected wording

Try changing your SMTP config to port 587.

  "mail": {
    "from": "noreply@martinwebster.uk",
    "transport": "SMTP",
    "options": {
      "host": "smtp.eu.mailgun.org",
      "port": 587,
      "service": "Mailgun",
      "secure": false,
      "requireTLS": true,
      "auth": {
        "user": "postmaster@mg.jaytelford.me",
        "pass": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxx-xxxxxxxx"
      }
    }
  },

Hi,

Thanks for your reply. Changing the config to match your suggestion worked. I then tried to change it back to what I had, and it stopped working again.

It seems that Mailgun does not want me to use port 465, so I have made the changes again, and this time will leave it as using 587 and requiring TLS.

Not sure why I am having this problem, but changing the port and security protocol used for SMTP worked.

Thanks.

1 Like

Great to hear it’s working for you.

Incidently, I had the same problem a year or so ago. However, using port 587 is the way to go, since port 465 is depreciated and will be dropped.