Recurring Error 520 - URLSERVICE_RESOURCE_DUPLICATE

I’m not sure what has started to go wrong, but I’m getting a recurring Error 520 every few minutes. It seems to correct itself… I guess after a reboot… but I was hoping someone could help me debug.

Few notes:

  • The frontend site works 100%.
  • I get the 520 error when trying to access /ghost or /edit… basically anything to do with backend.
  • I have run ghost doctor. All is good.

Logs:

Here are some lines from my error logs

  • there is a mention of URLSERVICE_RESOURCE_DUPLICATE… not sure what that means
at /var/www/ghost/versions/4.18.0/core/frontend/services/url/UrlGenerator.js:121:18\n    
at arrayEach (/var/www/ghost/versions/4.18.0/node_modules/lodash/lodash.js:530:11)\n    
at Function.forEach (/var/www/ghost/versions/4.18.0/node_modules/lodash/lodash.js:9410:14)\n    
at UrlGenerator._onInit (/var/www/ghost/versions/4.18.0/core/frontend/services/url/UrlGenerator.js:120:11)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:125:17)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)\n    
at Queue.run (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Queue.js:129:22)"},"msg":"This should not happen.","time":"2021-10-18T06:39:24.889Z","v":0}
{"name":"Log","hostname":"ghost-ubuntu-c-2-4gib-nyc1-01","pid":4650,"level":50,"err":{"id":"2273c3a0-2fde-11ec-af81-8d227ad45c44","domain":"http://147.182.137.130","code":"URLSERVICE_RESOURCE_DUPLICATE","name":"InternalServerError","statusCode":500,"level":"critical","message":"This should not happen.","stack":"InternalServerError: This should not happen.\n    
at Urls.add (/var/www/ghost/versions/4.18.0/core/frontend/services/url/Urls.js:39:27)\n    
at UrlGenerator._try (/var/www/ghost/versions/4.18.0/core/frontend/services/url/UrlGenerator.js:165:23)\n

Please let me know if there is anything else I can provide to provide insight.