Unable to log into admin page

I self host ghost with docker and it’s been working with no issue. The site is accessible from the internet, the page content loads, no browsing errors at all. Have never had issues with connectivity. However…

I haven’t added anything to my ghost blog for a bit, but I decided to log in and work on a new post. However, when I try to log in, the sign in button spins for a little bit and then throws “There was a problem on the server”.

I checked the logs and I keep on getting this:

INFO “GET /ghost/api/admin/site/” 200 4ms
ERROR “GET /ghost/api/admin/users/me/?include=roles” 403 7ms Authorization failed

“Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication.”

Error ID:

640da0e0-3207-11f0-b641-153136dcbec9

NoPermissionError: Authorization failed
at authorizeAdminApi (/var/lib/ghost/versions/5.119.3/core/server/services/auth/authorize.js:33:25)
at Layer.handle [as handle_request] (/var/lib/ghost/versions/5.119.3/node_modules/express/lib/router/layer.js:95:5)
at next (/var/lib/ghost/versions/5.119.3/node_modules/express/lib/router/route.js:149:13)
at authenticate (/var/lib/ghost/versions/5.119.3/core/server/services/auth/session/middleware.js:55:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

INFO “GET /ghost/api/admin/site/” 200 3ms
INFO “GET /ghost/api/admin/authentication/setup/” 200 21ms

It seems that it knows that the user does exist, and when I test with an incorrect password, the ghost admin panel login page says so (bad password). When I enter the correct password though, the above occurs.

What could be the cause of this?

I’m guessing you don’t have transactional email configured? You either need to add it, or you need to disable device verification.

There’s another report of docker hanging in this situation without a useful error message. The people reporting the issue haven’t seemed interested in working out a repro case that would allow finding and fixing the bug. (To be clear, the bug is lack of error log.) If you are, that’d be awesome.

1 Like

Thanks for your reply, that did it (setting up mail server). For some reason, it was removed from my configuration when I migrated machines. I’ll back this up next time (only had a backup of my content just in case).

Got many messages about being unable to log in into admin pages last time. Actually I also got the same message about it. How is it possible, I was just done with installation, but the next day I couldn’t log in. But I spent some time reading documentation, and did not immediately understand what exactly I must configure, server, port or mail.

Maybe possible in future releases to inform users during installation of ghost cms on self-host and propose to configure mail? If the user doesn’t want to configure now, just skip this step and configure later.
I think this little step will be helpful in the beginning for those who have never worked with ghost cms…