Skip to content

Commit

Permalink
Fix a bug: use the wrong password in helper
Browse files Browse the repository at this point in the history
In the helper script, we use the wrong password to login the server.
We used the password for the user in database rather in the OS, which
is wrong. We did not find this bug before because we use the same
password for both the user in database and the user in OS.
  • Loading branch information
Kaiser-Yang committed Aug 20, 2024
1 parent 6f4cf95 commit 59e4ec3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions config_debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"profiles": [
"dev"
],
"postgresUserPassword": "test",
"postgresqlUserName": "test",
"postgresqlUserPassword": "test"
"postgresqlUserName": "gcs_debug",
"postgresqlUserPassword": "gcs_debug",
"postgresqlDatabaseName": "gcs_debug"
}
12 changes: 6 additions & 6 deletions script/deploy_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to check the user in database: {err}")
Expand All @@ -230,7 +230,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to update the password in database: {err}")
Expand All @@ -245,7 +245,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to create the user in database: {err}")
Expand All @@ -258,7 +258,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to check the database: {err}")
Expand All @@ -272,7 +272,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to create the database: {err}")
Expand All @@ -286,7 +286,7 @@ def init_database(config):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, text=True, cwd='/tmp')
assert(process.stdin is not None)
process.stdin.write(f'{config.postgresqlUserPassword}')
process.stdin.write(f'{config.postgresUserPassword}')
process.stdin.flush()
out, err = process.communicate()
command_checker(process.returncode, f"Failed to grant the user in database: {err}")
Expand Down

0 comments on commit 59e4ec3

Please sign in to comment.