Error while importing DATABASE dump of bookbrainz on my local setup

hi ,
myself DIVYANSHU RAJ , a undergrad at IIT-ROORKEE ,india .
i am getting following error while importing “latest.sql”

Hi Raj!
Nice to see you on the forums :slight_smile:

I’m not sure what’s going on there, but what I would suggest is to completely remove the database and start from scratch.
Before importing, you’ll need to run the ./scripts/database-init-docker.sh script as explained in https://github.com/bookbrainz/bookbrainz-site#database-set-up

Let me know if that worked for you, and good luck !

2 Likes

actually i am doing my set up outside of docker ,and getting same error
what should i do in that case .
@mr_monkey

Hi @endurance21,

I had another look and tried the setup from scratch myself.
I updated slightly the manual database setup instructions, which you can find here:

2 Likes

the steps till setting up my database were fine, but now, there is a new error.

i am following the commands on ubuntu.


after the bzip2 command, i am not able to follow along. also, i have tried to uninstall and reinstall postgreSQL but with no improvement.
Any help/suggestion will be most welcomed.

hey ! @Prabhleen
i faced the same problem before .
you can follow these steps to solve that .

  1. find the PID of application running on 127.0.0.1 and port 5432
  2. kill the process with known PID
    3.and restart the server of postresql .

commands to use on ubuntu , according to steps mentioned above;

  1. netstat -tnlp
    it will list all programme and respective PID , just find the PID manually .
  2. kill “PID”
  3. sudo systemctl restart postgresql
if you don't find any PID , just do step 3

let me know if you got over this or not !!

3 Likes

@endurance21 thanks a lot!. apologies for the delay in replay. i am getting the following message.


it would be a great help, if you can guide. :slightly_smiling_face:

1 Like

hey @Prabhleen
try
sudo netstat -tnlp
and then find PID
and then
kill “PID”

and also
try
sudo service postgresql restart instead of sudo systemctl restart postgresql

1 Like

thanks a lot everyone! :grinning:… everything just worked, and the database is set up but now the last command after setting the database is not working. @mr_monkey

this is the last one… thank you!

ya i also faced same problem, but did’nt get any solutions .
@mr_monkey
can you please help!

From just this information, I’m not sure I can help much.
I would need to see all of the output of the database setup commands; it’s likely that something went wrong along the way.

Was there anything that looked like an error message or a warning?

I would recommend starting from scratch (remove the bookbrainz database in postgres and start the process again), and copying all the output logs into a pastebin so that I can have a look.

4 Likes

i tried to find existing relations, and here is the output.


@mr_monkey, please tell if we can get anything from this output ,else, from where do i have to redo the work?

@mr_monkey i tried to solve the warning, that i got when running this command:

psql -h localhost -U postgres --command=“CREATE DATABASE bookbrainz”

WARNING: could not flush dirty data: Function not implemented

So, i did this:
image

and then after restarting the server, here is my output:


after giving the last command, it is asking for an input

Hi again!
For that last command that asks for an input, that’s because of quotation marks in the command you’re trying to run.
You’ve got "SELECT name FROM "bookbrainz.editor" Instead of "SELECT name FROM bookbrainz.editor" (note the extra " in front of bookbrainz.editor)

If after that the query still throws that same “relation does not exist” error, then I recommend to

  1. Run these commands to delete the database entirely:
    psql -h localhost -U postgres --command="DROP SCHEMA bookbrainz CASCADE"
    followed by
    psql -h localhost -U postgres --command="DROP SCHEMA musicbrainz CASCADE"
  2. Run again the command to import the database dump:
    psql -h localhost -U postgres -f latest.sql

Please copy and paste the output of all of these commands into a pastebin (meaning copy all the text, rather than take an image screenshot): https://pastebin.com/

Hope it works, good luck! :slight_smile:

2 Likes

@mr_monkey i tried the commands that you gave, with no change in the output.

my commands with output are here.

It’s has been nearly a week, that i am trying to set this up!.:slightly_frowning_face:

Thanks for your patience, I had a hard time finding out what the issue was.
I believe I have it now: when importing the database dump, there is a flag missing to specify the database. So it should be:
psql -h localhost -U postgres -d bookbrainz -f latest.sql

Let me know if that works for you, and I will update the docs accordingly.

And thanks for helping me identify that issue !

4 Likes

@mr_monkey Thanks a lot! It really solved a great issue!
OMG, I am so relieved. :smile:

Now, my node.js, dependencies and database are all set, just have to add the flow extension and i think, i am good to go.
So, thrilled that i can contribute now.

2 Likes

Glad that worked, and thanks again for helping me find the issue !

I look forward to seeing your contributions :slight_smile:

1 Like