martialblog/docker-limesurvey

Exception thrown when adding a question to a new survey.

Jacq opened this issue · 4 comments

Jacq commented

Hi,

The summary is that using the latest tag when adding an additional question to an new survey, the save button causes an exception thrown.

More details here including logs and gif: https://bugs.limesurvey.org/view.php?id=17865.
Thanks

Hey, can you provide some details on how you start the app? Maybe enable the debug log to see more details.

Jacq commented

Hi, I have located the issue that is due to a read-after-write limitation in mariadb galera nodes.
A workaround for this issue is to set a new connection attribute enabling wsrep_sync_wait:

$pdo = new PDO(
    'mysql:host=localhost',
    "username",
    "password",
    array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET SESSION wsrep_sync_wait = 1")
);

Can you add to the DB options an additional attributes parameter in the entrypoint.sh, such as:


DB_ATTRIBUTES=${DB_ATTRIBUTES:-[]}
...

...
return array(
  'components' => array(
    'db' => array(
      'connectionString' => '$DB_TYPE:$DB_CONNECT=$DB_HOST;port=$DB_PORT;dbname=$DB_NAME;',
      'emulatePrepare' => true,
      'username' => '$DB_USERNAME',
      'password' => '$DB_PASSWORD',
      'charset' => '$DB_CHARSET',
      'tablePrefix' => '${DB_TABLE_PREFIX//[[:space:]]/}',
     'attributes' => '$DB_ATTRIBUTES',**

Can you add also this new parameter to the helm chart?

Thanks!

I see, Galera is tricky... you should also have look at the table storage engines and make sure which one LimeSurvey uses. https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/

The config is very specific, if you are using Helm/K8S I think it makes more sense if you override the config file with a ConfigMap

We can add a hint about it in the Helm Repo

Jacq commented

I see, Galera is tricky... you should also have look at the table storage engines and make sure which one LimeSurvey uses. https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/

The config is very specific, if you are using Helm/K8S I think it makes more sense if you override the config file with a ConfigMap

We can add a hint about it in the Helm Repo

Yes, regarding storage engines Innodb is the way with galera (MyISAM was not replicated, now is experimental).
Overriding the configmap sounds nice to me, I will add the environment variable to the entrypoint.sh to inject it into de config.
Thanks!