Description:
Hello OpenBalena Community,
We are currently seeking assistance with a migration issue that has arisen after updating.
OpenBalena to a new tag (v0.209.2 → v14.3.6) . Blame me, it was my fault, during investigating what is wrong with balena after updating to new CLI version . Unfortunately there was a major changes that block updates and device provisioning for new balena devices
The migration process (migration 082) consistently fails during the update, causing subsequent problems, such as difficulties with using the latest OpenBalena API tag and login issues with balenaCLI SDK.
Issue Summary:
After updating to a new tag, the migration process with migration number 082 fails repeatedly.
With log below:
Loading application config
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00076"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00077"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00078"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00079"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00080"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00081"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Running migration "00082"
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Error while executing migrations, rolled back
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Failed to executed synchronous migrations from api root model MigrationError: operator does not exist: boolean <> integer
Aug 28 17:45:49 f1f9f65d0501 api[1598]: Error loading application config MigrationError: Failed to execute 'balena' model from 'undefined' due to: operator does not exist: boolean <> integer
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at /usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:97:10
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async lockMigrations (/usr/src/app/node_modules/@balena/pinejs/src/migrator/utils.ts:261:11)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async $run (/usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:74:2)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async /usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:586:5
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Promise.all (index 0)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async executeModels (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:582:26)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async /usr/src/app/node_modules/@balena/pinejs/src/config-loader/config-loader.ts:199:7
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Promise.all (index 0)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async /usr/src/app/node_modules/@balena/pinejs/src/config-loader/config-loader.ts:248:4
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Object.transaction (/usr/src/app/node_modules/@balena/pinejs/src/database-layer/db.ts:446:20)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async loadConfig (/usr/src/app/node_modules/@balena/pinejs/src/config-loader/config-loader.ts:115:3)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Object.loadApplicationConfig (/usr/src/app/node_modules/@balena/pinejs/src/config-loader/config-loader.ts:425:4)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Promise.all (index 0)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async Object.init (/usr/src/app/node_modules/@balena/pinejs/src/server-glue/module.ts:80:3)
Aug 28 17:45:49 f1f9f65d0501 api[1598]: at async setup (/usr/src/app/src/index.ts:372:2)
Aug 28 17:45:49 f1f9f65d0501 api[1589]: Program node index.js exited with code 1
If i try to downgrade open-balena-api version to something like v11.x.x it doesn’t help either.
Log after downgrading below:
Aug 29 08:13:01 c42f70312b7e api[1492]: Failed to execute standard models. MigrationError: Unexpected token . in JSON at position 4
Aug 29 08:13:01 c42f70312b7e api[1492]: at /usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:95:10
Aug 29 08:13:01 c42f70312b7e api[1492]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async lockMigrations (/usr/src/app/node_modules/@balena/pinejs/src/migrator/utils.ts:263:11)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async $run (/usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:72:2)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async /usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:587:5
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Promise.all (index 0)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async executeModels (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:583:26)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async executeStandardModels (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1862:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async /usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1890:4
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.transaction (/usr/src/app/node_modules/@balena/pinejs/src/database-layer/db.ts:446:20)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.setup (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1889:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.init (/usr/src/app/node_modules/@balena/pinejs/src/server-glue/module.ts:61:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async setup (/usr/src/app/src/index.ts:372:2)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async init (/usr/src/app/init.ts:240:27)
Aug 29 08:13:01 c42f70312b7e api[1492]: Could not execute standard models MigrationError: Unexpected token . in JSON at position 4
Aug 29 08:13:01 c42f70312b7e api[1492]: at /usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:95:10
Aug 29 08:13:01 c42f70312b7e api[1492]: at processTicksAndRejections (node:internal/process/task_queues:95:5)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async lockMigrations (/usr/src/app/node_modules/@balena/pinejs/src/migrator/utils.ts:263:11)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async $run (/usr/src/app/node_modules/@balena/pinejs/src/migrator/sync.ts:72:2)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async /usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:587:5
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Promise.all (index 0)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async executeModels (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:583:26)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async executeStandardModels (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1862:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async /usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1890:4
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.transaction (/usr/src/app/node_modules/@balena/pinejs/src/database-layer/db.ts:446:20)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.setup (/usr/src/app/node_modules/@balena/pinejs/src/sbvr-api/sbvr-utils.ts:1889:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async Object.init (/usr/src/app/node_modules/@balena/pinejs/src/server-glue/module.ts:61:3)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async setup (/usr/src/app/src/index.ts:372:2)
Aug 29 08:13:01 c42f70312b7e api[1492]: at async init (/usr/src/app/init.ts:240:27)
Aug 29 08:13:01 c42f70312b7e api[1483]: Program node index.js exited with code 1
Does anybody faced with this issue before?