Recovery from publishing failures

Completed

If publishing an extension from within Visual Studio Code fails, the publishing process tries to restore any previously installed extensions that were uninstalled and unpublished as part of the failed publishing. If a full restore fails, the developer is informed about which extensions could be restored and which ones failed, providing the developer with a better overview.

When deploying an extension from Visual Studio Code, which is part of a graph of installed extensions on the target environment, first-level dependent extensions are uninstalled and unpublished to be recompiled once the extension has been deployed. However, if the deployment from Visual Studio Code fails (for example, due to a compilation issue on the server), the server is left with an incomplete graph of installed extensions. This results in unnecessary manual work to redeploy the previously installed extensions in the correct order.

Visual Studio Code will try to restore the previous extension state, removing the need for manual work in most cases.

When you perform a publish from Visual Studio Code, there's a possibility that the server fails to compile the extension that you've published. This can happen because of issues in the AL code itself (for example, breaking changes in the new code, which are incompatible with the extensions on the server), or because of transient server-side issues. In these cases, there's an attempt to restore the original state of extensions before the publishing happened.

However, there are some cases in which recovery can fail. These are:

  • Upgrade scenarios. For example, when publishing a version 2.0 of an app over version 1.0.

  • Extension changes that cause tables or table extensions to be moved between apps.

  • Bugs in the install/uninstall codeunits of any affected extensions.

In the case where recovery can't be performed, the server provides a list of apps that couldn't be recovered to assist with manual recovery.

Refer to the Publish and install an extension unit later in this module for more information about publishing extensions.