Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't able to login #6170

Closed
muzzamilshaikh opened this issue Jul 9, 2024 · 5 comments
Closed

Can't able to login #6170

muzzamilshaikh opened this issue Jul 9, 2024 · 5 comments
Labels
type: bug Something isn't working

Comments

@muzzamilshaikh
Copy link

Bug Description

I've deployed my twenty CRM in the AWS light sail instance after visiting that URL i tried to continue login with the default email which is "[email protected]" but it failed to login the response was this "QueryFailedError" when I inspected that this is the repose below

response { "errors": [ { "message": "QueryFailedError", "extensions": { "code": "INTERNAL_SERVER_ERROR", "response": "relation \"core.user\" does not exist" } } ], "data": null }
I don't know what to do I'm totally new to this please help me

@muzzamilshaikh muzzamilshaikh added the type: bug Something isn't working label Jul 9, 2024
Copy link

greptile-apps bot commented Jul 9, 2024

Ensure the database is properly initialized and migrated. Follow these steps:

  1. Check Database Service Configuration: Verify the db service in docker-compose.yml to ensure it is correctly set up.
  db:
    image: twentycrm/twenty-postgres:${TAG}
    volumes:
      - db-data:/bitnami/postgresql
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
    healthcheck:
      test: pg_isready -U twenty -d default
      interval: 5s
      timeout: 5s
      retries: 10
    restart: always
  1. Run Database Migrations: Execute the following commands to reset and migrate the database.
# Access the server container
docker exec -it twenty-server-1 bash

# Run database migrations
npx nx database:reset
  1. Verify User Data: Ensure the default user exists in the database. Refer to user.json for mock user data.
{
  "id": "20202020-a838-4fa9-b59b-96409b9a1c30",
  "firstName": "Tim",
  "lastName": "Apple",
  "email": "[email protected]",
  "locale": "en",
  "passwordHash": "$2b$10$66d.6DuQExxnrfI9rMqOg.U1XIYpagr6Lv05uoWLYbYmtK0HDIvS6",
  "avatarUrl": null
}

These steps should resolve the QueryFailedError related to the missing core.user table.

References

/packages/twenty-docker/docker-compose.yml
/packages/twenty-server/src/core/auth/auth.resolver.ts
/packages/twenty-server/test/mock-data/user.json
/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx

About Greptile

This response provides a starting point for your research, not a precise solution.

Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

Ask Greptile · Edit Issue Bot Settings

@aficiomaquinas
Copy link

I struggled with this myself, the problem might be that the database is not properly initialized running yarn and then yarn database:init:prod on the server container, or that you are using the incorrect schema/user.

If you are deploying with a different docker compose than the default it could be useful to further debug this if you could share your compose. In my case both selecting the wrong schema, the wrong user, simply trying to use something else than the official db docker (i wanted to use supabase), many things caused this error.

In order to really know what is going on it would also be useful to see the server and the db logs.

@EmaX093
Copy link

EmaX093 commented Jul 23, 2024

image

@georgezgeorgez
Copy link

georgezgeorgez commented Jul 31, 2024

At first I installed on a 2gb ram box and got insufficient JavaScript heap when I ran the database:reset.

I bumped to 4gb and was able to run the database:reset, but I still received the query error. It started working after I ran yarn database:unit:prod as @aficiomaquinas mentioned.

This was using the official 1-click installation.

@infernix
Copy link

Had similar issues; afaict this does not work if behind a corporate proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants