microsoft / AL

Home of the Dynamics 365 Business Central AL Language extension for Visual Studio Code. Used to track issues regarding the latest version of the AL compiler and developer tools available in the Visual Studio Code Marketplace or as part of the AL Developer Preview builds for Dynamics 365 Business Central.
MIT License
748 stars 245 forks source link

The extension was unable to be deployed due to a dependency between extensions #2804

Closed Tonygithub17 closed 5 years ago

Tonygithub17 commented 6 years ago

I create the new extension to extension the Customer List page then publish it using VS Code. After that i go to Webclient designer mode to pull field in Customer List then save it as New extension name.

Then i go back my Extension that created early. Click Publish then i get the following error message. The request for path /nav/dev/apps?SchemaUpdateMode=synchronize failed with code 422. Reason: The extension was unable to be deployed due to a dependency between extensions.

dNsl9r commented 6 years ago

See #2779 and #1704

Tonygithub17 commented 6 years ago

Is it any better way to do it? Based on the solution given need download Extension then remove dependency only can publish. Feel a bit weird.

qutreson commented 6 years ago

For now, you need to remove the extensions depending on your extension before publishing it. We will use this issue to track future improvements on it.

salgiza commented 6 years ago

@qutreson , does this ticket also include installing extensions from VS Code?

I mean: in a customer we are considering creating a "base" extension, with some customizations to the base tables, and after that, create an extension for each big feature/customization that the customer requires, so that they can be developed/updated/uninstalled independently.

Problem: if at any point we need to make a change to this "base" extension, we need will need to manually uninstall every extension before we are able to update it. In a big project, were this can happen frequently, this can become huge annoyance.

We are not there yet, but we are already creating tests codeunits for some projects, and every time we discover a bug in the main extension, we have fix it in the main extension, uninstall the test extension, unpublish the test extension, publish the main extension, publish de test extension, and repeat.... :(

JavierFuentes commented 6 years ago

@qutreson ,

I work for a group of companies and we have the Solution Development Granule hired in our license so, together with my colleagues, we support all the customization needs that our business users have.

We are currently in a version 5 of Navision and we are beginning to see how to fit all our customizations under the new paradigm of programming in Business Central OnPremise, but we do not know how to segment in one or several Extensions all our customizations so that the modifications to fix any bug and especially to build new developments that change the business logic of several features at the same time does not become a hell of dependencies that causes errors when uploading to production ...

Is there an Official Good Practice Manual that allows us to know how to organize Workflows for a Development Team that supports a great group of Business Users and with a high degree of personalizations over the standard functionality?

We are clear that an Extension for each Open Issue is a crazy idea ...

JavierFuentes commented 5 years ago

Hi @qutreson, in our context of the need to make daily and frequent modifications in an OnPremise installation of BC, we believe that a good working model could be to separate the structure of the tables and the rest of the code in 2 different projects under the same workspace ( you can see #4363 and #4364 for more information) ...

Well, the problem is that when we publish changes to the DATA extension, we get this error:

The request for path /bcentral/dev/apps?SchemaUpdateMode=synchronize failed with code 422. Reason: The extension was unable to be deployed due to dependency between extensions.

Changing the SchemaUpdateMode = Recreate does not solve this problem.

The uninstallation and unpublishment of the UI extension that depends on DATA Extension didn't work, since the following error appears:

The request for path /bcentral/dev/apps?SchemaUpdateMode=recreate failed with code 422. Reason: This Extension can not be published as it has the same Publisher, Name, and Version as a previously published Extension.

In scenarios OnPremises (internal maintenance of the software), we can not consider increasing the version for every small adjustment that every team member could make and deploy in our Development server to be able to test it.

The uninstallation and unpublishing of the DATA Extension should be the solution, but surprisingly something does not work well and although it is no longer visible on the Extensions Page, the same error keeps appearing and we can not publish the changes ...

However, with the following command, we can see that the DATA extension remains included in the list of those published on the server:

Get-NAVAppInfo -ServerInstance bcentral

Finally we had to execute the following command on the server to get the total cleaning of the previous code:

Unpublish-NAVApp -ServerInstance bcentral -name BCentral_Data

Working like this is impossible even in development and testing environments ... much less in production... please improve soon.

mjmatthiesen commented 5 years ago

This is also an issue when you are writing tests. If you uncover errors in your product with tests, you cannot update the product until you unpublish your test app.

BartPermentier commented 5 years ago

I just encountered the same issue as @JavierFuentes. We also decided it best to split the solution into a Data Extension and the Business Logic one. Currently the Data Extension seems stuck after I tried to publish the BusinessLogic one for a 2nd time. I have tried the following in the DataApp:

1) Recreate in Launch.Json 2) Increasing the AppVersion 3) Uninstall-NAVApp 4) Unpublish-NAVApp 5)Sync-NAVApp 6)Sync-NAVApp -Mode Clean

