CUSTOM_REG_FORM_EXTRAINFO does not exits in cairn

I am trying to get the columns from the custom_reg_form_extrainfo (this table I have it in my database thanks to the plugin custom_reg_form_plugin==0.1.0) throw another plugin called cairn but every time I try I get this error.


I checked my database and it is there the table.

So I do not know why is telling me that it does not exist.

For more information my plugin is made like this:

Cairn is not connecting directly to the MySQL database of your Open edX instance. Instead, the data from MySQL is pulled into a Clickhouse database and the data visualisation tool (superset) is connected to that database.

To get access to the additional table you have two options:

  1. Creat a live view inside clickhouse (migration of data from MySQL to clickhouse), see “Adding data to your data lake”.
  2. Connect superset to your MySQL instance. :warning: This method is not recommended, as your instance grows this can cause performance issues if your Open edX services and cairn are competing for resources to use the same database.

Does this help?

2 Likes

Hi BbrSofiane,
We created a plugin with cookiecutter and then defined inside plugin.py :

config = {
      "defaults": {
          "CAIRN_MIGRATIONS_FOLDER": "ourpluginname/apps/migrations.d"
      }
}

We created the migrations inside the migrations.d folder indicated above.

We installed it with pip install -e ourpluginname and then enabled it with tutor plugins enabled ourpluginname. Finally, after performing tutor local quickstart the migrations did not run.

We have not tried the second option because we want the plugin running so in the future we can create new migrations easily.

Thank you very much in advance.

Hi Andres,
The custom Cairn migrations folder feature was introduced in Cairn v12.0.12. Which version are you running?

Hi Regis,
I am using Cairn v12.0.10. Can I updagrade Cairn with tutor license install tutor-cairn or is there another command?

Regards,
Andrei

You should run tutor license install 'tutor-cairn<13.0.0' to upgrade to the latest version supported by your tutor version.

1 Like

We updated Cairn to the 12.0.12 version, but upon activating our plugin and running a quickstart, we receive a message from the cairn-clickhouse that our migration cannot be copied to the cairn-clickhouse volume as it is read only.

This is the error: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/root/.local/share/tutor/env/plugins/our_plugin_name/apps/migrations.d/0001_custom_form_extra_info.sql" to rootfs at "/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql" caused: open /var/lib/docker/overlay2/a532c9a7ebf2ea64b1f65d60eee9e6cb86c24fba234b95db5cf1b4d31ddf3b9a/merged/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql: read-only file system: unknown

If we try to manually add the file to the clickhouse container, we receive the following error: Error response from daemon: mounted volume is marked read-only

Just to clarify, we have created the plugin as specified on the cairn documentation section “Adding data to your data lake”. After checking the docker-compose.yml file, we found out that the volume is in fact read only: ../plugins/cairn/apps/clickhouse/migrations.d/:/etc/clickhouse-server/migrations.d/:ro. In the docker-compose.jobs.yml we find this line: ../plugins/our_plugin_name/apps/migrations.d/0001_custom_form_extra_info.sql:/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql:ro.

Are we missing something?

Thank you very much once again.

Thanks for your feedback @Andress. This is probably a bug due to the way we bind-mount custom migrations inside the containers. Can you please manually modify the file in $(tutor config printroot)/env/local/docker-compose.jobs.yml such that the following line:

- ../plugins/cairn/apps/clickhouse/migrations.d:/etc/clickhouse-server/migrations.d:ro

becomes:

- ../plugins/cairn/apps/clickhouse/migrations.d:/etc/clickhouse-server/migrations.d

Then run: tutor local init --limit=cairn. (:warning: do not run tutor config save or your changes would be overwritten)

If this fix works for you then I’ll make the same change upstream and push a new release.

1 Like

I came across the same issue making the manual change you suggested fixes the problem for me.

It works! :smiley: Thank you so much Regis! :blush: I aprecciate a lot your help.

FYI I just released v13.0.5 which includes the fix.

2 Likes