# Unknown content API key Error / View site 500 Error

**URL:** <https://forum.ghost.org/t/unknown-content-api-key-error-view-site-500-error/15223>\
**Category:** Developer help\
**Created:** [June 19, 2020, 10:05am UTC](https://forum.ghost.org/t/unknown-content-api-key-error-view-site-500-error/15223 "2020-06-19T10:05:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jallenh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jallenh/32/8508_2.png) [@jallenh](https://forum.ghost.org/u/jallenh)\
**Post date:** [June 19, 2020, 10:05am UTC](https://forum.ghost.org/t/unknown-content-api-key-error-view-site-500-error/15223/1 "2020-06-19T10:05:46Z")

</div>

Hi all,

I was getting some odd behavior, essentially getting a 500 error whenever I clicked on view site in the admin panel. The pages still worked but within the frame where the site should be it gave me the ghost tumbleweed 500 error screen.

In the process of debugging that I

- double-checked my site URL was pointing to https rather than http
- reran `ghost setup nginx ssl`
- reran `ghost setup ssl`
- reran `ghost doctor` for good measure
- restarted the site

After that the issue seemed to resolve, but I decided to check behind the scenes and so stopped the site and re ran it using `ghost run` so I could see the output for debugging. I noticed I’m getting the following error whenever I click “view site”.

> [2020-06-19 09:47:48] ERROR “GET /ghost/api/v2/content/posts/?key=852e3ba1272c5e8a20c8c7fbbb&limit=all&fields=id,title,url,updated\_at,visibility&order=updated\_at%20desc&formats=plaintext” 401 5ms
> 
> Unknown Content API Key
> 
> Error ID:  
> ef691190-b211-11ea-ba2e-b365a59f8bbf
> 
> Error Code:  
> UNKNOWN\_CONTENT\_API\_KEY
> 
> * * *
> 
> UnauthorizedError: Unknown Content API Key  
> at new UnauthorizedError (/var/www/ghost/versions/3.20.0/node\_modules/ghost-ignition/lib/errors/index.js:120:23)  
> at Child. (/var/www/ghost/versions/3.20.0/core/server/services/auth/api-key/content.js:22:25)  
> at Child.tryCatcher (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/util.js:16:23)  
> at Promise.\_settlePromiseFromHandler (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/promise.js:547:31)  
> at Promise.\_settlePromise (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/promise.js:604:18)  
> at Promise.\_settlePromise0 (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/promise.js:649:10)  
> at Promise.\_settlePromises (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/promise.js:729:18)  
> at \_drainQueueStep (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/async.js:93:12)  
> at \_drainQueue (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/async.js:86:9)  
> at Async.\_drainQueues (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/async.js:102:5)  
> at Immediate.Async.drainQueues (/var/www/ghost/versions/3.20.0/node\_modules/bluebird/js/release/async.js:15:14)  
> at processImmediate (internal/timers.js:456:21)  
> at process.topLevelDomainCallback (domain.js:137:15)

I’m not sure what is going on here, is it an issue, did it cause my other 500 error problem?  
**Info**  
URL: [https://www.jallenrobertson.com](https://www.jallenrobertson.com)  
Ghost version: 3.20.0  
Ghost CLI: 1.14.1  
Node: v12.18.0  
Ghost was installed using the Digital Ocean 1-click app

Reproduce: Go to admin panel, click on the view site button to load the site in the frame -observe terminal throw the error.

---

<div class="post-metadata">

**Author:** ![Hannah](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/hannah/32/22_2.png) [@Hannah](https://forum.ghost.org/u/Hannah)\
**Post date:** [June 19, 2020, 11:45am UTC](https://forum.ghost.org/t/unknown-content-api-key-error-view-site-500-error/15223/2 "2020-06-19T11:45:38Z")

</div>

The 401 error is viewable when visiting [https://www.jallenrobertson.com/](https://www.jallenrobertson.com/)

Looks like it’s maybe coming from code injection:

![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/0/065d80b910efaa85081cf5cb6abea5de5cd84e38.png)

Not sure it’s causing the 500, but makes sense to squash this first and see.

---

<div class="post-metadata">

**Author:** ![jallenh](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jallenh/32/8508_2.png) [@jallenh](https://forum.ghost.org/u/jallenh)\
**Post date:** [June 19, 2020, 1:06pm UTC](https://forum.ghost.org/t/unknown-content-api-key-error-view-site-500-error/15223/3 "2020-06-19T13:06:57Z")

</div>

Ah! Thanks @Hannah. It was the API key for the search function in my theme. I’d moved the blog from a local implementation to the ghost droplet and hadn’t generated a new API key for it. I generated a new key and replaced it in my theme config and now we’re all good!
