Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database connection error #2336

Open
5 tasks done
helendduncan opened this issue Dec 12, 2024 · 8 comments
Open
5 tasks done

Database connection error #2336

helendduncan opened this issue Dec 12, 2024 · 8 comments
Assignees
Labels
bug Problem when deploying a Data Safe Haven.

Comments

@helendduncan
Copy link

helendduncan commented Dec 12, 2024

✅ Checklist

  • I have searched open and closed issues for duplicates.
  • This is a problem observed when managing a Data Safe Haven.
  • I can reproduce this with the latest version.
  • I have read through the documentation.
  • This isn't an open-ended question (open a discussion if it is).

💻 System information

  • Operating System:
  • Data Safe Haven version: 5.2.0

📦 Packages

List of packages
Paste list of packages here

🚫 Describe the problem

Having built an SRE with MSSQL - it is not possible to connect via beekeeper studio and the smoke tests fail.

Screenshot 2024-12-12 at 10 35 03 Screenshot 2024-12-12 at 10 35 10

🚂 Workarounds or solutions

@helendduncan helendduncan added the bug Problem when deploying a Data Safe Haven. label Dec 12, 2024
@github-project-automation github-project-automation bot moved this to To Be Refined in Data Safe Haven Dec 12, 2024
@JimMadge JimMadge moved this from To Be Refined to Ready to Work in Data Safe Haven Dec 12, 2024
@JimMadge
Copy link
Member

From the messages and nslookup failing, my best guess is that the host of the database is not what we expect.

@JimMadge
Copy link
Member

Just noticed, the nslookup argument is incorrect mssql.dsgdsgscotrailjan25.turingsafehaven.ac.uk rather than mssql.dsgscotrailjan25.turingsafehaven.ac.uk

@helendduncan
Copy link
Author

Screenshot 2024-12-12 at 11 29 30 Still no joy :(

@JimMadge JimMadge moved this from Ready to Work to In progress in Data Safe Haven Dec 13, 2024
@helendduncan
Copy link
Author

First problem was due to absence of hyphens in username
Screenshot 2024-12-13 at 10 20 15

@helendduncan
Copy link
Author

helendduncan commented Dec 13, 2024

Found correct settings:
Originally hyphens in SRE name were omitted in the username.
If the SRE name has hyphens in it they should be included in the username.
Presumably smoke tests are failing as they are constructing username without hyphens

hostname = mssql.
user = databaseadmin@shm--sre-db-server-mssql
password = password-database-service-admin secret for the SRE rg (note there are two database passwords in the key vault)

  • Update system manager docs to reflect this

@JimMadge
Copy link
Member

On the domain name, this is constructed for the smoke tests here,

sre_fqdn="$(grep trusted /etc/pip.conf | cut -d "." -f 2-99)"
sre_prefix="$(hostname | cut -d "-" -f 1-4)"
if [ "$db_type" == "mssql" ]; then
db_name="master"
port="1433"
server_name="mssql.${sre_fqdn}"
hostname="${sre_prefix}-db-server-mssql"
elif [ "$db_type" == "postgresql" ]; then
db_name="postgres"
port="5432"
server_name="postgresql.${sre_fqdn}"
hostname="${sre_prefix}-db-server-postgresql"
else
echo "Did not recognise database type '$db_type'"
exit 1
fi

For MSSQL the hacky solution is to get the domain from the pip.conf file which is presumably wrong.
Not also a Postgres server was not deployed so it isn't clear whether that username is correct or not.

@jemrobinson
Copy link
Member

note there are two database passwords in the key vault

What are the two passwords for and can we disambiguate them?

@JimMadge
Copy link
Member

JimMadge commented Jan 7, 2025

The passwords that confused us are,

  • password_database_service_admin and,
  • password_user_database_admin

Presumably the user database is for Guacamole? I think it confused us because user_database sounds like it could be "database for the users".

We can improve the names but should also improve the docs which currently just say "your sysadmin knows the password".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem when deploying a Data Safe Haven.
Projects
Status: In progress
Development

No branches or pull requests

3 participants