Skip to content

Migration Troubleshooting

This section regroups the problems you can encounter when you migrate a b2box to a different version.

Warning

This guide is not complete, so contact the R&D team if something goes wrong during the migration.

Version 5.14.0

Authentication settings

When the Authentication Tokens adapter was removed, the authentication settings to b2auth has changed.

You need now to associate the b2auth@amalto.com user to the instance and with the organisation’s root.

Otherwise, you’ll have the following error:

Authentication error

For more information, read the Authentication settings section.

Tables migration

During the migration, an error can happen when the Cross-ref adapter is converted into the Tables service. This error comes from a communication issue between the Tables and Data models services.

You’ll see an error message in the logs.

2018-04-06 09:52:26,699 ERROR [com.amalto.service.tables.TablesService] (Service Deploy Manager (platform6.tables)) com.amalto.b2box.core.api.B2boxException: Unexpected exception while sending a common message to platform6.datamodels!  (TablesService.scala:99)

You’ll find out once the b2box is running again, that there are no items in the Tables service. But keep calm, none of your cross-ref items has been lost!

A JIRA ticket was opened for the case. So until the problem is resolved, you’ll just need to restart the b2box after the migration and you’ll see all the tables in the data grid.

Version 5.16.0

Bundled resources migration

The properties of the bundled resource item have changed.

Therefore, before you migrate:

  1. Check with a stored procedure that there are some bundled resources.

    SELECT * FROM b2head.serviceconfig WHERE id3 = 'bundledresources';
    
  2. If the result is not empty, delete all the existing bundled resources.

    DELETE FROM b2head.serviceconfig WHERE id3 = 'bundledresources';
    

If you forget to delete them, you’ll have the following error message in the logs.

Note

This error is minor and will not affect the b2box’s operation.

2018-06-28 11:54:24,819 ERROR [com.amalto.b2box.core.impl.servicecomponent.configuration.ServiceConfigurationItem] (WrapperSimpleAppMain) Internal Error, failed de-serializing service item from JSON! (ServiceConfigurationItem.java:36)
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "content" (class com.amalto.service.applications.models.BundledResourcesItem), not marked as ignorable (15 known properties: "enabled", "attachmentSize", "deployed", "name", "lastModifiedDate", "attachmentName", "props", "targetRoot", "hasBytesAttachment", "lastModifiedBy", "description", "appKey", "revisionId", "contentMode", "targetPath"])
 at [Source: {"name": "MyTestResource", "props": {"prop1": "value1", "prop2": "value2"}, "appKey": "", "content": "VGhpcyBpcyBhIHRlc3QgZmlsZSByZXNvdXJjZSBjb250ZW50", "deployed": false, "revisionId": "9bc913d9e0ce0d2b94de9a487312f9ff", "targetPath": "/webapps", "targetRoot": "${B2BOX_DATA}", "contentMode": "READ", "description": {"EN": "A Test Resource"}, "lastModifiedBy": null, "lastModifiedDate": null}; line: 1, column: 103] (through reference chain: com.amalto.service.applications.models.BundledResourcesItem["content"])

2018-06-28 11:54:24,822 ERROR [com.amalto.b2box.core.impl.servicecomponent.AbstractServiceComponent] (WrapperSimpleAppMain) Failed initialising service component: #error# (AbstractServiceComponent.java:384)
com.amalto.b2box.core.api.B2boxException: Internal Error, failed de-serializing service item from JSON!

Version 5.18.0

Before the migration

Clean the database

It is possible before this release that your Platform 6 instance’s database is full of zombies service items.

To migrate successfully the counters and the frames, it is advised to clear the database table b2head.serviceconfig from any item which property id3 is equal to counters or frames.

You can use the stored procedures (on the old user interface) to execute the adequate SQL query:

DELETE FROM b2head.serviceconfig WHERE id3 = 'counters' OR id3 = 'frames';

Format the counters

