Periodic table and Guessing game

I completed periodic table and even created the pg dumb file post in github ,
codeally@08e475368417:~/project$ psql --username=freecodecamp --dbname=periodic_table psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory Is the server running locally and accepting connections on that socket? codeally@08e475368417:~/project$ psql -U freecodecamp -d periodic_table -f /home/codeally/project/periodic_table/periodic_table.sql psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory Is the server running locally and accepting connections on that socket?
then I start with guess_game and now when I run my number_guess.sh You guessed it in 9 tries. The secret number was 898. Nice job!
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
both error it seems they are related. Please help?

If you boot up either of those courses, do they load correctly?
Does the CodeRoad window open and run the tests?
Can you connect to your databases in the terminal with a psql command or is that where you’re getting that error?

1 Like

periodic_table it won’t let me connect to to the postgres part username but the the guessing_game I can connect but every time I run the script to test the output that error is there.

Yes, CodeRoad run the test for both.

These errors seem to crop up when there’s an outage, which is usually temporary. It’s working for me right now and I can connect to the database, rebuild it etc without issue.
Is this a persistent issue for you or can you try again to see if it’s back up again?

1 Like

I have been trying to wait since yesterday, that is why I skip to complete periodic table and went to finish guessing_game, now the same error is effecting both project, You won’t believe how many times I deleted and start all over at the end I am back to error message shows up You guessed it in 11 tries. The secret number was 483. Nice job!
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
codeally@852e291acb92:~/project/number_guessing_game$ ./number_guess.sh
Enter your username:
testuser
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
Welcome, testuser! It looks like this is your first time here.
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
Guess the secret number between 1 and 1000:
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist

I’ve recently completed this certification and have managed to get a lot of other campers’ code to pass too (i.e. where the code is correct but the tests are failing because of issues with the testing environment).

If you feel like PMing me your code for these projects, I can take a look later and see if I can get around any errors and get them to pass?

1 Like

periodic_table I passed completed posted in github but there is no check mark in the curriculum side and when Iwent back that is when the issue started with this error codeally@08e475368417:~/project$ psql --username=freecodecamp --dbname=periodic_table psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory Is the server running locally and accepting connections on that socket? codeally@08e475368417:~/project$ psql -U freecodecamp -d periodic_table -f /home/codeally/project/periodic_table/periodic_table.sql psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory Is the server running locally and accepting connections on that socket? My code and script is good and passed with periodi_game, guessing game the only issue I have is with this error codeally@a84ea6d28a0d:~/project$ cd number_guessing_game
codeally@a84ea6d28a0d:~/project/number_guessing_game$ ./number_guess.sh
Enter your username:
testuser
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
Welcome, testuser! It looks like this is your first time here.
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: role “codeally” does not exist
Guess the secret number between 1 and 1000: I will never pass “If that username has been used before, it should print” because as you can my script won’t connect to postgres.

Without seeing your code I can’t see why you are having database connection issues either in your script or via psql commands. If you can share your GitHub repo links, I’m happy to see if I can replicate the issue at my end though?

1 Like

Ok, I did the following and your code from your repo passed first time for me:

  1. Delete the project container at codeally.io
  2. Boot up the course via FCC
  3. Connect to the database (as per project instructions)
  4. DROP TABLE on both tables (because DROP DATABASE command won’t work in this case because of ownership)
  5. Bring in the sql file from your repo
  6. Run the database rebuild command (as per project instructions)
  7. Create periodic_table folder and initialise repo
  8. Create element.sh file and paste in code from your repo
  9. Make spurious edits to sh file just to get required five commits
  10. Run tests
1 Like

Thank you for all the help, truly appreciated, I knew all that but I am afraid it will happen again without knowing the root cause, since I passed, the other good news I have found the problem with guessing game and I almost at the finish line thank you again.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.