Error on upgrade digitalocean App Platform deployment [Sep 28]

:raising_hand_man: charlietrigger asked

Hi <@544538394689011742> (or anybody :slightly_smiling_face: )did you manage to succesfully update you digitalocean app platform instance of nocodb whilst keeping your db and auth settings? I have tried to add the env var NC_DB in this format: mysql2:{{url}}:{{port}}?u={{user}}&p={{password}}&d={{database}}, but I get some error and an empty dashboard on build finnish. Using that same connection url in the 'reset’ui of nocodb does make a succesfull connection. Any help is greatly appreciated.

:raising_hand_man: charlietrigger replied

This is the error I am getting

:raising_hand_man: charlietrigger replied

To add to this: I have tried buildinga new app with a fresh database (a managed db mysql on digitalocean) and using the environment variable NC_DB set from the first deployment. This results in a similar migration failed error where if cannot create table ‘nc_projects’. Am I missing something here?

This is the most telling error I think:

2-09-21 12:45:36] sqlMessage: “Unable to create or change a table without a primary key, when the system variable ‘sql_require_primary_key’ is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.”,

[nocodb-nocodb] [2022-09-21 12:45

:raising_hand_man: charlietrigger replied

After reading up for a bit I found that on a digitalocean managed mysql database sql_require_primary_key is set to true on default. I requires api access to change this setting. They warn that setting this to false can lead to issues:

‘For clusters with more than one node, we strongly recommend keeping sql_require_primary_key as True. Setting it to False may severely impact replication and cause issues.’

Would it be possible to add a primary key to the nc_projects table?

:raising_hand_man: charlietrigger replied

I have found a fix as described here:

mysql - Unable to create or change a table without a primary key - Laravel DigitalOcean Managed Database - Stack Overflow

You can change your db setting to sql_require_primary_key to false. Do the update and if you want to you can set it back to true. This works like a charm and now the app platform deploy runs without issues and without resetting project.

Autogenerated from discord

Join NocoDB’s community