Also, make sure that all your counters have a CRON expression defined. Otherwise, you’ll have the following error in the logs during migration.

Unexpected error migrating the old adapter counters! Unable to create the route deployment script for counters migration! Unexpected exception while sending a common message to platform6.routes! Service: platform6.routes Request Exception!
{
  "message" : "java.lang.NullPointerException",
  "stackTrace" : [
    "java.lang.NullPointerException",
    "    at com.amalto.service.routes.RoutesService.notifyRequestMessage(RoutesService.java:150)",
    "    at com.amalto.b2box.core.impl.servicecomponent.AbstractServiceComponent.onCommonMessage(AbstractServiceComponent.java:704)",
    "    at com.amalto.b2box.core.impl.platform.messagebus.BusQueueController$ServiceQueueRunner.run(BusQueueController.java:183)",
    "    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)",
    "    at java.util.concurrent.FutureTask.run(FutureTask.java:266)",
    "    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)",
    "    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)",
    "    at java.lang.Thread.run(Thread.java:745)"
  ]
}

If you forgot this step, downgrade to the 5.18.2 version, add a CRON expression to your counter and upgrade again the instance.

Format the frames

For each frame (in the Home menu entry), update the Id property such that it has the same value than the Name (you might need to check that your home configurations still display the frame).

Ensure also that all the frames names are unique.

Migration errors

During the migration, an error can happen when the Counters web app is converted into the Counters service. This error might come from a communication issue between the Counters and Routes services.

You’ll find out once the b2box is running again, that the route which schedules all the counters has not been created. Until the problem is resolved, you’ll just need after the migration to delete all the counters and to redeploy manually the b2webapp-service-counters war. Then you should see the new route, named CounterScheduling, in the Routes service UI.

After the migration

Update the permissions

The permissions have changed for:

  • Home Pages:

    • the permissions feature is no longer home but homepages.
    • the permission home=configure became homepages=edit.
  • Work items:

    • to allow access to the work items, you need to have in addition of workflow=read the permission workflowsteps=read.

Update the routes

Since the workflow feature’s name has changed into workflowsteps, you’ll need to update all the routes calling the Workflow Steps service.

Therefore, this route:

from('direct:p6router.WFTest').to('p6route://workflow')

becomes:

from('direct:p6router.WFTest').to('p6route://workflowsteps')

Version 5.19.0

Stored procedures migration

It is possible before this release that your Platform 6 instance’s database is full of zombies service stored procedures.

To migrate successfully the stored procedures, it is advised to clear the database table b2head.serviceconfig from any item which property id3 is equal to storedprocedures.

Then before the migration, you can use the stored procedures webapp (on the old user interface) to execute the adequate SQL query:

  1. Create a new temporary stored procedure named clean_zombies_stored_procedures.

  2. Delete all the service stored procedures.

    DELETE FROM b2head.serviceconfig WHERE id3 = 'storedprocedures';
    
  3. Upgrade the Platform 6 instance.

If you miss this steps, you won’t see the Stored Procedures menu entry on the Portal.

Version 5.20.0

Views migration

It’s advised to keep a backup of the XML configuration of Views file before the instance migration. In case of trouble, it will be possible to create manually the views from the original XML configuration.

Transactions & Workflow Tasks migration

The changes concern the permissions, they are:

  • The messages permission feature has been renamed into transactions.
  • You no longer need the workflow=read and workflowsteps=read permissions to display the Workflow Tasks UI. Only the transactions=allow('WORKFLOW_VIEW'(*)) permission is now required.

You also need to convert the View_ transformer into a script. The server will no longer look for a transformer to get the HTML content of a transaction.

Tip

If you are in a hurry, instead of converting the transformer into a script, create an intermediary script named View_[VIEW_NAME] which will call the transformer.

Know that the _DEFAULT_ variable was replaced by the xml variable. _DEFAULT_ is still available, but its content-type was changed into text/plain.

Example of the content of the intermediary script for the MessageInfo view:

