T
Twentyβ€’7mo ago
Rob

Error during userFindManyRecords for .... Response not successful: received status code 400

Hi Twenty team, thanks for the great software. I am self hosting via docker and the product has been generally working great! However, I have run in to an error customising the data model. When editing some data model fields via the web interface, I get the error "Error during userFindManyRecords for .... Response not successful: received status code 400" appearing in the top corner of my screen, and any changes I make to the field (e.g. change the icon) are not able to be saved (the save button is greyed out). See attached figure. Attached is also the whole list of fields for this example. I have not manually changed anything in the data base. I have noticed this happen on a variety of fields. But I see no pattern in which fields it happens on. The error can happen in the people or companies data models, but also custom objects. I have attached the log error, too. Do you have any suggestions as to what the error might be and how i could fix it? I am confident to edit the DB etc if required.
65 Replies
Rob
RobOPβ€’7mo ago
I’ve tried simply deleting the fields and re adding them. But i can’t delete the fields, it also throws an error
charles
charlesβ€’7mo ago
Hi Rob, we had issue recently with custom object renaming I think that's the issue you have Could you check metadata.workspaceMigration, order by name and see if you have unapplied migrations If yes, we will need to apply then: - yarn command:prod workspace:apply-pending-migrations -w {your_workspace_id} I suspect you'll see an error here. Once identified, I can help you troubleshoot, should be farily straightforward (the bug fix has been merged on main and will be part of the next release end of the week)
Rob
RobOPβ€’7mo ago
Thanks for the help @charles I looked at metadata.workspaceMigration and all rows have an appliedAt timestamp, does that mean that the migrations had been applied? Regardless, I ran the commands for my two workspaces - docker exec -it home-server_twenty_1 yarn command:prod workspace:apply-pending-migrations -w 9f7ecf08-68ee-4c75-83b8-6e5716601558 - docker exec -it home-server_twenty_1 yarn command:prod workspace:apply-pending-migrations -w 6e278d07-a88a-45d3-86c9-daea30a9b0e5 Neither command seemed to throw an error, I have attached the output. I still see the error occuring. Have I applied your suggestion correctly? Is there anything else I can try? Thanks again!!
charles
charlesβ€’7mo ago
ok, so that's not it! what do you see in your server logs ?
Rob
RobOPβ€’7mo ago
where do i find the server logs? Is that the same as the docker container logs? Or something else?
charles
charlesβ€’7mo ago
yes they should be in the output
Rob
RobOPβ€’7mo ago
Thanks @charles I have captured the logs and will DM it to you (contains domain names etc, so slightly sensitive). I also captured some screenshots and attach them here. Here is what I did: - Relaunched server - Opened Companies page - Opened People page - Opened a person, then viewed a note - Clicked on settings - Clicked on Data Model - Went to an object called fund prospects - Tried to delete an inactive field (failed with ORM Error) - Renamed "fund prospects" to "deal flow" (got an error) - Reloaded the Data Models page (shows error) Thanks for your help! I'd love to fix whatever I've broken. I really like using Twenty, it's a great product!
No description
No description
No description
Rob
RobOPβ€’7mo ago
I suspect it has something to do with the multi select items. I deleted my db and docker images and started fresh. And I start seeing errors once i've created multi select fields.
Rob
RobOPβ€’7mo ago
Ok, I am pretty sure its something to do with multi select. I just ran the following experiment: - Started with fresh db using the twenty-postgres image - Started the twenty docker image - Ran docker exec -it twenty_1 yarn - Ran docker exec -it twenty_1 npx nx database:reset - Logged in to the demo workspace - Created a test multi select field in the people data model, added option 1, option 2, option 3 - Clicked back in to settings, then data model, then people, then test field - Error appears in red, and I have attached the log. Does this help @charles ?
Rob
RobOPβ€’7mo ago
I just switch to twentycrm/twenty-postgres:main and twentycrm/twenty:main and the same thing happens still> I took a screen recording and grab the logs again incase that helps
Rob
RobOPβ€’7mo ago
charles
charlesβ€’7mo ago
Hi Rob, these are the server logs indeed πŸ™‚ the logs you have sent in private surface an issue about DealFlow object, the last one you've attached here are related to a multi select issue
Rob
RobOPβ€’7mo ago
so maybe i have multiple issues, sorry 😦 should we split up the discussion? should i open another thread for the multi select issue?
charles
charlesβ€’7mo ago
No worries, we have a few bugs that are fixed on main but not in the latest release yet It's fine to discuss them together here so, first, let's make sure you don't have any pending migrations not applied again could you check your metadata.workspaceMigration table to see if there is any line with appliedAt null?
Rob
RobOPβ€’7mo ago
i think the multi select is still an issue on main, i tested that too. But I am happy to move to main if you think it might have some unsolved bugs?
charles
charlesβ€’7mo ago
moving on main will prevent you to break your schema but your schema is already broken so we need to fix it It's better that you keep using official releases, main is unstable Let's fix your schema and I'll draft a new patch release in the mean time (on 0.11.x)
Rob
RobOPβ€’7mo ago
alright, thanks ok, let me check the db please give me a few min, i need to restore the db. i moved to a clean workspace while trying to debug the multi issue
charles
charlesβ€’7mo ago
sure πŸ™‚
Rob
RobOPβ€’7mo ago
ok, i am back up and running first, i will check the metadata.workspaceMigration all of the appliedAt have a datetime associated with them
charles
charlesβ€’7mo ago
ok so it's not as broken as I tought :p do you have a dealFlow object in metadata.objectMetadata ? (nameSingular)
Rob
RobOPβ€’7mo ago
Now, this might be annoying/confusing, but I renamed the object while trying to debug this issue.
charles
charlesβ€’7mo ago
I think that's part of the issue yes πŸ™‚ we have temporariliy (and by mistake) allow object renaming in the UI which is actually not supported by the engine but we can fix it easily
Rob
RobOPβ€’7mo ago
oh, nice! thanks so much
charles
charlesβ€’7mo ago
we should make sure that whatever you have in metadata.objectMetadata singularName matches your table names in your postgres workspace_xxx schema
Rob
RobOPβ€’7mo ago
ok, we can do that is it worth me clicking through the interface to determine where the errors occur again? or just jump stratight to the db?
charles
charlesβ€’7mo ago
straight to db πŸ™‚
Rob
RobOPβ€’7mo ago
lets do it ok, ihave 60 rows in metadata.objectMetadata
charles
charlesβ€’7mo ago
check the one associated to your workspaceId (you might have multiple workspaces included the demo one) we are looking for an objectMetadata with nameSingular dealFlow
Rob
RobOPβ€’7mo ago
none of them have the nameSingular dealFlow, i have restored to before that name change was made. Here is the current error I am getting
charles
charlesβ€’7mo ago
these errors are "ok", we are fixing them in 0.12 but it's not your issue
Rob
RobOPβ€’7mo ago
FYI, I am also fine to delete the propsects/deal flow objects and just fix the person and company objects.
charles
charlesβ€’7mo ago
mmm could you browse the company page again? and see what error you have in the server logs I don't get why you don't have the dealFlow issue but let's move on πŸ™‚ (let's ignore these orderBy issues)
Rob
RobOPβ€’7mo ago
I reverted to before I renamed the object
charles
charlesβ€’7mo ago
ok!
Rob
RobOPβ€’7mo ago
got ya! will do
charles
charlesβ€’7mo ago
if you don't have any data in dealFlow it's better that you delete the customObject (or whatever the previous name is)
Rob
RobOPβ€’7mo ago
done!
charles
charlesβ€’7mo ago
great let's browse the app again (Companies / people page) and see if you have any other error
Rob
RobOPβ€’7mo ago
doing it now (just deleted all my custom objects) can i delete the opportunities object, or does that have some special code/functionality (like people and company does)?
charles
charlesβ€’7mo ago
you should not be able to delete the opportuniy object you are deleting from the UI right? :p
Rob
RobOPβ€’7mo ago
i am deleting from the ui
charles
charlesβ€’7mo ago
great! so you can't delete Opportunity because it's a Standard Object you can only deactivate it
Rob
RobOPβ€’7mo ago
correct, you can only deactivate the opporunitiy ok i think the only issues i am getting now is related to multi select and the orderBy
charles
charlesβ€’7mo ago
ok! could you post the multi-select error log again?
Rob
RobOPβ€’7mo ago
will do. please hold on while i collect that error... I think its the same as the order by maybe??? [ InternalServerErrorException: GraphQL errors on person: {"message":"Input for type personOrderBy contains extra keys ["country"]"} at computePgGraphQLError (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/utils/compute-pg-graphql-error.util.js:29:12) at WorkspaceQueryRunnerService.parseResult (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:275:80) at WorkspaceQueryRunnerService.findMany (/app/packages/twenty-server/dist/src/engine/api/graphql/workspace-query-runner/workspace-query-runner.service.js:60:21) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async field.resolve (/app/node_modules/@envelop/on-resolve/cjs/index.js:36:42) at async /app/node_modules/@graphql-tools/executor/cjs/execution/promiseForObject.js:18:35 at async Promise.all (index 0) { path: [ 'people' ], locations: [ [Object] ], extensions: [Object: null prototype] {} } ]
charles
charlesβ€’7mo ago
nope! These queries are failing indeed but they are triggered when browsing the Settings > Data Model
Rob
RobOPβ€’7mo ago
correct, that was when i browsed the data model
charles
charlesβ€’7mo ago
we are doing a sortBy relationName which we should not do :p
Rob
RobOPβ€’7mo ago
i tried to add another option to the multi but i am able to add more options to the multi select in the data model so, functionality is now all working for me
charles
charlesβ€’7mo ago
ok!
Rob
RobOPβ€’7mo ago
i have some errors appearing, as above, but are you saying i should ignore them and it will be fixed in upcoming releases?
charles
charlesβ€’7mo ago
yep, in 0.12
Rob
RobOPβ€’7mo ago
amazing, thank you so much for your time
charles
charlesβ€’7mo ago
let's check your workspace health and then you are good to go
Rob
RobOPβ€’7mo ago
please, lets do it!
charles
charlesβ€’7mo ago
can you connect to your container
Rob
RobOPβ€’7mo ago
done!
charles
charlesβ€’7mo ago
yarn command:prod workspace:health -w {yourWorkspaceId} -d cat logs/workspace-health-command/workspace-health-issues-xxx.json you should have ~3 errors
Rob
RobOPβ€’7mo ago
No description
Rob
RobOPβ€’7mo ago
11 issues and i cant cat ops can cat want me to paste to you the long cat output?
charles
charlesβ€’7mo ago
yep πŸ™‚
Rob
RobOPβ€’7mo ago
sending in DM it was too long for me to capture using the portainer. i can try and log in via command line, let me google how to do that in
charles
charlesβ€’7mo ago
it's all right! looks fine!
Rob
RobOPβ€’7mo ago
great. I will close this as solved, thanks charles
charles
charlesβ€’7mo ago
πŸ™‚
Want results from more Discord servers?
Add your server