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:
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:
-
Check with a stored procedure that there are some bundled resources.
SELECT * FROM b2head.serviceconfig WHERE id3 = 'bundledresources';
-
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 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 is coming from a communication issue between the Counters and Routes services.
You’ll see an error message in the logs.
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)"
]
}
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 restart the b2box. 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
buthomepages
. - the permission
home=configure
becamehomepages=edit
.
- the permissions feature is no longer
-
Work items:
- to allow access to the work items, you need to have in addition of
workflow=read
the permissionworkflowsteps=read
.
- to allow access to the work items, you need to have in addition of
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:
-
Create a new temporary stored procedure named clean_zombies_stored_procedures.
-
Delete all the service stored procedures.
DELETE FROM b2head.serviceconfig WHERE id3 = 'storedprocedures';
-
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 intotransactions
. - You no longer need the
workflow=read
andworkflowsteps=read
permissions to display the Workflow Tasks UI. Only thetransactions=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 5.24.9
¶
Clean the database
Some items were created with an enabled attribute set to false
. The following sql query will update this value to the new default value true
UPDATE p6core.serviceconfig
SET content = content || '{"enabled": true}'
WHERE id3 != 'routes'
AND content @> '{"enabled": false}';
Version 5.24.16
¶
Docker Image Changes
For security reasons, b2box no longer runs as the root
user within docker.
A new user:p6user
and group:p6
must now be created.
addgroup -gid 10102 p6
adduser --system --gid 10102 --uid 10101 --no-create-home --disabled-login p6user
Warning
It is essential that the ownership of the filesystem used by b2box is configured to allow the new user p6user:p6
r/w access
When the new b2box container starts it will automatically attempt to set the permissions of path /opt/b2box5.data. So no manual updates should be required.
However, the permissions check may take some time to run on a file system containing large numbers of files/folders. Use docker logs b2box
to monitor progress.
Please ensure your filesystem does not accumulate large numbers of unnecessary files as this wastes disk space and will slow b2box start time
If b2box attempts to access files outside of the /opt/b2box5.data
folder it will fail. This is not recommended and b2box processing should be changed to be constrained within the b2box5.data
folder only.
Docker Image Location
The location of docker images has changed from repo.amalto.com
to docker.io
Docker images will now be managed via the official docker hub: https://hub.docker.com/
The change allows our images to be digitally signed and regularly scanned for security vulnerabilities.
Warning
A change is required to the docker-compose.yaml file to reference the new repository location
Edit the docker-compose.yaml and change:
image: repo.amalto.com/b2box:5.24.15
to
image: amalto/b2box:5.24.16
Note
Login to docker hub is required before restarting b2box
To gain access to the new b2box
repository on docker.io
you must first login.
This is only required once as credentials are persisted:
docker login -u amaltoinfra -p [password]
Version 5.24.17
¶
PDF Processing Changes¶
Two PDF processing libraries have been upgraded to:
- tabula 1.0.4
- https://github.com/tabulapdf/tabula-java
- pdfbox 2.0.23
- https://github.com/apache/pdfbox
In particular pdfbox 2.x is not interface compatible with the previous version and as such, some of the pdf DSL has been reworked in this release.
If you have scripts coded to use pdfbox or tabula directly, you will have to rework them to use these latest APIs