Projects tigase _server server-core Issues #1213
Upgrade from 8.1.0-b10857 to 8.1.1-b10861 fails (#1213)
wojciech.kapcia@tigase.net opened 4 years ago

Ref: https://github.com/tigase/tigase-server/issues/56

During the upgrade we set the version of the last applied schema file. If the file that matches current version is missing then it won't be possible to start the server. I'd say this is a general issue with our upgrade mechanism and we should review it. Quick fix will be to add missing schema file to distribution build, long term we would probably want to set the schema version to the component version if all files were loaded.


https://docs.tigase.net/tigase-server/master-snapshot/Administration_Guide/html/#SchemaMaintenance

wojciech.kapcia@tigase.net commented 4 years ago

For version 8.1.1 I only updated release page with relevant information (creating empty files before running upgrade-schema) and made relevant changes in the tigase-muc/tigase-server-distribution stable branches.

install-schema sets the version correctly:

[2020-09-24 17:32:37:367] [CONFIG  ] [    http-server-pool-4 ] DBSchemaLoader.loadSchema()      : SchemaInfo:: id: muc, repositories: 2; version: 3.1.1-b643/96806982
[2020-09-24 17:32:37:386] [CONFIG  ] [    http-server-pool-4 ] DBSchemaLoader.loadSchemaFromSQLFiles(): Loading schema muc, version: 3.1.1-b643/96806982 from files, current: 0.0.0
[2020-09-24 17:32:37:391] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.loadSchemaFromSQLFiles(): Schema files to load: {3.0.0=mysql-muc-3.0.0.sql, 3.1.0=mysql-muc-3.1.0.sql}
[2020-09-24 17:32:37:392] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.loadSchemaFile()  : Loading schema from file(s): mysql-muc-3.0.0.sql, URI: jdbc:mysql://localhost/tigasedb_811_install?user=tigasedb_811_install&password=tigasedb_811_install&useSSL=false&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true
[2020-09-24 17:32:37:613] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.lambda$loadSchemaFile$21():  completed OK
[2020-09-24 17:32:37:613] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.loadSchemaFile()  : Loading schema from file(s): mysql-muc-3.1.0.sql, URI: jdbc:mysql://localhost/tigasedb_811_install?user=tigasedb_811_install&password=tigasedb_811_install&useSSL=false&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true
[2020-09-24 17:32:37:751] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.lambda$loadSchemaFile$21():  completed OK
[2020-09-24 17:32:37:752] [INFO    ] [    http-server-pool-4 ] DBSchemaLoader.setComponentVersion(): Setting version of the component: muc to: 3.1.1-b643 for connection: jdbc:mysql://localhost/tigasedb_811_install?user=tigasedb_811_install&password=tigasedb_811_install&useSSL=false&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true

AFAIR we decided to set the version of the last correctly processed file to make it possible to "restart" the process. We have to consider the case when list of schema files doesn't reach component version and in that case set it to component version during upgrade.

wojciech.kapcia@tigase.net commented 4 years ago

After analysing the documentation (to refresh of the concepts and the discussion we had) I opted for "fail fast" - if the file for the required version is missing form the list of the available fails then the installation/upgrade for that particular component will fail.

I also configured TC to run simple install-schema verification during creation of distribution packages to catch it early (and it helped catch issue with missing *-muc-3.2.0 schema).

Andrzej Wójcik (Tigase) commented 4 years ago

There is now an issue with missing schema files for AuditLog and due to that TTS-NG fails for MySQL on TC. And after this change we are forced to add SQL files even for the smallest bugfix release (I'm not sure that was an expected behaviour).

    =============================================================================
      Schema upgrade finished
  
    Data source: default with uri jdbc:mysql://172.17.0.3/tigasetest?user=tigase&password=3ymCRLOyBuhCPDsP&useSSL=false&useUnicode=true&characterEncoding=UTF-8
      Checking connection to database  ok
      Checking if database exists  ok
      Loading Common Schema Files  ok
      Loading schema: Tigase Message Archiving Component, version: 3.0.0-SNAPSHOT-b295/7f224aa8 (database version: none)  ok
      Loading schema: Tigase Workgroup Queues Component, version: 1.1.0-b65/b35fc915 (database version: none)  ok
      Loading schema: Tigase XMPP Server (Core), version: 8.2.0-SNAPSHOT-b5728/5506888d (database version: none)  ok
      Loading schema: Tigase AuditLog Component, version: 2.1.1-b38/17e9943e (database version: none)  error
        Message: Schema file for required version: 2.1.1 is missing in the list of available schema files: [2.0.0]
      Loading schema: Tigase MUC Component, version: 3.2.0-SNAPSHOT-b647/31023e7a (database version: none)  ok
      Loading schema: Tigase HTTP API - File Upload, version: 2.2.0-SNAPSHOT-b349/20d99798 (database version: none)  ok
      Loading schema: Tigase PubSub Component, version: 5.0.0-SNAPSHOT-b771/2285d955 (database version: none)  ok
      Adding XMPP admin accounts  warning
        Message: Error: No admin users entered
      Post installation action  ok
    =============================================================================

NOTE: AuditLog 2.1.1 was already released and is part of Tigase XMPP Server 8.1.1 if I'm correct.

wojciech.kapcia@tigase.net commented 4 years ago

Thank you for bringing this to my attention. Yes, the schema files for those particular versions were missing. I added those and it started working ok:

[2020-09-28 18:18:19:891] [INFO    ] [                  main ] DBSchemaLoader.lambda$postInstallation$13(): Finalizing...
[2020-09-28 18:18:19:892] [FINER   ] [                  main ] DBSchemaLoader.loadSQLQueries()  : Loading queries, resource: database/mysql-installer-post.sql
[2020-09-28 18:18:19:894] [INFO    ] [                  main ] DBSchemaLoader.lambda$postInstallation$13():  completed OK
sept. 28, 2020 6:18:19 P. M. tigase.db.util.SchemaManager loadSchemas
INFORMACIÓN: schema loading finished!




  =============================================================================
  	Schema upgrade finished

  Data source: default with uri jdbc:mysql://localhost/tigasetest?user=tigasetest&password=3ymCRLOyBuhCPDsP&useSSL=false&useUnicode=true&characterEncoding=UTF-8
  	Checking connection to database	ok
  	Checking if database exists	ok
  	Loading Common Schema Files	ok
  	Loading schema: Tigase Message Archiving Component, version: 3.0.0-SNAPSHOT-b295/7f224aa8 (database version: none)	ok
  	Loading schema: Tigase Workgroup Queues Component, version: 1.1.0-b65/b35fc915 (database version: none)	ok
  	Loading schema: Tigase XMPP Server (Core), version: 8.2.0-SNAPSHOT-b5729/923907c4 (database version: none)	ok
  	Loading schema: Tigase AuditLog Component, version: 2.1.2-SNAPSHOT-b40/c12f6aab (database version: none)	ok
  	Loading schema: Tigase MUC Component, version: 3.2.0-SNAPSHOT-b647/31023e7a (database version: none)	ok
  	Loading schema: Tigase HTTP API - File Upload, version: 2.2.0-SNAPSHOT-b349/20d99798 (database version: none)	ok
  	Loading schema: Tigase PubSub Component, version: 5.0.0-SNAPSHOT-b771/2285d955 (database version: none)	ok
  	Adding XMPP admin accounts	warning
  		Message: Error: No admin users entered
  	Post installation action	ok
  =============================================================================

(running locally, for some reason TC on AWS is pulling previous nightly build even though the link points to the new one, hopefully tomorrow it will straighten it out).

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0, tigase-server-8.1.1
Spent time
7h 45m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1213
Please wait...
Page is in error, reload to recover