Skip to content

Issue when trying to use external database #9

@fallais

Description

@fallais

Hello,

When setting mysql.enabled: false in order to use an external database (AWS RDS in that case), i face this issue :

Error: template: redcap/templates/configmaps/redcap/init-config-script.yaml:7:3: executing "redcap/templates/configmaps/redcap/init-config-script.yaml" at <tpl (.Files.Glob "configuration/redcap/init/redcap-config.sh").AsConfig .>: error calling tpl: error during tpl function execution for "redcap-config.sh: \"#!/bin/sh\\n\\n# Name: redcap_config\\n# Version: 1.0\\n# Author: APHP\\n#\n  Description : Updates common REDCap configuration during the installation process.\\n\\n\\n#####################\\n###\n  GLOBAL CONFIG ###\\n#####################\\nset -e\\n\\n\\n\\n####################################################################################\\n#\\n#\n  Update additional configuration settings including \\n# user file uploading settings\n  to Azure Blob Storage\\n#\\n####################################################################################\\n\\nmysql\n  \\\\\\n    --host={{ .Values.redcap.config.database.auth.hostname }} \\\\\\n    --port={{\n  default 3306 .Values.mysql.primary.service.ports.mysql }} \\\\\\n    --user={{ .Values.redcap.config.database.auth.username\n  }} \\\\\\n    --password=${DB_PASSWD} \\\\\\n    --database={{ .Values.redcap.config.database.auth.databaseName\n  }} <<EOF\\n        UPDATE redcap_config SET value = '{{ .Values.redcap.config.externalURL\n  }}' WHERE field_name = 'redcap_base_url';\\n        UPDATE redcap_config SET value\n  = '{{ .Values.redcap.config.mail.auth.from }}' WHERE field_name = 'from_email';\\n\n  \\       UPDATE redcap_config SET value = '{{ .Values.redcap.config.institutionName\n  }}' WHERE field_name = 'institution';\\n        UPDATE redcap_config SET value =\n  '{{ .Values.redcap.config.organizationName }}' WHERE field_name = 'site_org_type';\\n\n  \\       UPDATE redcap_config SET value = '{{ .Values.redcap.config.adminName }}'\n  WHERE field_name = 'homepage_contact';\\n        UPDATE redcap_config SET value =\n  '{{ .Values.redcap.config.adminMail }}' WHERE field_name = 'homepage_contact_email';\\n\n  \\       UPDATE redcap_config SET value = '{{ .Values.redcap.config.adminName }}'\n  WHERE field_name = 'project_contact_name';\\n        UPDATE redcap_config SET value\n  = '{{ .Values.redcap.config.adminMail }}' WHERE field_name = 'project_contact_email';\\n\n  \\       UPDATE redcap_config SET value = '/edocs' WHERE field_name = 'edoc_path';\\nEOF\"": template: gotpl:7:22: executing "gotpl" at <.Values.mysql.primary.service.ports.mysql>: nil pointer evaluating interface {}.mysql

It seems that .Values.mysql.primary.service.ports.mysql does not exist anymore when MySQL is disabled.

But if I enable it while trying to use my external database, of course the mysql pod is crashing :

NAME                                READY   STATUS             RESTARTS      AGE
pod/redcap-5574f88f7b-whtqv         1/1     Running            0             7m39s
pod/redcap-httpd-5cfd5d7f89-z97gm   1/1     Running            0             7m39s
pod/redcap-mysql-0                  0/1     CrashLoopBackOff   6 (87s ago)   7m39s

Any clue on this please ?

I do not see why there is this impact, I do not see anywhere in the code something that would make mysql disabled causing this issue of nil pointer exception..

--port={{ default 3306 .Values.mysql.primary.service.ports.mysql }} \

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions