Tell us what’s happening:
I try to finsih Build a Database of Video Game Characters - Build a Database of Video Game Characters on freecodecamp, i do it on browser, 80% completed. TEST SHOWN Test Runner Failed , i have tried reset the test, and stop the terminal and open new, but it still failed?
I tried to ask GPT, but unfix until the usage ran out, here is what i get now, can any give me a hand to fix it? thanks.
camper: /project$ ls
backup.sql mario_backup.sql second_backup.sql
camper: /project$ cat backup.sql
-- PostgreSQL database cluster dump
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
camper: /project$ cat backup.sqlgrep -E "CREATE TABLE|INSERT INTO|COPY " backup.sql | head -30
cat: backup.sqlgrep: No such file or directory
cat: 'CREATE TABLE|INSERT INTO|COPY ': No such file or directory
--$
-- PostgreSQL database cluster dump$
--$
$
SET default_transaction_read_only = off;$
$
SET client_encoding = 'UTF8';$
SET standard_conforming_strings = on;$
$
camper: /project$ grep -E "CREATE TABLE|INSERT INTO|COPY " mario_backup.sql | head -30
CREATE TABLE public.actions (
CREATE TABLE public.character_actions (
CREATE TABLE public.characters (
CREATE TABLE public.more_info (
CREATE TABLE public.sounds (
COPY public.actions (action_id, action) FROM stdin;
COPY public.character_actions FROM stdin;
COPY public.characters (character_id, name, homeland, favorite_color) FROM stdin;
COPY public.more_info (more_info_id, birthday, height_in_cm, weight_in_kg, character_id) FROM stdin;
COPY public.sounds (sound_id, filename, character_id) FROM stdin;
camper: /project$ grep -E "CREATE TABLE|INSERT INTO|COPY " second_backup.sql | head -30
camper: /project$ psql --version
psql (PostgreSQL) 12.22 (Ubuntu 12.22-0ubuntu0.20.04.4)
camper: /project$ pg_isready
/var/run/postgresql:5432 - accepting connections
camper: /project$ psql --username=freecodecamp --dbname=postgres
Border style is 2.
Title is " ".
Pager usage is off.
psql (12.22 (Ubuntu 12.22-0ubuntu0.20.04.4))
Type "help" for help.
postgres=> \l
List of databases
+-----------------+--------------+----------+---------+---------+-----------------------+
| Name | Owner | Encoding | Collate | Ctype | Access privileges |
+-----------------+--------------+----------+---------+---------+-----------------------+
| mario_database | freecodecamp | UTF8 | C.UTF-8 | C.UTF-8 | |
| postgres | postgres | UTF8 | C.UTF-8 | C.UTF-8 | |
| seocnd_database | freecodecamp | UTF8 | C.UTF-8 | C.UTF-8 | |
| template0 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +|
| | | | | | postgres=CTc/postgres |
| template1 | postgres | UTF8 | C.UTF-8 | C.UTF-8 | =c/postgres +|
| | | | | | postgres=CTc/postgres |
+-----------------+--------------+----------+---------+---------+-----------------------+
(5 rows)
postgres=> \q
camper: /project$ psql --username=freecodecamp --dbname=mario_database < mario_backup.sql
Border style is 2.
Title is " ".
Pager usage is off.
SET
SET
SET
SET
SET
+------------+
| set_config |
+------------+
| |
+------------+
(1 row)
SET
SET
SET
SET
SET
SET
ERROR: relation "actions" already exists
ALTER TABLE
ERROR: relation "actions_action_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "character_actions" already exists
ALTER TABLE
ERROR: relation "characters" already exists
ALTER TABLE
ERROR: relation "characters_character_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "more_info" already exists
ALTER TABLE
ERROR: relation "more_info_more_info_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ERROR: relation "sounds" already exists
ALTER TABLE
ERROR: relation "sounds_sound_id_seq" already exists
ALTER TABLE
ALTER SEQUENCE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ALTER TABLE
ERROR: duplicate key value violates unique constraint "actions_action_key"
DETAIL: Key (action)=(run) already exists.
CONTEXT: COPY actions, line 1
COPY 0
ERROR: duplicate key value violates unique constraint "characters_pkey"
DETAIL: Key (character_id)=(2) already exists.
CONTEXT: COPY characters, line 1
ERROR: duplicate key value violates unique constraint "more_info_character_id_key"
DETAIL: Key (character_id)=(1) already exists.
CONTEXT: COPY more_info, line 1
ERROR: duplicate key value violates unique constraint "sounds_filename_key"
DETAIL: Key (filename)=(its-a-me.wav) already exists.
CONTEXT: COPY sounds, line 1
+--------+
| setval |
+--------+
| 3 |
+--------+
(1 row)
+--------+
| setval |
+--------+
| 7 |
+--------+
(1 row)
+--------+
| setval |
+--------+
| 7 |
+--------+
(1 row)
+--------+
| setval |
+--------+
| 8 |
+--------+
(1 row)
ERROR: relation "actions_action_key" already exists
ERROR: multiple primary keys for table "actions" are not allowed
ERROR: multiple primary keys for table "characters" are not allowed
ERROR: relation "more_info_character_id_key" already exists
ERROR: multiple primary keys for table "more_info" are not allowed
ERROR: relation "sounds_filename_key" already exists
ERROR: multiple primary keys for table "sounds" are not allowed
ERROR: constraint "more_info_character_id_fkey" for relation "more_info" already exists
ERROR: constraint "sounds_character_id_fkey" for relation "sounds" already exists
camper: /project$ psql --username=freecodecamp --dbname=mario_database
Border style is 2.
Title is " ".
Pager usage is off.
psql (12.22 (Ubuntu 12.22-0ubuntu0.20.04.4))
Type "help" for help.
mario_database=> \dt
List of relations
+--------+-------------------+-------+--------------+
| Schema | Name | Type | Owner |
+--------+-------------------+-------+--------------+
| public | actions | table | freecodecamp |
| public | character_actions | table | freecodecamp |
| public | characters | table | freecodecamp |
| public | more_info | table | freecodecamp |
| public | sounds | table | freecodecamp |
+--------+-------------------+-------+--------------+
(5 rows)
mario_database=> SELECT * FROM characters;
+--------------+--------+------------------+----------------+
| character_id | name | homeland | favorite_color |
+--------------+--------+------------------+----------------+
| 2 | Luigi | Mushroom Kingdom | Green |
| 3 | Peach | Mushroom Kingdom | Pink |
| 7 | Yoshi | Dinosaur Land | Green |
| 6 | Daisy | Sarasaland | Orange |
| 1 | Mario | Mushroom Kingdom | Red |
| 4 | Toad | Mushroom Kingdom | Blue |
| 5 | Bowser | Koopa Kingdom | Yellow |
+--------------+--------+------------------+----------------+
(7 rows)
mario_database=> SELECT * FROM actions;
mario_database=>
+-----------+--------+
| action_id | action |
+-----------+--------+
| 1 | run |
| 2 | jump |
| 3 | duck |
+-----------+--------+
(3 rows)
mario_database=> SELECT * FROM more_info;
+--------------+------------+--------------+--------------+--------------+
| more_info_id | birthday | height_in_cm | weight_in_kg | character_id |
+--------------+------------+--------------+--------------+--------------+
| 1 | 1981-07-09 | 155 | 64.5 | 1 |
| 2 | 1983-07-14 | 175 | 48.8 | 2 |
| 3 | 1985-10-18 | 173 | 52.2 | 3 |
| 4 | 1950-01-10 | 66 | 35.6 | 4 |
| 5 | 1990-10-29 | 258 | 300.0 | 5 |
| 6 | 1989-07-31 | | | 6 |
| 7 | 1990-04-13 | 162 | 59.1 | 7 |
+--------------+------------+--------------+--------------+--------------+
(7 rows)
mario_database=> psql --username=freecodecamp --dbname=mario_database
mario_database-> \dt
List of relations
+--------+-------------------+-------+--------------+
| Schema | Name | Type | Owner |
+--------+-------------------+-------+--------------+
| public | actions | table | freecodecamp |
| public | character_actions | table | freecodecamp |
| public | characters | table | freecodecamp |
| public | more_info | table | freecodecamp |
| public | sounds | table | freecodecamp |
+--------+-------------------+-------+--------------+
(5 rows)
mario_database-> SELECT * FROM characters;
ERROR: syntax error at or near "psql"
LINE 1: psql
^
mario_database=> \q
camper: /project$ ls -la
total 40
drwxr-xr-x 1 camper camper 4096 Sep 24 00:03 .
drwxr-xr-x 1 root root 4096 Sep 22 03:20 ..
-rw-r--r-- 1 camper camper 154 Sep 24 00:01 backup.sql
drwxr-xr-x 4 camper camper 4096 Sep 24 00:14 .freeCodeCamp
drwxr-xr-x 8 camper camper 4096 Sep 24 00:14 .git
-rw-r--r-- 1 camper camper 8641 Sep 24 00:02 mario_backup.sql
-rw-r--r-- 1 camper camper 555 Sep 24 00:03 second_backup.sql
camper: /project$ ls -la /workspace/project/.freeCodeCamp
total 32
drwxr-xr-x 4 camper camper 4096 Sep 24 00:14 .
drwxr-xr-x 1 camper camper 4096 Sep 24 00:03 ..
-rw-r--r-- 1 camper camper 10131 Sep 24 00:14 db.sql
-rw-r--r-- 1 camper camper 133 Sep 24 00:14 .mocharc.json
drwxr-xr-x 118 camper camper 4096 Sep 22 03:20 node_modules
drwxr-xr-x 2 camper camper 4096 Sep 23 23:47 test
camper: /project$ ls -la /workspace/project/.freeCodeCamp/test
total 20
drwxr-xr-x 2 camper camper 4096 Sep 23 23:47 .
drwxr-xr-x 4 camper camper 4096 Sep 24 00:14 ..
-rw-r--r-- 1 camper camper 551 Sep 24 00:41 .cwd
-rw-r--r-- 1 camper camper 5405 Sep 24 00:43 .next_command
camper: /project$ cat /workspace/project/.freeCodeCamp/test/.next_command
touch /workspace/project/.freeCodeCamp/test/.next_command /workspace/project/.freeCodeCamp/test/.cwd
sudo service postgresql start
sudo service postgresql start
sudo service postgresql start
psql --username=freecodecamp --dbname=postgres -c "\l"
./.freeCodeCamp/test.sh
pg_dumpall -U freecodecamp > backup.sql
pg_dump -U freecodecamp mario_database > mario_backup.sql
pg_dump -U freecodecamp seocnd_database > second_backup.sql
ls --color=auto -lh backup.sql mario_backup.sql second_backup.sql
builtin unset VSCODE_INJECTION
[ -z "$VSCODE_SHELL_INTEGRATION" ]
[ "${VSCODE_PREVENT_SHELL_HISTORY:-}" = "1" ]
[ -n "${VSCODE_ENV_REPLACE:-}" ]
[ -n "${VSCODE_ENV_PREPEND:-}" ]
[ -n "${VSCODE_ENV_APPEND:-}" ]
[ -z "${VSCODE_PYTHON_AUTOACTIVATE_GUARD:-}" ]
export VSCODE_PYTHON_AUTOACTIVATE_GUARD=1
[ -n "${VSCODE_PYTHON_BASH_ACTIVATE:-}" ]
for var in "${!VSCODE_PYTHON_@}"
case "$var" in
__vsc_regex_environment="^CYGWIN*|MINGW*|MSYS*"
[[ "$(uname -s)" =~ $__vsc_regex_environment ]]
__vsc_is_windows=0
__vsc_regex_histcontrol=".(erasedups|ignoreboth|ignoredups|ignorespace)."
[[ "${HISTCONTROL:-}" =~ $__vsc_regex_histcontrol ]]
__vsc_history_verify=1
builtin unset __vsc_regex_environment
builtin unset __vsc_regex_histcontrol
__vsc_initialized=0
__vsc_original_PS1="$PS1"
__vsc_original_PS2="$PS2"
__vsc_custom_PS1=""
__vsc_custom_PS2=""
__vsc_in_command_execution="1"
__vsc_current_command=""
__vsc_nonce="$VSCODE_NONCE"
unset VSCODE_NONCE
__vsc_stable="$VSCODE_STABLE"
unset VSCODE_STABLE
[ "$__vsc_stable" = "0" ]
[ -n "$STARSHIP_SESSION_KEY" ]
[ -n "$POSH_SESSION_ID" ]
builtin printf '\e]633;P;HasRichCommandDetection=True\a'
[[ -n "${bash_preexec_imported:-}" ]]
__vsc_dbg_trap="$(__vsc_get_trap DEBUG)"
[[ -z "$__vsc_dbg_trap" ]]
[[ "$__vsc_dbg_trap" != '__vsc_preexec "$"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$"' ]]
trap '__vsc_preexec_all "$"' DEBUG
vsc_original_prompt_command=${PROMPT_COMMAND:-}
sudo service postgresql start
builtin unset VSCODE_INJECTION
[ -z "$VSCODE_SHELL_INTEGRATION" ]
[ "${VSCODE_PREVENT_SHELL_HISTORY:-}" = "1" ]
[ -n "${VSCODE_ENV_REPLACE:-}" ]
[ -n "${VSCODE_ENV_PREPEND:-}" ]
[ -n "${VSCODE_ENV_APPEND:-}" ]
[ -z "${VSCODE_PYTHON_AUTOACTIVATE_GUARD:-}" ]
export VSCODE_PYTHON_AUTOACTIVATE_GUARD=1
[ -n "${VSCODE_PYTHON_BASH_ACTIVATE:-}" ]
for var in "${!VSCODE_PYTHON@}"
case "$var" in
__vsc_regex_environment="^CYGWIN*|MINGW*|MSYS*"
[[ "$(uname -s)" =~ $__vsc_regex_environment ]]
__vsc_is_windows=0
__vsc_regex_histcontrol=".(erasedups|ignoreboth|ignoredups|ignorespace)."
[[ "${HISTCONTROL:-}" =~ $__vsc_regex_histcontrol ]]
__vsc_history_verify=1
builtin unset __vsc_regex_environment
builtin unset __vsc_regex_histcontrol
__vsc_initialized=0
__vsc_original_PS1="$PS1"
__vsc_original_PS2="$PS2"
__vsc_custom_PS1=""
__vsc_custom_PS2=""
__vsc_in_command_execution="1"
__vsc_current_command=""
__vsc_nonce="$VSCODE_NONCE"
unset VSCODE_NONCE
__vsc_stable="$VSCODE_STABLE"
unset VSCODE_STABLE
[ "$__vsc_stable" = "0" ]
[ -n "$STARSHIP_SESSION_KEY" ]
[ -n "$POSH_SESSION_ID" ]
builtin printf '\e]633;P;HasRichCommandDetection=True\a'
[[ -n "${bash_preexec_imported:-}" ]]
__vsc_dbg_trap="$(__vsc_get_trap DEBUG)"
[[ -z "$__vsc_dbg_trap" ]]
[[ "$__vsc_dbg_trap" != '__vsc_preexec "$"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$"' ]]
trap '__vsc_preexec_all "$"' DEBUG
vsc_original_prompt_command=${PROMPT_COMMAND:-}
git checkout origin/main -- .freeCodeCamp/
git fetch origin
builtin unset VSCODE_INJECTION
[ -z "$VSCODE_SHELL_INTEGRATION" ]
[ "${VSCODE_PREVENT_SHELL_HISTORY:-}" = "1" ]
[ -n "${VSCODE_ENV_REPLACE:-}" ]
[ -n "${VSCODE_ENV_PREPEND:-}" ]
[ -n "${VSCODE_ENV_APPEND:-}" ]
[ -z "${VSCODE_PYTHON_AUTOACTIVATE_GUARD:-}" ]
export VSCODE_PYTHON_AUTOACTIVATE_GUARD=1
[ -n "${VSCODE_PYTHON_BASH_ACTIVATE:-}" ]
for var in "${!VSCODE_PYTHON@}"
case "$var" in
__vsc_regex_environment="^CYGWIN*|MINGW*|MSYS*"
[[ "$(uname -s)" =~ $__vsc_regex_environment ]]
__vsc_is_windows=0
__vsc_regex_histcontrol=".(erasedups|ignoreboth|ignoredups|ignorespace)."
[[ "${HISTCONTROL:-}" =~ $__vsc_regex_histcontrol ]]
__vsc_history_verify=1
builtin unset __vsc_regex_environment
builtin unset __vsc_regex_histcontrol
__vsc_initialized=0
__vsc_original_PS1="$PS1"
__vsc_original_PS2="$PS2"
__vsc_custom_PS1=""
__vsc_custom_PS2=""
__vsc_in_command_execution="1"
__vsc_current_command=""
__vsc_nonce="$VSCODE_NONCE"
unset VSCODE_NONCE
__vsc_stable="$VSCODE_STABLE"
unset VSCODE_STABLE
[ "$__vsc_stable" = "0" ]
[ -n "$STARSHIP_SESSION_KEY" ]
[ -n "$POSH_SESSION_ID" ]
builtin printf '\e]633;P;HasRichCommandDetection=True\a'
[[ -n "${bash_preexec_imported:-}" ]]
__vsc_dbg_trap="$(__vsc_get_trap DEBUG)"
[[ -z "$__vsc_dbg_trap" ]]
[[ "$__vsc_dbg_trap" != '__vsc_preexec "$"' && "$__vsc_dbg_trap" != '__vsc_preexec_all "$"' ]]
trap '__vsc_preexec_all "$_"' DEBUG
__vsc_original_prompt_command=${PROMPT_COMMAND:-}
ls --color=auto
cat backup.sql
cat backup.sqlgrep -E "CREATE TABLE|INSERT INTO|COPY " backup.sql
grep -E "CREATE TABLE|INSERT INTO|COPY " mario_backup.sql
grep -E "CREATE TABLE|INSERT INTO|COPY " second_backup.sql
psql --version
pg_isready
psql --username=freecodecamp --dbname=postgres
psql --username=freecodecamp --dbname=mario_database < mario_backup.sql
psql --username=freecodecamp --dbname=mario_database
ls --color=auto -la
ls --color=auto -la /workspace/project/.freeCodeCamp
ls --color=auto -la /workspace/project/.freeCodeCamp/test
cat /workspace/project/.freeCodeCamp/test/.next_command
camper: /project$ ls -la /workspace/project/.freeCodeCamp/test.sh
ls: cannot access '/workspace/project/.freeCodeCamp/test.sh': No such file or directory
camper: /project$ ls -la /workspace/project/.freeCodeCamp
total 32
drwxr-xr-x 4 camper camper 4096 Sep 24 00:14 .
drwxr-xr-x 1 camper camper 4096 Sep 24 00:03 ..
-rw-r--r-- 1 camper camper 10131 Sep 24 00:14 db.sql
-rw-r--r-- 1 camper camper 133 Sep 24 00:14 .mocharc.json
drwxr-xr-x 118 camper camper 4096 Sep 22 03:20 node_modules
drwxr-xr-x 2 camper camper 4096 Sep 23 23:47 test
camper: /project$ git status
On branch reset-orphan-branch
You are currently cherry-picking commit 972df1c.
(fix conflicts and run "git cherry-pick --continue")
(use "git cherry-pick --skip" to skip this patch)
(use "git cherry-pick --abort" to cancel the cherry-pick operation)
No commits yet
Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)
deleted by us: .freeCodeCamp/.mocharc.json
deleted by us: .freeCodeCamp/db.sql
Untracked files:
(use "git add <file>..." to include in what will be committed)
.freeCodeCamp/node_modules/
.freeCodeCamp/test/
backup.sql
mario_backup.sql
second_backup.sql
camper: /project$ git cherry-pick --abort
error: cannot abort from a branch yet to be born
fatal: cherry-pick failed
camper: /project$ git branch -a
remotes/coderoad/main
remotes/coderoad/v2.0.0
remotes/coderoad/v3.0.0
camper: /project$
```sql
### Your code so far
### Your browser information:
User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36</code>
### Challenge Information:
Build a Database of Video Game Characters - Build a Database of Video Game Characters
https://www.freecodecamp.org/learn/relational-databases-v9/workshop-database-of-video-game-characters/build-a-database-of-video-game-characters
GitHub Link: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/workshop-database-of-video-game-characters/5f2c289f164c29556da632fd.md