#bookbrainz

/

      • MRiddickW joined the channel
      • 2021-11-26 33006, 2021

      • MRiddickW has quit
      • 2021-11-26 33044, 2021

      • ElimGarak joined the channel
      • 2021-11-26 33000, 2021

      • BrainzGit has quit
      • 2021-11-26 33000, 2021

      • dgw has quit
      • 2021-11-26 33000, 2021

      • ElimGarak is now known as dgw
      • 2021-11-26 33024, 2021

      • Shubh joined the channel
      • 2021-11-26 33039, 2021

      • Shubh
        Hey,I was setting up the dev enviroment of BB site, but got stuck in auth. it isn't working properly it stucks at loading screen when i try to signup. please help!
      • 2021-11-26 33025, 2021

      • monkey
        Hi Shubh !
      • 2021-11-26 33042, 2021

      • Shubh
        Hi!
      • 2021-11-26 33013, 2021

      • monkey
        Were you able to create an application token on the MusicBrainz website, and add it to your configuration?
      • 2021-11-26 33021, 2021

      • monkey
      • 2021-11-26 33039, 2021

      • Shubh
        Yes but it wont let me signup!
      • 2021-11-26 33054, 2021

      • monkey
        Do you get any error in your browser console?
      • 2021-11-26 33027, 2021

      • Shubh
        Uncaught (in promise) TypeError: e.body is undefined
      • 2021-11-26 33027, 2021

      • Shubh
      • 2021-11-26 33034, 2021

      • monkey
        Another thing that could be the reason: are the dependencies running, in particular redis is used for auth
      • 2021-11-26 33041, 2021

      • monkey
        Ah, well that looks like the issue then :)
      • 2021-11-26 33001, 2021

      • monkey
        Let's see what this is about
      • 2021-11-26 33022, 2021

      • Shubh
        so what can i do to debug this?
      • 2021-11-26 33027, 2021

      • monkey
        So the issue is coming from this line: https://github.com/bookbrainz/bookbrainz-site/blo…
      • 2021-11-26 33002, 2021

      • monkey
        Not sure what is happening, but it looks like the POST request failed in a strange way.
      • 2021-11-26 33006, 2021

      • Shubh
        also i set up the test database (change the config for database to BB_test and created the bb_test database as written in instruction ) but no data is showing in site, is it normal behaviour?
      • 2021-11-26 33021, 2021

      • monkey
        Did you try refreshing the page? Perhaps some files were not done compiling or something like that
      • 2021-11-26 33010, 2021

      • monkey
        If you set up a new database, then there will be no data in it, unless I'm misunderstanding what you are saying.
      • 2021-11-26 33035, 2021

      • Shubh
        I checked the docker build logs and didn't find any error related to compilation of files.
      • 2021-11-26 33015, 2021

      • monkey
        And refreshing the page you get the same result?
      • 2021-11-26 33035, 2021

      • monkey
        As for the database, the scripts we have available to download and use the latest database dump are pointing to the local database named `bookbrainz`, so you'll have to change that if you want to use another database name: https://github.com/bookbrainz/bookbrainz-site/blo…
      • 2021-11-26 33035, 2021

      • monkey
        See the part where it says `-d bookbrainz` , that's the database name
      • 2021-11-26 33007, 2021

      • Shubh
        and during registration where it shows dropdown for gender selection is'tnt showing male/female rather it says no result found.
      • 2021-11-26 33002, 2021

      • monkey
        Right, that's because the genders are retrieved from the database, and there's currently no data in there.
      • 2021-11-26 33051, 2021

      • Shubh
        Ohh so is that reason it showing undefined? but it is optional i think.
      • 2021-11-26 33056, 2021

      • monkey
        So let's go for one thing at a time. Database. Are you running postgres and other dependencies with Docker?
      • 2021-11-26 33004, 2021

      • Shubh
        Yes every dependency container is running redis postgres and elastic.
      • 2021-11-26 33029, 2021

      • monkey
        OK. So follow these instructions to create a database and download the latest DB dump: https://github.com/bookbrainz/bookbrainz-site#dat…
      • 2021-11-26 33013, 2021

      • monkey
        That will create a database named `bookbrainz` (so you'll have to change in your config from bb_test to bookbrainz)
      • 2021-11-26 33022, 2021

      • Shubh
        I just have to run that script after changing the database name to BB_test, right?
      • 2021-11-26 33054, 2021

      • monkey
        Well, the script expects that there is a database named `bookbrainz` specifically, not BB_test
      • 2021-11-26 33022, 2021

      • monkey
        So you can either use the standard DB name bookbrainz, or modify the script to use BB_test instead
      • 2021-11-26 33046, 2021

      • monkey
        I'd recommend option 1, it'll be easier later to have everything standard
      • 2021-11-26 33048, 2021

      • Shubh
        Hmm, lemme try
      • 2021-11-26 33057, 2021

      • monkey
        The whole section at the end of the readme about `bookbrainz_test` is about running tests locally, and you won't have data in there or use it to run the website locally. It's only for automated tests.
      • 2021-11-26 33053, 2021

      • Shubh
        So i will use bookbrainz database.
      • 2021-11-26 33040, 2021

      • monkey
        Great. You should then be able to run this command to create the database and download the dump automatically: ./scripts/database-init-docker.sh
      • 2021-11-26 33012, 2021

      • Shubh
        Thankyou very much monkey
      • 2021-11-26 33019, 2021

      • monkey
        No problem :)
      • 2021-11-26 33036, 2021

      • monkey
        Let me know once that's done and we can look at the next step together.
      • 2021-11-26 33058, 2021

      • monkey
        While that is running, you can already modify your configuration file to use the database "bookbrainz"
      • 2021-11-26 33002, 2021

      • Shubh
        Yes I will let you know soon i'm done with setting the db.
      • 2021-11-26 33020, 2021

      • Shubh
        Hmm i will do that
      • 2021-11-26 33027, 2021

      • Shubh has quit
      • 2021-11-26 33007, 2021

      • Shubh joined the channel
      • 2021-11-26 33009, 2021

      • Shubh
        Hello monkey?
      • 2021-11-26 33017, 2021

      • monkey
        Yup
      • 2021-11-26 33046, 2021

      • Shubh
        I was looking at the issues in bug tracker and found one good first issue
      • 2021-11-26 33010, 2021

      • Shubh
        it was related to api
      • 2021-11-26 33012, 2021

      • monkey
        Nice ! What's the ticket number? We've got a thing on here that gives us more details
      • 2021-11-26 33016, 2021

      • monkey
        For example: LB-123
      • 2021-11-26 33017, 2021

      • BrainzBot
        LB-123: Set up docker for MessyBrainz https://tickets.metabrainz.org/browse/LB-123
      • 2021-11-26 33018, 2021

      • Shubh
        BB-458
      • 2021-11-26 33019, 2021

      • BrainzBot
        BB-458: It is possible to delete an already deleted entity https://tickets.metabrainz.org/browse/BB-458
      • 2021-11-26 33024, 2021

      • monkey
        Great
      • 2021-11-26 33009, 2021

      • monkey
        So this isn't API related, it's an issue with the website
      • 2021-11-26 33026, 2021

      • monkey
        Let me test on test.bookbrainz.org
      • 2021-11-26 33013, 2021

      • Shubh
        If I understand the issue correctly, api have to respond with 400 code when entity is already deleted?
      • 2021-11-26 33054, 2021

      • monkey
        So the issue is this: If you visit this link you'll see the entity is deleted. There's no button to delete it.
      • 2021-11-26 33055, 2021

      • monkey
      • 2021-11-26 33027, 2021

      • monkey
        However, if you visit the same url with /delete at the end, you'll be able to delete it again: https://test.bookbrainz.org/work/9ae14fa8-d619-4c…
      • 2021-11-26 33050, 2021

      • monkey
        And that apparently makes the website crash :p
      • 2021-11-26 33034, 2021

      • Shubh
        Hmm it should return with 400 code or something rather than showing that write a note page?
      • 2021-11-26 33014, 2021

      • monkey
        It should indeed definitely not return that deletion page with the note thing
      • 2021-11-26 33025, 2021

      • monkey
        And I guess a 400 error seems appropriate
      • 2021-11-26 33009, 2021

      • monkey
        Or maybe a 409 (Conflict)
      • 2021-11-26 33039, 2021

      • monkey
        But what we do is send an html error page with a detailed error message, rather than just send back an error code
      • 2021-11-26 33002, 2021

      • Shubh
        So i have to create error page as well?
      • 2021-11-26 33015, 2021

      • Shubh
        I can do that , i think
      • 2021-11-26 33016, 2021

      • monkey
        No, that already exists, let me find an example
      • 2021-11-26 33048, 2021

      • monkey
        Ahaa, here we go
      • 2021-11-26 33055, 2021

      • Shubh
        "psql: error: could not connect to server: could not translate host name "postgres" to address: Name or service not known" , i check the postgres container is running , was it looking for local installion of postgres ?
      • 2021-11-26 33029, 2021

      • monkey
        Where is that error coming from?
      • 2021-11-26 33011, 2021

      • Shubh
        that download and import db script , after the download complete it shows this error
      • 2021-11-26 33056, 2021

      • monkey
        I see. That's strange.
      • 2021-11-26 33013, 2021

      • monkey
        Can you try running it again?
      • 2021-11-26 33018, 2021

      • Shubh
        " if [ $? -ne 0 ] ", does this check for the error code thrown by curl?
      • 2021-11-26 33013, 2021

      • Shubh
        might be internet issue i am trying again.
      • 2021-11-26 33026, 2021

      • monkey
        Looks like a separate error
      • 2021-11-26 33045, 2021

      • monkey
        "psql: error: could not connect to server" doesn not look like an issue with downloading the dump
      • 2021-11-26 33024, 2021

      • monkey
        Did you modify the docker-compose.yml file in any way, by any chance?
      • 2021-11-26 33015, 2021

      • Shubh
        No i didn't touch that file
      • 2021-11-26 33040, 2021

      • monkey
        OK. I don't understand why the container can't reach the postgres container.
      • 2021-11-26 33034, 2021

      • Shubh
        Hmm i think it has something to do with my internet.
      • 2021-11-26 33038, 2021

      • monkey
        Are there any errors in the postgres container? you can run `docker logs postgres` to see that
      • 2021-11-26 33011, 2021

      • monkey
        If it was an internet issue I would expect the error to be thrown here https://github.com/bookbrainz/bookbrainz-site/blo…
      • 2021-11-26 33011, 2021

      • monkey
        Instead it is thrown here which suggests another issue
      • 2021-11-26 33012, 2021

      • monkey
      • 2021-11-26 33021, 2021

      • MRiddickW joined the channel
      • 2021-11-26 33047, 2021

      • Shubh
        now it doesn't even downloading that db file.
      • 2021-11-26 33008, 2021

      • monkey
        If it detects that it is already downloaded, then it will skip the download
      • 2021-11-26 33028, 2021

      • monkey
      • 2021-11-26 33040, 2021

      • Shubh
        i deleted that file from temp
      • 2021-11-26 33002, 2021

      • monkey
        I don't think that was necessary, but what the hell, let's try from scratch :)
      • 2021-11-26 33037, 2021

      • Shubh
        " 100 23.6M 100 23.6M 0 0 53130 0 0:07:45 0:07:45 --:--:-- 516kz
      • 2021-11-26 33037, 2021

      • Shubh
        psql: error: could not connect to server: could not translate host name "postgres" to address: Name or service not known
      • 2021-11-26 33038, 2021

      • Shubh
        Importing the bookbrainz database failed." here we go again :<
      • 2021-11-26 33018, 2021

      • monkey
        OK, so not an internet issue, looks like downloading succeeds.
      • 2021-11-26 33032, 2021

      • monkey
        What do you see when you run `docker ps` ?
      • 2021-11-26 33052, 2021

      • Shubh
        all the container redis postgres and others..
      • 2021-11-26 33015, 2021

      • monkey
        And could you paste the output of the command `docker logs postgres` in a pastebin ?
      • 2021-11-26 33030, 2021

      • Shubh
        hmm i will do that
      • 2021-11-26 33020, 2021

      • Shubh
      • 2021-11-26 33006, 2021

      • monkey
        OK, I see no obvious error. Let's try something: take everything down first (run the command `./stop.sh`), and then run the download-import-script command yet again
      • 2021-11-26 33040, 2021

      • monkey
        If it fails again, I'd like to see the output of `docker logs postgres` again
      • 2021-11-26 33019, 2021

      • Shubh
        Btw which example you was talking about?
      • 2021-11-26 33048, 2021

      • monkey
        I'll write all the details relating to the ticket in the ticket itself, it'll be easier
      • 2021-11-26 33053, 2021

      • Shubh
        download complete but same error , shouldn't i run the postgres container first before running the script?
      • 2021-11-26 33015, 2021

      • monkey
        Part of the script should already automatically be doing that
      • 2021-11-26 33024, 2021

      • monkey
        Is the container not running currently?
      • 2021-11-26 33033, 2021

      • Shubh
        no it isn't
      • 2021-11-26 33055, 2021

      • monkey
        Ah. That's an issue.
      • 2021-11-26 33004, 2021

      • monkey
        What does docker logs postgres output?
      • 2021-11-26 33021, 2021

      • Shubh
        Error: No such container: postgres
      • 2021-11-26 33059, 2021

      • monkey
        Hm. Let me try locally
      • 2021-11-26 33001, 2021

      • Shubh
        does script also run build the container? i don't find any code related to that in that script file, am i missing something?
      • 2021-11-26 33007, 2021

      • monkey
        Yes, that's the first line of database-init-docker.sh
      • 2021-11-26 33025, 2021

      • Shubh
        but i didn't run that script
      • 2021-11-26 33050, 2021

      • Shubh
        i ran that download-import-dump.sh script after stopping all the container via stop.sh
      • 2021-11-26 33032, 2021

      • monkey
        Ah, then yes, that's the issue. Sorry I got something wrong.
      • 2021-11-26 33032, 2021

      • monkey
        Please follow the directions on the readme, cause apparently I can't remember everything right :) https://github.com/bookbrainz/bookbrainz-site#dat…
      • 2021-11-26 33026, 2021

      • Shubh
        " scripts/wait-for-postgres.sh: 7: scripts/wait-for-postgres.sh: pg_isready: not found
      • 2021-11-26 33027, 2021

      • Shubh
        Postgres is not ready - sleeping." is this normal behaviour?
      • 2021-11-26 33051, 2021

      • monkey
        There we go, that's the script that ensure that postgres is running.
      • 2021-11-26 33006, 2021

      • monkey
        So if it doesn't proceed that means postgres isn't running properly
      • 2021-11-26 33006, 2021

      • Shubh
        that means...
      • 2021-11-26 33036, 2021

      • monkey
        Now try to see if the postgres container is running, and if it is what `docker logs postgres` gives you
      • 2021-11-26 33020, 2021

      • Shubh
        2021-11-26 15:35:48.226 UTC [13] LOG: database system was shut down at 2021-11-26 15:21:48 UTC
      • 2021-11-26 33020, 2021

      • Shubh
        2021-11-26 15:35:48.284 UTC [1] LOG: database system is ready to accept connections
      • 2021-11-26 33046, 2021

      • monkey
        OK, let's try that database-init-docker script again
      • 2021-11-26 33058, 2021

      • monkey
        Maybe it just needed a bit of time. I know I do in the morning…
      • 2021-11-26 33036, 2021

      • Shubh
        same message sleeping thing
      • 2021-11-26 33009, 2021

      • monkey
        Let's wait a bit and see if it gets to "Postgres is accepting connections - executing command"
      • 2021-11-26 33055, 2021

      • Shubh
        Hmm wait...
      • 2021-11-26 33047, 2021

      • Shubh
        Its still sleeping :< , should i try setting up the enviroment again from scratch after removing the docker images?
      • 2021-11-26 33041, 2021

      • monkey
        Hmm. Any more information from `docker logs postgres`?
      • 2021-11-26 33011, 2021

      • Shubh
        nah, same as before
      • 2021-11-26 33022, 2021

      • monkey
        Deleting the docker image won't help. However you might want to delete the container and the volume it uses.
      • 2021-11-26 33033, 2021

      • monkey
        You can do ./stop.sh to take everything down
      • 2021-11-26 33040, 2021

      • Shubh
        why postgres not ready? what could the possible reasons?
      • 2021-11-26 33002, 2021

      • monkey
        To be honest I can't tell without more info.
      • 2021-11-26 33009, 2021

      • monkey
        Huh, wait a second
      • 2021-11-26 33039, 2021

      • Shubh
        Ha!