The recommended way for mysql to store and provide authentication credentials during connection is to create a configuration file that contains the information in an obfuscated way. This information is then stored in a file named ~/.mylogin.cnf, which gets automatically picked up when running an SQL query.
Currently, when such a file is present, sidora.core::get_pandora_connection creates a segmentation error:
> sidora.core::get_pandora_connection("/home/thiseas_christos_lamnidis/Software/github/Schiffels-Popgen/MICROSCOPE-processing-pipeline/.credentials")
*** caught segfault ***
address 0x10, cause 'memory not mapped'
Traceback:
1: connection_create(host, username, password, dbname, as.integer(port), unix.socket, as.integer(client.flag), group, default.file, ssl.key, ssl.cert, ssl.ca, ssl.capath, ssl.cipher, timeout, reconnect)
2: .local(drv, ...)
3: DBI::dbConnect(RMariaDB::MariaDB(), host = creds[1], port = creds[2], user = creds[3], password = creds[4], db = "pandora")
4: DBI::dbConnect(RMariaDB::MariaDB(), host = creds[1], port = creds[2], user = creds[3], password = creds[4], db = "pandora")
5: sidora.core::get_pandora_connection("/home/thiseas_christos_lamnidis/Software/github/Schiffels-Popgen/MICROSCOPE-processing-pipeline/.credentials")
Renaming the ~/mylogin.cnf file to something else fixed the issue.
This suggests that DBI::dbConnect implicitly calls mysql, which loads the configuration file, causing the segfault.
Maybe we should allow users to specify a login-path in get_pandora_connection, instead of a credential file, to allow usage with such a .cnf file.
The recommended way for
mysqlto store and provide authentication credentials during connection is to create a configuration file that contains the information in an obfuscated way. This information is then stored in a file named~/.mylogin.cnf, which gets automatically picked up when running an SQL query.Currently, when such a file is present,
sidora.core::get_pandora_connectioncreates a segmentation error:Renaming the
~/mylogin.cnffile to something else fixed the issue.This suggests that
DBI::dbConnectimplicitly callsmysql, which loads the configuration file, causing the segfault.Maybe we should allow users to specify a
login-pathinget_pandora_connection, instead of a credential file, to allow usage with such a.cnffile.