AlphaNecron / Void

Fast and elegant file hosting service.
MIT License
218 stars 13 forks source link

When pulling v0 the default credentials are not working. IE. User not found #41

Closed Jamior closed 2 years ago

Jamior commented 2 years ago

When using docker-compose _void_postgres_1_logs.txt

Brand New.

Credentials tested: Admin voiduser

admin voiduser

void voiduser

Void Voiduser

AlphaNecron commented 2 years ago

Is there any errors in the log? Try prisma db seed?

Jamior commented 2 years ago

The postgres container doesnt recognise the command

AlphaNecron commented 2 years ago

Can you send the logs here?

Jamior commented 2 years ago

_void_postgres_1_logs.txt Thats the postgres logs

AlphaNecron commented 2 years ago

Try prisma migrate deploy. Are you using Docker?

Jamior commented 2 years ago

Yes sir

AlphaNecron commented 2 years ago

Execute prisma migrate deploy?

Jamior commented 2 years ago

root@vmi933925://root/Void# docker exec -it void_postgres_1 prisma migrate deploy OCI runtime exec failed: exec failed: unable to start container process: exec: "prisma": executable file not found in $PATH: unknown

AlphaNecron commented 2 years ago

Ah, yarn binaries are not exported. Try yarn prisma instead of prisma.

Jamior commented 2 years ago

image

AlphaNecron commented 2 years ago

Try deleting the image and then recreate it? Both void and postgres. Or use Docker Compose as an easier alternative.

Jamior commented 2 years ago

i made both of these images with docker compose

AlphaNecron commented 2 years ago

Try recreating these images or use node and yarn instead.

AlphaNecron commented 2 years ago

Reopen if you are still encounter this issue.

roib20 commented 2 years ago

I'm getting the same issue through a Docker Compose deployment. When attempting to login an error message comes up: "User not found".

Tested on v0 and /dev branches.

AlphaNecron commented 2 years ago

Can you access the container and then execute prisma migrate deploy && prisma db seed?

roib20 commented 2 years ago

Do you mean in the postgres container or the main void container? I tried running commands in both, but I am getting the same errors as Jamior. prisma and yarn commands are not found in the container shells. I'm using the official postgres container as mentioned in the docker-compose example; I don't think it includes prisma.

AlphaNecron commented 2 years ago

Can you try appending yarn or npx before prisma? One of them should be present in the void container.

isolume commented 2 years ago

getting error: Environment variable not found: DATABASE_URL. when running prisma db seed. config.toml does have postgres url included (same issue as users above)

Full log:

yarn run v1.22.19
$ /void/node_modules/.bin/prisma db seed
Running seed command `ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts` ...
PrismaClientInitializationError: 
Invalid `prisma.user.count()` invocation:

  error: Environment variable not found: DATABASE_URL.
  -->  schema.prisma:3
   | 
 2 |   provider = "postgresql"
 3 |   url      = env("DATABASE_URL")
   | 

Validation Error Count: 1
    at Object.request (/void/node_modules/@prisma/client/runtime/index.js:39815:15)
    at async PrismaClient._request (/void/node_modules/@prisma/client/runtime/index.js:40637:18)
    at async main (/void/prisma/seed.ts:8:17) {
  clientVersion: '3.10.0',
  errorCode: undefined
}

An error occured while running the seed command:
Error: Command failed with exit code 1: ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
isolume commented 2 years ago

Update: temporary solution to this before it is fixed is to put your postgres URI as an environment variable when creating the docker container like-e DATABASE_URL=<url goes here>.

AlphaNecron commented 2 years ago

Actually its only needed when executing prisma standalone.

Dumdidldum commented 2 years ago

hi, i am having the same issue, i am using the docker compose file from the repo and the void container prints this:

┌─────────────────────────────────────────────────────────┐
│  Update available 3.10.0 -> 4.2.1                       │
│                                                         │
│  This is a major update - please follow the guide at    │
│  https://pris.ly/d/major-version-upgrade                │
│                                                         │
│  Run the following to update                            │
│    yarn add --dev prisma@latest                         │
│    yarn add @prisma/client@latest                       │
└─────────────────────────────────────────────────────────┘

error Command failed with exit code 1.

and then the default credentials also don't work/exist

running /void/node_modules/.bin/prisma db seed results in this:

Running seed command `ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts` ...

An error occured while running the seed command:
Error: Command failed with ENOENT: ts-node --compiler-options {"module":"commonjs"} prisma/seed.ts
spawn ts-node ENOENT
AlphaNecron commented 2 years ago

Can you try the latest commit in the dev branch? Create a new issue if it does not work.