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
732 stars 243 forks source link

SchemaUpdateMode=recreate&DependencyPublishingOption=default failed with code 422. Reason: Could not install the extension [..] on tenant default due to the following error: Error code: 85132273 #5505

Closed HennieBink closed 4 years ago

HennieBink commented 4 years ago

Can't publish app after changing the key of a table.

Message: SchemaUpdateMode=recreate&DependencyPublishingOption=default failed with code 422. Reason: Could not install the extension [..] on tenant default due to the following error: Error code: 85132273

"platform": "14.0.0.0", "application": "14.0.0.0", "runtime": "3.2"

atoader commented 4 years ago

Let's get the issue to a team who will fix and backport it, as this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.

To open a support case, you can:

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.

HennieBink commented 4 years ago

This is an AL Compiler issue. We work in AL and we can't publish this from VS Code.

HennieBink commented 4 years ago

Ok, i've figured out a solution for this, although i'm not exactly sure as to why this is needed to resolve this issue.

Whenever you get error code 85132273, it means you got the real error right before that and you tried to publish it again.

Access the database using SQL Server Management Studio and execute the following query:

DELETE FROM [].[dbo].[NAV App Installed App] Where Name = []

You should be able to publish it again.

HennieBink commented 4 years ago

Real error is:

The following C/AL functions are limited during write transactions because one or more tables will be locked. Form.RunModal is not allowed in write transactions. Codeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed. Report.RunModal is allowed in write transactions only if 'RequestForm = FALSE'. For example, 'Report.RunModal(...,FALSE)' is allowed. XmlPort.RunModal is allowed in write transactions only if 'RequestForm = FALSE'. For example, 'XmlPort.RunModal(...,FALSE)' is allowed. Use the COMMIT function to save the changes before this call, or structure the code differently.

This is possibly caused by some datachanges while publishing. I some cases it worked to switch off some Flows (Power Automate).

HennieBink commented 4 years ago

The error "The following C/AL functions are limited during write transactions because one or more tables will be locked." occurs when you make a change in fields of tables.

Using "schemaUpdateMode": "Recreate" is a solution. App wil publish again after deleting the record in SQL in [NAV App Installed App]. But all app-data is lost.

dkartiq commented 7 months ago

Ok, i've figured out a solution for this, although i'm not exactly sure as to why this is needed to resolve this issue.

Whenever you get error code 85132273, it means you got the real error right before that and you tried to publish it again.

Access the database using SQL Server Management Studio and execute the following query:

DELETE FROM [].[dbo].[NAV App Installed App] Where Name = []

You should be able to publish it again.

It works. thanks. I dont find a record with the App Name but with the App ID. I deleted the record by applying filter on the App ID and then installed, It worked.