Closed immanuelrosal closed 5 years ago
Update: It seems to be forcing me to login when I try to deploy in v1.28.5
which wasn't the case before I tried the beta; I didn't need to be Authenticated to deploy locally before. Maybe it's somewhere there?
I'll also add that I can't run anything in 1.29-beta again either. It seems this error continues now no matter what I remove or reset.
@dietler Tried removing my Internet connection via wifi and did prisma deploy
:
! 'ENOTFOUND': request to https://api.cloud.prisma.sh/ failed, reason: getaddrinfo ENOTFOUND api.cloud.prisma.sh api.cloud.prisma.sh:443
It look like it is, indeed, forcing a deploy on the cloud despite us pointing the endpoint on our local machine.
Checking the prisma-cli-core library if I could tweak something to fix it.
@dietler Found the culprit. So in the deploy script: There's this:
if (
workspace &&
!workspace.startsWith('public-') &&
!process.env.PRISMA_MANAGEMENT_API_SECRET &&
(!this.env.cloudSessionKey || this.env.cloudSessionKey === '')
) {
await this.client.login()
cluster.clusterSecret = this.env.cloudSessionKey
}
The solution for me was to add a .env
file with the following key:
# inside .env file
PRISMA_MANAGEMENT_API_SECRET=<insert-any-value-here>
This is for v1.28.5
Let me know if it works for you.
So basically, I was still able to run Prisma Admin by setting the prisma image to v1.29-beta
in the docker-compose.yml
file but had a downgraded prisma-cli
version of v1.28.5
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.29-beta
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
managementApiSecret: my-secret
databases:
default:
connector: postgres
host: postgres
user: prisma
password: prisma
rawAccess: true
port: 5432
migrations: true
postgres:
image: postgres
restart: always
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
volumes:
- postgres:/var/lib/postgresql/data
volumes:
postgres:
prisma --version
prisma/1.28.5 (windows-x64) node-v11.12.0
Hey, sorry but this is not related to prisma-admin
, this is related to CLI.
Hi,
This seems to be related to the missing services bug fix that we have done which is currently in beta. https://github.com/prisma/prisma/pull/4194
Thanks, for catching this, we will investigate and fix this issue. We might need to transfer this issue to the main repository as well.
@Huvik I originally thought that it was. It was only after investigating that I saw it was a cli problem. My sincerest apologies.
@pantharshit00 Thanks!
# inside .env file PRISMA_MANAGEMENT_API_SECRET=<insert-any-value-here>
@immanuelrosal That worked for me. Thanks!
# inside .env file PRISMA_MANAGEMENT_API_SECRET=<insert-any-value-here>
@immanuelrosal That worked for me. Thanks!
It worked for me too.
And don't forget to uncomment managementApiSecret and add your ApiSecret as well.
Went to slack to find out I'm not the only one experiencing this but Andy Deitler as well: https://prisma.slack.com/archives/CA491RJH0/p1552687055746500
He said:
Same thing happened to me. I came from 1.28, tried the 1.29-beta, and got the exact same error. Tried the following already:
npm i -g prisma
coming from the beta version that I installed usingnpm i -g prisma@beta
. Confirmed that I was able to go back to version 1.28.5 by doing:prisma --version
that results to:npm uninstall -g prisma
docker stop
thendocker rm
docker image rm
thendocker-compose up -d
docker-machine stop
thendocker-machine start
npm uninstall -g prisma
then cleared the npm cachenpm cache clean --force
But to no avail.I didn't have any issue like this prior to trying out 1.29-beta
docker-compose.yml
prisma.yml
docker info