// Force the content-type of the "_DEFAULT_" variable into "text/xml"
def messageInfo = pipeline.get '_DEFAULT_'
pipeline.put '_DEFAULT_', messageInfo, 'text/xml'

// Call the transformer "View_MessageInfo"
deprecated_control.call('View_MessageInfo')

If after the migration you don’t see the Transactions or Workflow Tasks menu entries, restart the Transactions service by:

  • Using Swagger to call the Stop a service and Start a service endpoints in the b2info API.
  • Upgrading to Platform 6 v5.20.1 and use the new DSL method:

    service.restartService("platform6.transactions")
    

Version 5.21.0

Email service initialisation

If you see the following error in the logs after the migration, upgrade the instance to 5.21.1.

2018-11-15 15:22:47,719 ERROR [com.amalto.b2box.adapter.logging.LoggingAdapter] (LoggingAdapterQueuePoller) Logging consumer thread error! (LoggingAdapter.java:391)
com.amalto.b2box.core.api.B2boxException: Unable to find the adapter 'smtp' in the Adapter Registry
    at com.amalto.b2box.core.impl.routing.ActiveRoutingOrderCtrlImpl.requestAdapterInvoke(ActiveRoutingOrderCtrlImpl.java:149)
    at com.amalto.b2box.core.impl.routing.ActiveRoutingOrderCtrlImpl.executeASynchronously(ActiveRoutingOrderCtrlImpl.java:69)
    at com.amalto.b2box.core.impl.routing.ActiveRoutingOrderCtrlImpl.executeASynchronously(ActiveRoutingOrderCtrlImpl.java:36)
    at com.amalto.b2box.core.impl.routing.RoutingEngineCtrlImpl.route(RoutingEngineCtrlImpl.java:233)
    at com.amalto.b2box.adapter.logging.LoggingAdapter$Consumer.run(LoggingAdapter.java:364)

Version 5.23.1

Application publisher profile format

The application profile‘s serialisation was reworked to prevent any issue in the future as/when we ever changed the profile format.

Warning

If you have any application profile installed on your instance, ask the R&D team before the migration to provide you with a new profile and a new permission files.

Version 6.0.0-alpha-2

Cluster Removed from DSL

In order to simplify the use of the transaction DSL, the notion of cluster was removed. The value of cluster parameters passed to lower level layers is now hardcoded to B2BOX. Please remove the first parameter when calling transaction.buildPK().

Version 6.0.0-alpha-3

One key pair per application publisher is needed to sign an application package, therefore the format of the application profile file (.app) has changed. Old ones can no longer be used, ask the R&D team to generate new ones for you. In the future, you will be able to create your .app files in the P6 Management Console.

Also, the format of the application package has changed and (it’s compressed). Therefore old applications can no longer be imported and need to be re-packaged.

Version 6.0.0-alpha-4

Old Database Tables Removed

In the database, the following tables were deleted:

  • universe
  • role
  • menu
  • routingrule
  • transformer

Please update your stored procedures accordingly.

Libraries Upgraded

This should not have an impact unless you rely on specific features in your scripts:

  • Apache POI for manipulating Microsoft Office documents was upgraded to version 4.0.1.
  • Apache Camel was upgraded to version 2.23.1.

App Profile File Simplified

Application profile files were simplified. You need to re-generate you .app files.

B2GUID Removed

If you use B2GUID in your scripts, please use java.util.UUID instead.

B2RequiredEndpointScope Removed

The B2RequiredEndpointScope annotation was removed, it’s been deprecated for a long time and you can safely delete it from your scripts.

message DSL Binding Removed

Please use transaction in your scripts instead.

_DEFAULT_ Variable Replaced

When working with smart documents, the _DEFAULT_ pipeline variable was renamed to text.

Version 6.0.0-alpha-5

Before the migration

1/ We integrate in this version some declarative table partitioning. That feature is only available in PostgreSQL 11.

