Hi, there seems to be a broken process when publishing a new post related to the XMLRPC service. Every time I publish a new post (this is on a self hosted instance of Ghost), I see the following error in my logs. I have to publish the post a second time for it to actually work, otherwise I get 500 errors when trying to visit the post in my browser.
2018-07-10T15:15:17.328794+00:00 app[web.1]: INFO [2018-07-10 15:15:17] "PUT /build/ghost/api/v0.1/posts/5b44cd6c50d56b0015b4e720/?include=authors,tags,authors.roles" 200 129ms
2018-07-10T15:15:17.355616+00:00 app[web.1]: [2018-07-10 15:15:17] ERROR
2018-07-10T15:15:17.355620+00:00 app[web.1]:
2018-07-10T15:15:17.355622+00:00 app[web.1]: NAME: InternalServerError
2018-07-10T15:15:17.355624+00:00 app[web.1]: MESSAGE: Response code 405 (Method Not Allowed)
2018-07-10T15:15:17.355626+00:00 app[web.1]:
2018-07-10T15:15:17.355628+00:00 app[web.1]: level:normal
2018-07-10T15:15:17.355629+00:00 app[web.1]:
2018-07-10T15:15:17.355631+00:00 app[web.1]: The xmlrpc service was unable to send a ping request, your blog will continue to function.
2018-07-10T15:15:17.355634+00:00 app[web.1]: If you get this error repeatedly, please seek help on http://docs.ghost.org.
2018-07-10T15:15:17.355636+00:00 app[web.1]: InternalServerError: Response code 405 (Method Not Allowed)
2018-07-10T15:15:17.355638+00:00 app[web.1]: at new GhostError (/app/node_modules/ghost/core/server/lib/common/errors.js:9:26)
2018-07-10T15:15:17.355639+00:00 app[web.1]: at /app/node_modules/ghost/core/server/services/xmlrpc.js:75:38
2018-07-10T15:15:17.355641+00:00 app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2018-07-10T15:15:17.355643+00:00 app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
2018-07-10T15:15:17.355645+00:00 app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
2018-07-10T15:15:17.355646+00:00 app[web.1]: at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:614:10)
2018-07-10T15:15:17.355648+00:00 app[web.1]: at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:689:18)
2018-07-10T15:15:17.355650+00:00 app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:133:16)
2018-07-10T15:15:17.355651+00:00 app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
2018-07-10T15:15:17.355653+00:00 app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
2018-07-10T15:15:17.355655+00:00 app[web.1]: at runCallback (timers.js:810:20)
2018-07-10T15:15:17.355657+00:00 app[web.1]: at tryOnImmediate (timers.js:768:5)
2018-07-10T15:15:17.355658+00:00 app[web.1]: at processImmediate [as _immediateCallback] (timers.js:745:5)
2018-07-10T15:15:17.355660+00:00 app[web.1]:
2018-07-10T15:15:17.355661+00:00 app[web.1]: HTTPError: Response code 405 (Method Not Allowed)
2018-07-10T15:15:17.355663+00:00 app[web.1]: at stream.catch.then.data (/app/node_modules/got/index.js:182:13)
2018-07-10T15:15:17.355665+00:00 app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2018-07-10T15:15:17.355667+00:00 app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
2018-07-10T15:15:17.355668+00:00 app[web.1]: at Promise._settlePromise (/app/node_modules/bluebird/js/release/promise.js:569:18)
2018-07-10T15:15:17.355670+00:00 app[web.1]: at Promise._settlePromise0 (/app/node_modules/bluebird/js/release/promise.js:614:10)
2018-07-10T15:15:17.355672+00:00 app[web.1]: at Promise._settlePromises (/app/node_modules/bluebird/js/release/promise.js:693:18)
2018-07-10T15:15:17.355673+00:00 app[web.1]: at Async._drainQueue (/app/node_modules/bluebird/js/release/async.js:133:16)
2018-07-10T15:15:17.355675+00:00 app[web.1]: at Async._drainQueues (/app/node_modules/bluebird/js/release/async.js:143:10)
2018-07-10T15:15:17.355677+00:00 app[web.1]: at Immediate.Async.drainQueues (/app/node_modules/bluebird/js/release/async.js:17:14)
2018-07-10T15:15:17.355678+00:00 app[web.1]: at runCallback (timers.js:810:20)
2018-07-10T15:15:17.355680+00:00 app[web.1]: at tryOnImmediate (timers.js:768:5)
2018-07-10T15:15:17.355681+00:00 app[web.1]: at processImmediate [as _immediateCallback] (timers.js:745:5)
That sounds completely unrelated to the xmlrpc ping error (that is just a background process and has no bearing on the save/publication). Do you have the logs from the 500 errors youâre seeing?
Any idea why I need to âpublishâ my posts twice for them to show up? On initial publish, I get the xmlrpc error, and trying to visit the post results in a 500 (Resource Not Found)⌠when I hit publish a second time, it seems to work. Hmmmm. related?
If the post goes live (from draft to publish), an event will be triggered and this triggers the xmlrpc ping. If the post is already live and you just save/update the post, no publish event is triggered, because the post is already published.
Try to visit the newly published post and get a 500 error (Resource not found)
Hit Publish again on the same post
Try to visit the newly published post and it loads just fine
When looking through the logs, I see 2 errors, which Iâve linked to in this gist:
I am not sure if its related to the xmlrpc ping or not. Could be unrelated, but whatever is happening, it requires me to publish my posts twice for them to work
No this doesnât sound related. Which Ghost version are you on?
You are getting a 500 when visiting the post on your blog, correct? Can you please share a screenshot from this error? Furthermore, i wonder why you only see the xmlrpc error in your log. Could you please double check that there is no other error? Thanks
Iâve also noticed that this newly created post doesnât always show up on the homepage. If I keep refreshing, sometimes it shows up, other times it doesnât. Interestingly, if I restart the server, everything seems to work fine. Its almost like all of the Ghost instances are not in sync (I am running this on Heroku with 2 dynos, so the node app is being forked into 2 processes.) Do I need to do something special to make the Ghost app work with a forked process?
Ghost does not support clustering or multi-server setups of any description, there should only be one Ghost instance per blog. The recommended scaling and performance approach is to put a cache and/or CDN in front of your blog; pages generated by Ghost are essentially static so there should be very little traffic hitting your Ghost server with a well configured cache.