#Database error in Backend

1 messages · Page 1 of 1 (latest)

steep ferry
#

Hey Guys, I have followed the yarn setup guide to setup my server and frontend on my windows machine in wsl.
When i run yarn database:init, I get this error: Failed to perform 'create extension pg_graphql': QueryFailedError: extension "pg_graphql" is not available
And when I run the server, I get this error.

Any ideas on how I can fix this?

#

this is the logs for the server code:

waxen igloo
#

Hi @steep ferry what is your setup? Mac, Linux, WSL?

steep ferry
#

WSL

waxen igloo
#

sorry, it's written above, I read too fast :p

steep ferry
#

It's alright👍

waxen igloo
#

What is the output of make provision-postgres-linux ?

#

It seems that your postgres database is not setup properly, the pg_graphql postgres extension is not there which is the purpose of this script

steep ferry
#

You mean this command right? bash ./infra/dev/scripts/setup-postgres-linux.sh

waxen igloo
#

yes

#

you can also execute it through make but it's doing the same

steep ferry
#

It is running fine. It completes all the 4 steps.

#

I am getting this as output

waxen igloo
#

ok, could you connect to your db and see what is the output of the following SQL query: CREATE extension pg_graphql;

#

and what postgres version do you have?

steep ferry
#

Postgres version is 16.1

waxen igloo
#

mmmh ok!

#

I don't think it works with Postgres16 yet

#

could you try with postgres15?

steep ferry
#

I am getting this as output when i run CREATE extension pg_graphql:

steep ferry
waxen igloo
#

above, you forgot the semi-column ";"

#

your SQL query has not been sent

steep ferry
#

Oh, my bad :p.
This is the output now:

waxen igloo
#

yes, your pg_graphql extension is not installed

#

try with postgres15

#

the setup-postgres-linux.sh script is actually targetting PG_MAIN_VERSION=15, so you might actually have two versions of postgres installed

#

make sure to use the right one

steep ferry
#

Thanks @waxen igloo .It is working now.
But now, I have a different kind of problem. When I run frontend and change something in the code, it compiles for like 5 mins and in the end it gives the following error

waxen igloo
#

Ok, we will add to the doc that we don't support postgres16 for now

#

Regarding your error, I think your node doesn't have enough memory. The FE build is quite heavy (especially with typescript check). How much memory do you have on WSL?

steep ferry
waxen igloo
#

could you run the front build and monitor the memory

steep ferry
#

The memory consumption of WSL goes till 2.9GB and then i get build failed error in terminal.

waxen igloo
#

We are indeed using a lot of memories, we will look into that. In the meantime, any way you could increase the memory available for WSL?

waxen igloo
#

(it takes also a lot of memory on my side)

steep ferry
#

But still, there's a significant difference. Your memory consumption is 420 MB, while mine is 2.9 GB.

steep ferry
waxen igloo
#

@steep ferry actually no, my consumption is the same of all those processes

#

They are child processes of the top one!

steep ferry
#

Oh Okay!

#

I figured out the main problem behind this issue. Basically there is a problem with vscode-remote-server. There's even an issue open from 2021 but still it has not been fixed. What happens is when a file is opened in that WSL remote server, it somehow consumes a lot of extra memory. So, I figured a workaround which is to open the VS Code directory in normal mode and run the commands in WSL which solved the issue for me.

#

Thanks, @waxen igloo, for your help in fixing the above issues. Much appreciated:)