# Cannot add API Credentials

**URL:** <https://community.n8n.io/t/cannot-add-api-credentials/6796>\
**Category:** Questions\
**Tags:** credentials\
**Created:** [July 17, 2021, 9:11pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796 "2021-07-17T21:11:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![soerenh](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/soerenh/32/5634_2.png) [@soerenh](https://community.n8n.io/u/soerenh)\
**Post date:** [July 17, 2021, 9:11pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/1 "2021-07-17T21:11:19Z")

</div>

Hi there,

i’ve started using n8n a month ago and run into a problem. unfortunatly n8n does not let my create Credentials anymore. I discovered it while adding n8n yesterday and tried out of curiosity other apis (eg home assistant) and got the same error.

 ![image](https://europe1.discourse-cdn.com/n8n/original/2X/5/593885f1bed0ea1205434f834aacb0e2a7164ffc.png)  
Part of API key removed for security reasons. Error Message at the lower right.

Does someone know what I can do about it?  
BR soeren

---

<div class="post-metadata">

**Author:** ![RicardoE105](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ricardoe105/32/550_2.png) [@RicardoE105](https://community.n8n.io/u/RicardoE105)\
**Post date:** [July 17, 2021, 9:42pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/2 "2021-07-17T21:42:05Z")

</div>

Welcome to the community @soerenh

That is quite strange. What version of n8n are you running?

---

<div class="post-metadata">

**Author:** ![soerenh](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/soerenh/32/5634_2.png) [@soerenh](https://community.n8n.io/u/soerenh)\
**Post date:** [July 17, 2021, 10:58pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/3 "2021-07-17T22:58:57Z")

</div>

I’m using the docker image, tagged latest.  
The instance itself says 0.129.0

i redeployed the whole thing just in case something broke but nope, the freshly started container gets the same error on creating credentials

hope that helps

---

<div class="post-metadata">

**Author:** ![soerenh](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/soerenh/32/5634_2.png) [@soerenh](https://community.n8n.io/u/soerenh)\
**Post date:** [July 17, 2021, 11:07pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/4 "2021-07-17T23:07:03Z")

</div>

I was able to get some logs out. I’ve just tried to add home assistant, got the known error message and the container log states the following.

`
ERROR RESPONSE 
Error: Cannot update entity because entity id is not set in the entity. 
    at /usr/local/lib/node_modules/n8n/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js:129:39 
    at Array.map () 
    at ReturningResultsEntityUpdator. (/usr/local/lib/node_modules/n8n/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js:123:46) 
    at step (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:143:27) 
    at Object.next (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:124:57) 
    at /usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:117:75 
    at new Promise () 
    at Object.__awaiter (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:113:16) 
    at ReturningResultsEntityUpdator.insert (/usr/local/lib/node_modules/n8n/node_modules/typeorm/query-builder/ReturningResultsEntityUpdator.js:88:24) 
    at InsertQueryBuilder. (/usr/local/lib/node_modules/n8n/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:76) 
    at step (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:143:27) 
    at Object.next (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:124:57) 
    at fulfilled (/usr/local/lib/node_modules/n8n/node_modules/typeorm/node_modules/tslib/tslib.js:114:62) 
`

---

<div class="post-metadata">

**Author:** ![soerenh](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/soerenh/32/5634_2.png) [@soerenh](https://community.n8n.io/u/soerenh)\
**Post date:** [July 18, 2021, 10:05am UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/5 "2021-07-18T10:05:48Z")

</div>

Ok, i fixed it. Somehow.

The docker container is managed by rancher and i just only put the env info in the secrets instead of directly in the workload (so it is hidden all the time) and then redeployed.

As i think this should not change anything but now it stores again and adding API credentials works again. I don’t really understand why its working now but it is.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [July 18, 2021, 2:02pm UTC](https://community.n8n.io/t/cannot-add-api-credentials/6796/6 "2021-07-18T14:02:58Z")

</div>

Glad to hear that you could get it working and thanks for sharing the solution for also others to find in the future!

Have fun!