The database version needs to be upgraded from 9.6.1 to 11.3. The upgrade procedure is explained here https://www.postgresql.org/docs/11/upgrading.html

If you use Platform 6 Install, follow these steps and the migration will be done for you:

  • Pull the latest version of the project in your instance folder.
  • While your instance is still running on the old database, run the script pgsql_export.sh. Your dumps are stored in a folder called database_dumps.
  • Stop your instance by running stop_platform6.sh and edit your .env file, set PGSQL_VERSION=11.3.
  • Import you data by running pgsql_import.sh, that’s it! Then you can delete the database dump files if you wish.

2/ The database schema was renamed from b2head to p6core. Renaming is handled dynamically by our migration scripts (including the migration of all stored procedures). But you still need to apply manually the following statements BEFORE starting the migration:

DROP TABLE b2head.flyway_schema_history;
ALTER SCHEMA b2head RENAME TO p6core;

3/ You need to ensure that the cluster column of the Item table only contains the following values:

  • .work
  • .crossreferencing
  • B2BOX

You can fetch these values by running the following query:

SELECT DISTINCT cluster FROM p6core.item;

Warning

All other values will be deleted from item table

If you still have entries with the value .configuration, you can safely delete them because configuration is managed in table serviceconfigin P6, by running this query:

DELETE FROM p6core.item WHERE cluster = '.configuration';

4/ The views configuration are stored in the serviceconfig table. The only allowed values for the <DataCluster> xml node are:

  • .work
  • B2BOX

To list all values, launch this query:

SELECT xpath('//DataCluster/text()', xmlparse(document (content ->> 'xmlView')))
FROM p6core.serviceconfig
WHERE id3 = 'views';

If you come across any other value, make sure to replace it with the value ‘.work’ as shown below:

Migration example:

UPDATE p6core.serviceconfig
SET content = replace(content::varchar, '<DataCluster>DummyValue</DataCluster>', '<DataCluster>.work</DataCluster>')::jsonb
WHERE id3='views';

To migrate from a DummyValue to the .work cluster.

5/ Indexes

Please take a look at the indexes defined on the item table and remove all the ones you think are no longer used. The automatic migration process will try to upgrade the remaining indexes. Deleting indexes frees disk space and most importantly speeds up migration and reduces chances of failure.

Migration duration: Configuration: 2 CPU / 6 GiB memory

300k entries on item table takes ~25min 850k entries on item table takes ~1h 15min 3,5M entries on item table takes ~3h

Durations may vary depending on the environment and the configuration.

6/ Configuration update

In the application configuration file application.conf, service.workflow.datamodel property has been renamed to service.workflowsteps.datamodel and the default value has changed from MessageInfo to TransactionInfo.

7/ Instance Base Context and Swagger(OpenApi)

The Instance record created via the OAuth Settings portal menu requires an update.

The Base context of a p6 instance is now: http//hostname:8080/p6 (not http://hostname:8080/b2box/rest/resource)

Swagger support has been upgraded to V3 which is now a standard know as OpenAPI. The V1 Swagger user interface is no longer embedded in the product. The latest Swagger user interface can be downloaded from https://swagger.io/tools/swagger-ui/

The Swagger UI should use the endpoint: http://hostname:8080/p6/openapi

Note

At this stage, you can finally start your instance in version 6.0.0-alpha-5. Change the version in the Docker Compose file and start your instance.

DSL

fileFromUri DSL Variable Removed

Please use fileFromUrl from the uri DSL

DSL access

To access to the DSL you need to prefix them by p6., for example:

log.debug p6.counter.list()

Transaction DSL

This version makes TransactionInfo the default model for transactions rather than MessageInfo. Also, in order to ease P6 learning curve, the term ‘project’ was replaced with ‘save’, therefore the following functions were renamed:

  • putMI -> putTI
  • projectMI -> saveTI which validates against a TransactionInfo and not a MessageInfo
  • project -> save
  • p6projectAndRouteMI -> saveAndRouteTI which validates against a TransactionInfo and not a MessageInfo
  • p6projectAndRoute -> saveAndRoute
  • p6route -> route which is not to be confused with the old function route which used routing rules!

