Not able to log in. No metadata for User was found.
Hello, I have a strange problem with a new installation on Ubuntu v22.04. I have a new instance of the latest Twenty server v0.23.0 (a new build was made, running without problems against a standalone PostgreSQL database). Also, a client-side code was built and run in a Chrome browser. But in a moment when I want to log in using the pre-filled login name
tim@apple.dev
, the server responses by the error message "code": "INTERNAL_SERVER_ERROR", "response": "No metadata for \"User\" was found."
.
It looks like there is no other recognizable problem. Even if I check the pre-feed database content, everything looks fine. The only thing I am aware of is that the PostgreSQL database is v14.11. Plus, there are no installed database extensions wrappers
and mysql_fdw
, but the latest pg_graphql
has been installed. Is it possible that it can have any relation to the observed problem?
The following commands were also executed, and except messages related to the missing extensions wrappers
and mysql_fdw
, no other errors.
It is worth to mention that seeding the sample database data has no effect to the described error. It is the same in both cases.
Or any other tip on where to find the source of the problem? I wanted to keep the problem description simple, but if necessary, I can add more details, including code. Thanks a lot for any help.40 Replies
Payload of the POST request
/graphql
:
If I compare our case with the exactly the same operation on https://demo.twenty.com, it is evident that in our case
captchaToken
variable is not sent as a part of the request. It is a question what is different in our case. Any idea?
Can our problem be related to the fact that the client config for the captcha is not defined? There is no information in the documentation what is necessary to do for the self-hosting case, except simply listing environment variables CAPTCHA_DRIVER, CAPTCHA_SITE_KEY, CAPTCHA_SECRET_KEY on the page https://twenty.com/developers/section/self-hosting/self-hosting-var. Is it possible to disable the captcha for self-hosting cases, especially when they are just demonstration installations? Doesn't it mean the value "provider": null
represents a disabled state?
Why would you use captcha if there's no need to use it when self-hosting unless it's self-hosted for company?
@ɃØĦɆᵾS I am trying to find any, even theoretical, possible reason as I am fighting with the
No metadata for User was found.
error. Actually, I have confirmed that the reCaptcha has no effect on our problem. Even with the same request as on https://demo.twenty.com, I am still receiving the same error when trying to log in.
@ɃØĦɆᵾS This the site URL, if you want to look: https://app-44d-3000.prg1.zerops.app
Twenty
A modern open-source CRM
Okay, so now few questions:
1. How did you exactly host app? Using 1-click deploy or local setup, if local setup, then DB is in Docker or directly on Linux?
2. Does .env in packages/twenty-server has captcha variables uncommented? (they're described as optional)
1. How did you exactly host app? Using 1-click deploy or local setup, if local setup, then DB is in Docker or directly on Linux?I have used the original Docker script to create my own local script to do all necessary steps on a Linux Ubuntu machine (container). So no Docker things are used in the end. The PostgreSQL database is running on a standalone Ubuntu container. @ɃØĦɆᵾS If it can help you, these are the steps how the Twenty server has been built: and run: As the deployed code is taken: @ɃØĦɆᵾS And these are the environment variables used to build and run:
2. Does .env in packages/twenty-server has captcha variables uncommented? (they're described as optional)I am using directly defined environment variables, not through the .env file. Initially captcha envs were not used at all. Then I tried them, but the result was the same, so I can remove them again.
Frankly speaking, I have no clue what might went wrong except for seeding workspace with data as I'm not sure if it works properly (I guess it should overwrite existing data but it doesn't?), if you don't have any important data, you can try running
npx nx database:reset twenty-server
as this creates all proper schemas and inserts needed dataAs I mentioned before, it looks that there should no be a problem, but it is. I guess that it is something really trivial, as normal.
@ɃØĦɆᵾS Can help you if I pass and access database details to you? Are you able to look at the database if it looks normal?
@ɃØĦɆᵾS What does the command
npx nx database:reset
mean in fact? As I am looking at the code, it represents the following steps. Because I am installing a fresh instance of the database (don't need ./scripts/truncate-db.ts
), and there are no historical data. Then ./scripts/setup-db.ts
is the same as "database:init:prod": "npx ts-node ./scripts/setup-db.ts && yarn database:migrate:prod"
. There is nothing to migrate.
From what I've checked:
- truncate fetches all schemas and drops them
- setup-db creates all schemas and extensions
- database:migrate does some black magic in dist/ but by looking at other files it seems like it creates all necessary data
- workspace:seed:dev is not in project.json (it's located in
src/database/commands/data-seed-demo-workspace/services
) but I'd guess it's responsible for inserting all data from src/database/typeorm-seeds
As much as I'm willing to help you solve your problem, I don't feel like I'd be able to help you more than I can do here, also, I'm not a developer by any means 😄
If I were you, I'd wait for tomorrow when someone from core team will take care of it, I'm sorry I couldn't help you moreThanks a lot for your effort anyway. Because I started with a new database instance, the truncating doesn't add anything new, and setup-db is called and finished, as expected. So the source of the problem should come from else. And, your recommendation sounds reasonable. 😻
I guess they did it so it can run on both new and existing setups in case something goes horribly wrong (like I'm doing way too often)
After all, there's no big difference in time if database is truncated or not
One thing, just to be sure, do you have records in
core."user"
?@ɃØĦɆᵾS Yes, I have checked that.