Questions about 0.6.0-beta4

Hi,

I migrate from 0.5.0 to 0.6.0-beta4.
I had some issues with it.

Could you help me to understand this problem?

the DB migration failed because the new migration script is not fully compatible with the existing db
content of the migration table in 050 gitpod DB:

MySQL [gitpod]> select* from migrations;
±--------------±---------------------------------------------+
| timestamp | name |
±--------------±---------------------------------------------+
| 1538732744133 | InitialSetup1538732744133 |
| 1538732744233 | RepoWhitelist1538732744233 |
| 1538733040809 | NewPrimaryKeys011538733040809 |
| 1540660412217 | Snapshots1540660412217 |
| 1540660412218 | LastUpdatedTime1540660412218 |
| 1542962318429 | PrivilegedUser1542962318429 |
| 1544172743616 | EMailFilter1544172743616 |
| 1544182743616 | PrebuildWorkspaces1544182743616 |
| 1544546800783 | AppInstallation1544546800783 |
| 1547464846945 | AuthProviderId1547464846945 |
| 1549454864162 | WorkspaceInstanceErrorText1549454864162 |
| 1551259814258 | PrebuiltWorkspaceUpdatable1551259814258 |
| 1551358284441 | DeleteIdentity1551358284441 |
| 1551440761120 | WorkspaceContextURLText1551440761120 |
| 1551696694610 | Tokens1551696694610 |
| 1551696694620 | CheckIdToContextUrl1551696694620 |
| 1551786663923 | PaymentFields1551786663923 |
| 1551786663924 | SubscriptionDeletedCancellation1551786663924 |
| 1551786663925 | TeamSubscriptions1551786663925 |
| 1551786663926 | SubscriptionFirstMonth1551786663926 |
| 1552309803138 | UserDeletable1552309803138 |
| 1552309803139 | DeleteUserStorageResource1552309803139 |
| 1552309803140 | DeleteTokens1552309803140 |
| 1552486988553 | PendingGithubEvent1552486988553 |
| 1553867404607 | DeletableWorkspace1553867404607 |
| 1554124213564 | WorkspaceUserDeleted1554124213564 |
| 1554243711505 | EduEmailDomain1554243711505 |
| 1554360209831 | UserReleasePeriodKnob1554360209831 |
| 1554360209832 | UpdateRepoWhitelist1554360209832 |
| 1554360209840 | UserEnvVar1554360209840 |
| 1557220371715 | UserFeatures1557220371715 |
| 1557470736590 | WorkspaceInstanceStatus1557470736590 |
| 1560514494124 | ReadonlyIdentity1560514494124 |
| 1562923996699 | UserRoles1562923996699 |
| 1563453262156 | TheiaPlugin1563453262156 |
| 1564670940987 | LastUpdatedTime1564670940987 |
| 1567086067416 | DropWorkspaceInstanceEvent1567086067416 |
| 1567151546402 | Diff1567151546402 |
| 1567155446482 | OptimizeFindWsiWsInPeriod1567155446482 |
| 1567155575945 | IndexesForDBSync1567155575945 |
| 1567780649565 | WorkspaceProbeUser1567780649565 |
| 1568028018949 | HeadlessToWorkspaceType1568028018949 |
| 1568099934144 | WSIDeleted1568099934144 |
| 1573234126259 | InstancePhaseAddPersisted1573234126259 |
| 1573483250702 | WsiPhasePersisted1573483250702 |
| 1573569452577 | BaseImageResolved1573569452577 |
| 1574322034040 | TokenSyntheticId1574322034040 |
| 1575358765224 | UserStorageResourceContent1575358765224 |
| 1575358765225 | WorkspaceSoftDeletion1575358765225 |
| 1575358765226 | WorkspacePinned1575358765226 |
| 1575642829995 | TokenEntryExpiryDate1575642829995 |
| 1576241423348 | GeneratedLicense1576241423348 |
| 1580205051239 | IdentityIndex1580205051239 |
| 1580986547911 | WorkspaceDeletion1580986547911 |
| 1582282317123 | UniqueIdForWorkspaceProbeUser1582282317123 |
| 1582634168297 | AdditionalSubscriptionData1582634168297 |
| 1582893059867 | AdditionalUserData1582893059867 |
| 1582893059868 | EMail1582893059868 |
| 1583334443398 | SAD_LastModified1583334443398 |
| 1583749304351 | PaymentSource1583749304351 |
| 1584023697326 | SimplifyEmail1584023697326 |
| 1584023697330 | EMailNotificationData1584023697330 |
| 1584545544609 | InstanceConfig1584545544609 |
| 1584545544610 | UserCreationDateIndex1584545544610 |
| 1586706586944 | PrebuildDependency1586706586944 |
| 1587133424627 | ApiToken1587133424627 |
| 1587573060390 | MissingWsIndex1587573060390 |
| 1587713935399 | IndexesWsgc21587713935399 |
| 1588855711948 | IndAuthId1588855711948 |
| 1589300342000 | PluginHash1589300342000 |
| 1591691566514 | OneTimeSecret1591691566514 |
| 1592203031937 | TokenEntry_Refreshable1592203031937 |
| 1593167873419 | LicenseDB1593167873419 |
| 1593180029504 | AuthProviderEntry1593180029504 |
±--------------±---------------------------------------------+
74 rows in set (0.00 sec)

the same from 060-beta4:

MySQL [gitpod]> select * from migrations;
±--------------±-------------------------------+
| timestamp | name |
±--------------±-------------------------------+
| 1592203031938 | Baseline1592203031938 |
| 1593167873419 | LicenseDB1593167873419 |
| 1593180029504 | AuthProviderEntry1593180029504 |
| 1600693766152 | ExpandScopes1600693766152 |
| 1606163573103 | TermsAcceptance1606163573103 |
| 1607429613319 | Foo1607429613319 |
±--------------±-------------------------------+
6 rows in set (0.00 sec)

My workaround: i created “terms” tabble by hand.
it is ok for now.
Is there a plan to fix it in realised 060?
or Do I need to start with a clean db?

This is running in aws eks, with aurora.

Thanks.strong text

The DB migration should actually work. The migration steps that you see in your first SQL result are mostly combined to Baseline1592203031938. Baseline1592203031938, LicenseDB1593167873419, and AuthProviderEntry1593180029504 should be ignored due to the timestamp at the end of the names are not newer than AuthProviderEntry1593180029504 (already perfomed) and the migrations step ExpandScopes1600693766152 and later should be executed by the DB migration.

Could you provide the log of the DB migration pod?

arn run v1.22.4
$ node ./lib/wait-for-db.js
Using DB: < DB_URL >:3306/gitpod
DB is available
Done in 0.19s.
yarn run v1.22.4
$ typeorm -f lib/typeorm/ormconfig migrations:run
Loading TypeORM entities and migrations from /app/node_modules/@gitpod/gitpod-db/lib/typeorm
Using DB: < DB_URL >:3306/gitpod
Error during migration run:
Error: New migration found: Baseline1592203031938, however this migration’s timestamp is not valid. Migration’s timestamp should not be older then migrations already executed in the database.
at /app/node_modules/typeorm/migration/MigrationExecutor.js:91:39
at Array.filter ()
at MigrationExecutor. (/app/node_modules/typeorm/migration/MigrationExecutor.js:84:59)
at step (/app/node_modules/typeorm/migration/MigrationExecutor.js:32:23)
at Object.next (/app/node_modules/typeorm/migration/MigrationExecutor.js:13:53)
at fulfilled (/app/node_modules/typeorm/migration/MigrationExecutor.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

(from different installation the original one is already removed, but message is the same)