[on-hold] Install_app script not creating Doctypes in Database

Hello everyone,

I created a pipeline to deploy my ERPNext setup into a K8S cluster. I also have a custom app.

Every time that I commit on the custom app repository, the build chain is recreating the Nginx & the Python docker (the same docker) using the the install_app.sh.

If I add a new method to an api.py file, the new method is there after rollout. That’s awesome. But none of the Doctypes that I added in the custom app are present in the database.

As I am not managing the cluster, I don’t really have the power of running commands on the running ERPNext Docker.

Is there a way I can force the Doctype update when starting the Docker?

Does anyone has an idea ?

Thanks.

Benoit

write jobs resource yaml that gets created during pipeline. it’ll run the migrate command to update schemas

or execute following command during pipeline

helm upgrade ... --set migrateJob.enable=true

Check values.yaml

1 Like

Thanks for your quick answer.

I will check with the people in charge of the Cluster if they can do that (and if they use helm)…

From the app point of view, is there anything that has to be done on top of having the Doctype files at the correct folder?

Thanks

no. nothing more required in app.

you need the schema migration to run to make the latest changes from app in site database. not part of app code. It’s part of upgrade process.

Ok.

We could add the migrate job, and see it running. It worked for ERPNext and two other apps, but didn’t execute anything for my app.

Any idea where I could look at ?

your app must be installed on site that is migrated

and

app must have doctypes that get migrated. if there are no doctypes, then it’ll not show the progress bar, it’ll just show the app name.

The app should be installed :

  createSite:
    enabled: true
    siteName: "erpnext.mydomain"
    dbRootUser: root
    adminPassword: ****
    installApps: "erpnext,erpnextswiss,my-app"

We didn’t even see the app name.

Maybe something when wrong at the creation. Is there a way to ensure the app is installed from the Desk ?

EDIT : I can see my app in the ‘Module Def’ page

I put this discussion on hold, it looks like the jobs is using an old version of my docker, so it might be possible that the job doesn’t now about the Doctype and therefore, does not do any migration.

I’ll come back when I know more.

If you wish to pull latest image and tag is not “latest” then set the imagePullPolicy to Always.

override it in values.yaml.

more: https://kubernetes.io/docs/concepts/containers/images/#imagepullpolicy-defaulting

It was an issue in our pipeline. Now the app appears, and then we get some migration errors about truncated data. But that, is something out of this thread.

Thanks for the support. Will mark your first answer as solution.

Cheers.