Describe the bug
Running prisma deploy
gives this bug:
ERROR: No 'Authorization' header provided.
{
"data": {
"addProject": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 9
}
],
"path": [
"addProject"
],
"code": 3015,
"message": "No 'Authorization' header provided.",
"requestId": "local:cjtvsmn86098l0780lzufje0n"
}
],
"status": 200
}
Get in touch if you need help: https://www.prisma.io/forum/
To get more detailed output, run $ export DEBUG="*"
To Reproduce
Steps to reproduce the behavior:
prisma deploy
Expected behavior
Should deploy without any errors
Versions (please complete the following information):
Postgres
]1.30.0-beta
]prisma
CLI: [prisma/1.30.0-beta.6 (darwin-x64) node-v11.12.0
]OS X Mojave
, Ubuntu
] The error message is in regards to a header not being sent (you probably already guessed that).
I'm not 100% sure but I think you have set a secret which isn't declared in ENV when running deploy.
Debugging this would be easier with the contents of your prisma.yml
and docker-compose.yml
files.
i got the same problem too
@MathiasKandelborg PRISMA_SECRET
is set in both .env
and prisma.yml
Hi @impowski
Have you set the managementApiSecret in the PRISMA_MANAGEMENT_API_SECRET
environment variable? It is required for deployment and you can find it in your docker-compose.yml file.
See: https://www.prisma.io/docs/prisma-server/authentication-and-security-kke4/#management-api-secret
how to set the variable on windows?
@pantharshit00 Yes, it's set in docker-compose.yml
and inside .env
@impowski Can you please share a minimal reproduction in a repository?
@cheuk3 In windows use set PRISMA_MANAGEMENT_API_SECRET=yoursecret
@pantharshit00
I did that but still get the same error
ERROR: No 'Authorization' header provided.
@pantharshit00 I mean, set a secret
inside prisma.yml
, which is a PRISMA_SECRET
inside .env
. Then set a PRISMA_MANAGEMENT_API_SECRET
inside .env
and inside docker-compose.yml
. Everything working on version prisma/1.30.0-beta.3
, starting from prisma/1.30.0-beta.4
something is wrong.
I installed the newest version, which is [email protected]
and it does work.
@impowski how to install [email protected] as I tried to install with npm which said "No matching version found for [email protected]".
Thanks
Edit: Just installed it with npm i prisma@beta and it does work :D thanks
I have a nearly identical error on 1.33. Any take aways to resolve Authorization errors?
What I had to do to update from 1.32 to 1.33:
docker-compose.yml
change image to latest version image: prismagraphql/prisma:1.33
docker-compose.yml
make sure you have the managementApiSecret
set like that:environment:
PRISMA_CONFIG: |
managementApiSecret: mySecret
docker-compose up -d
.env
file in the root dir with content PRISMA_MANAGEMENT_API_SECRET=mySecret
prisma deploy
btw. a good way to have the secret only in one place (and not be forced to commit it) is to reference it in docker-compose.yml
like that: managementApiSecret: "${PRISMA_MANAGEMENT_API_SECRET}"
and only have it in the .env file as described above...
@DennisKo The problem is still exists in v1.34.0
!
I encountered this error. My solution:
$docker-compose down
DROP DATABASE prisma
(SQL client)$docker-compose up -d
$prisma deploy
Prisma CLI version: prisma/1.34.0 (darwin-x64) node-v12.4.0
Prisma server version: 1.34.0
macOS 10.14.5 (Mojave)
Hey guys, try sudo prisma deploy
I was getting the same issue running prisma deploy
on a Digital Ocean droplet from these instructions.
Error:
ERROR: No 'Authorization' header provided.
{
"data": {
"addProject": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 9
}
],
"path": [
"addProject"
],
"code": 3015,
"message": "No 'Authorization' header provided.",
"requestId": "local:cjwzc8bpi000e077173ikilyp"
}
],
"status": 200
}
directory structure (server root /):
docker-compose.yml
/var
/etc
/auvporsche
prisma.yml
datamodel.graphql
.env
Prisma v1.34
Removed managementApiSecret from docker-compose.yml, removed secret from prisma.yml, ran sudo prisma deploy
in /auvporsche and managed to get it to deploy.
Removed managementApiSecret from docker-compose.yml, removed secret from prisma.yml
Please don't do that in production. Your Prisma server will not be secured that way
Most helpful comment
What I had to do to update from 1.32 to 1.33:
docker-compose.yml
change image to latest versionimage: prismagraphql/prisma:1.33
docker-compose.yml
make sure you have themanagementApiSecret
set like that:docker-compose up -d
.env
file in the root dir with contentPRISMA_MANAGEMENT_API_SECRET=mySecret
prisma deploy
btw. a good way to have the secret only in one place (and not be forced to commit it) is to reference it in
docker-compose.yml
like that:managementApiSecret: "${PRISMA_MANAGEMENT_API_SECRET}"
and only have it in the .env file as described above...