It remains in Get-NavAppInfo and we can´t republish.

Luckily we are still in testing fase of the project but this makes me really nervous. What if this happens on Production? Considering leaving the data layer in good old CSide.

BC OnPrem CU2

BartPermentier commented 5 years ago

Ok for those of you that are completely stuck like I was; if you use SQL to go to the Nav App table you can delete your extension and republish without losing data.

JavierFuentes commented 5 years ago

Hi @BartPermentier, could you post here in which table(s) can we delete our extension using SQL?

Seems I can't execute the Unpublish-NAVApp PowerShell command remotely from my laptop to our Development Server because it doesn't have any -Server parameter...

I'm forced to run it by Terminal Server directly on the server but this is not agile for daily work.

JavierFuentes commented 5 years ago

Hi @BartPermentier, regarding the Workspace model with 2 Extensions separating the data structure from the business logic, I have to say that it seems that today it is not yet fully supported by MS... you can see #4450... I hope they fix this soon.

In #4363, I suggested the creation of new data types TableData and TableDataExt different from Table and TableExt so that in the TableData only the information of the fields and types that we want to add to a new table (or an standard one) without any kind of business logic was defined ...

They would work like the Interfaces in object-oriented programming languages and would allow the majority of the necessary daily modifications to be uploaded knowing that no structural changes are being made at the BD level.

Perhaps if this suggestion receives enough support, MS will consider it seriously.

BartPermentier commented 5 years ago

@JavierFuentes : the [Nav App] table in Sql.

DanielGoehler commented 5 years ago

I was to told to put my suggestion from #4584 to here:

Regarding this issue, I suggest that even if other extensions depend on an extension it, while publishing the Service Tier should check further if this chance breaks the dependent extensions.

What I experience (even with Build 14.0.27617 aka Partner Preview 04 of April Release) that if I rearrange page extensions fields on a page with the new Designer (which saves that changes as Designer Extension) and try to publish the base extension I get the error message:

The request for path /bc140/dev/apps?SchemaUpdateMode=synchronize failed with code 422. Reason: The extension was unable to be deployed due to a dependency between extensions.

Even though I didn't change anything in the extension. As long I don't remove that rearrange fields in the page extension publishing should be possible.

Update-Mark commented 5 years ago

This also happens with translations files. Found a spelling error in a client custom field and updated the translations xlf, and now I need to uninstall several extensions and republish. Terribly inconvenient.

LoanVision commented 5 years ago

Is there any update on this or it's something that will still require uninstalling related extensions?

atoader commented 5 years ago

Please try the latest developer preview https://freddysblog.com/2019/07/31/preview-of-dynamics-365-business-central-2019-release-wave-2/ The work done in this area https://docs.microsoft.com/en-us/dynamics365-release-plan/2019wave2/dynamics365-business-central/improved-app-dependency-handling-build-deploy should address this issue.