In P6 version 6.0.0 all support for the old routing rules was removed, hence the following functions disappeared:

  • projectAndRouteMI
  • projectAndRoute
  • route

DataModel

The autoloaded data model WFWorkItem has been renamed to WorkflowTask. Make sure to update your stored procedures, XSLT resources, scripts…

Integrations

Each Platform 6 instance should now be defined and configured as an Integration using the new Administration panel.

See: Adding Your Instance ‘Integration’

Routes

Web3j

The component is no longer called P6Web3j, because we now rely on the standard Web3j Camel component. Therefore, all routes with endpoint URI p6web3j://... should be renamed to web3j://....

The producer query parameter transactionIndex was renamed to indexto comply with the official Web3j Camel component.

Observable operations were renamed to align with Web3j version 4.3:

  • ETH_LOG_OBSERVABLE -> ETH_LOG_FLOWABLE
  • ETH_JSON_LOG_OBSERVABLE -> ETH_JSON_LOG_FLOWABLE
  • ETH_BLOCK_HASH_OBSERVABLE -> ETH_BLOCK_HASH_FLOWABLE
  • ETH_PENDING_TRANSACTION_HASH_OBSERVABLE -> ETH_PENDING_TRANSACTION_HASH_FLOWABLE
  • TRANSACTION_OBSERVABLE -> TRANSACTION_FLOWABLE
  • PENDING_TRANSACTION_OBSERVABLE -> PENDING_TRANSACTION_FLOWABLE
  • BLOCK_OBSERVABLE -> BLOCK_FLOWABLE
  • REPLAY_BLOCKS_OBSERVABLE -> REPLAY_PAST_BLOCKS_FLOWABLE
  • REPLAY_TRANSACTIONS_OBSERVABLE -> REPLAY_PAST_TRANSACTIONS_FLOWABLE
  • CATCH_UP_TO_LATEST_BLOCK_OBSERVABLE -> REPLAY_ALL_PAST_BLOCKS_FLOWABLE
  • CATCH_UP_TO_LATEST_TRANSACTION_OBSERVABLE -> REPLAY_ALL_PAST_TRANSACTIONS_FLOWABLE
  • CATCH_UP_TO_LATEST_AND_SUBSCRIBE_TO_NEW_BLOCKS_OBSERVABLE -> REPLAY_PAST_AND_FUTURE_BLOCKS_FLOWABLE
  • CATCH_UP_TO_LATEST_AND_SUBSCRIBE_TO_NEW_TRANSACTIONS_OBSERVABLE -> REPLAY_PAST_AND_FUTURE_TRANSACTIONS_FLOWABLE

Pipeline Variables

The following automatically filled pipeline variables were renamed: - platform6.request.cluster -> platform6.request.dataPartition - platform6.request.concept -> platform6.request.dataType

Routing Order Attribute Changes

Routing orders were designed to store calls to adapters and their parameters. This was later extended to also include service calls via the svc:\\ service URL syntax.

Since adapters have been completely removed in Platform 6, the Routing Order attributes: Adapter and Adapter Parameters have been re-purposed to Service and Service Parameters

Warning

The svc:\\ URL syntax is no longer supported.

The Service attribute must now contain the name of the target service. For example platform6.scripts (or scripts for short)

The Service Parameters attribute now contains a comma separated list of URL encoded name/value pairs

The change to format and use of attributes means that any routing orders created prior to this release will not be able to be reprocessed ( Unless they are first heavily edited first using the Routing Orders UI.)

Dependency Upgrades

  • Bouncy Castle from 1.59 to 1.61
  • Flying Saucer PDF from 9.0.7 to 9.1.18
  • Groovy from 2.5.6 to 2.5.7
  • Web3j from 3.5.0 to 4.3.1