AL icon indicating copy to clipboard operation
AL copied to clipboard

Error: This Extension cannot be published as it has the same Publisher, Name, and Version...

Open sonicadv27 opened this issue 7 years ago • 15 comments

I have a recently created Docker container with image mcr.microsoft.com/businesscentral/sandbox:pt and i'm developing a new Extension in VS Code. No other extensions exist and a first deploy of the extension is successful.

However, after 3 or 4 publish operations it stops working and i get this error: This Extension cannot be published as it has the same Publisher, Name, and Version as a previously published Extension.

I've tried everything from creating a new container to creating a new extension from scratch, changing the publisher and extension name and nothing worked, and if it works it stops working, again, after a few publish operations. I have no dependencies and i can't even unpublish the extension because it doesn't show up on the Extension Management page, nor does running UnpublishApp on Powershell work either.

Any ideas? Because i'm clueless.

Edit: Changing the version on app.json does nothing on its own and it doesn't seem to matter what schemaUpdateMode i use.

sonicadv27 avatar Jan 23 '19 10:01 sonicadv27

Routing to our AL repo, as this isn't application related. Hope they can help you!

JesperSchulz avatar Jan 25 '19 13:01 JesperSchulz

Thanks @sonicadv27 for posting this issue. Can you post your AL language version (VS Code extension version) and your BC version?

ghost avatar Jan 25 '19 15:01 ghost

My AL version is 2.1.69331 and i've tried with containers running images mcr.microsoft.com/businesscentral/sandbox:pt (which is runtime 2.2) and microsoft/bcsandbox:base (which is runtime 1.0, i believe)

sonicadv27 avatar Jan 25 '19 16:01 sonicadv27

Hi again @sonicadv27, I need your BC version. Open the web client, search for "System Information", and then post your version. It should look something like: "US Dynamics NAV 13.1 (26534)" for example.

ghost avatar Jan 25 '19 16:01 ghost

The latest image i tried this with had BC version W1 13.0 (24844).

sonicadv27 avatar Jan 25 '19 16:01 sonicadv27

Open the Powershell of the container. Use command "Get-NAVAppInfo" to verify all the extensions in your container and uninstall any if you find anything.

ashik-ivor avatar Jan 28 '19 05:01 ashik-ivor

When i run the Get-NAVContainerAppInfo only Microsoft extensions get returned. But i still can't publish my extension.

sonicadv27 avatar Jan 28 '19 10:01 sonicadv27

I have the same issue on the OnPrem version. It is solved by deleting the record in the Nav App table in SQL. Don't know if you can access sql on your docker but hope it helps.

BartPermentier avatar Jan 31 '19 13:01 BartPermentier

I did that but i got another error, which i would get from time to time, trying to get this to work:

"Could not install the extension [name] on tenant default due to the following error: Error code: 85132273"

sonicadv27 avatar Jan 31 '19 15:01 sonicadv27

Is there any additional information about this because I have a similar issue? Mine is maybe related to dependency package because I've noticed that behaviour when I was uninstalling the depended package and updating the "base" package. Sometimes happens that the process of publishing (I'm using webdeploy.exe to publish app to container on Azure VM. ) does not finish and must be interrupted. In this case, repeating the process of publishing will result in an error described here.In this case app is uninstalled / unpublished and record of that app remains in table "NAV app". To continue using updated app I have to delete record from "NAV app" table - "local" container. In Azure container I have to publish app with increased version.

"vscode extension": "al-2.1.99743"
"platform": "14.0.28496.0"
"version": "14.0.28630.0"
"bcinsider.azurecr.io/bcsandbox-master:rs-ltsc2019 
 => "sha256:f7288dea8671ab3640ca3b11a3ff5ec777e78805bd4c32f5c52df576ce1d0e9f"

BR, Bojan

boych83 avatar Mar 04 '19 23:03 boych83

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 [<your_database_name>].[dbo].[NAV App Installed App]
  Where Name = [<your_app_name>]

You should be able to publish it again.

sonicadv27 avatar Mar 13 '19 12:03 sonicadv27

@sonicadv27 seems you have unblocked yourself. We are in the process of adding more telemetry and investing heavily in making this process more robust. Please comment here if there are any more issues, but for now I will close this issue.

ghost avatar Apr 01 '19 11:04 ghost

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 [<your_database_name>].[dbo].[NAV App Installed App]
  Where Name = [<your_app_name>]

You should be able to publish it again.

I have the same error "Error code: 85132273" in a cloud sandbox when i try to publish an app. How can i solve this in a cloud instance?

JohnnyUndercover avatar Jan 29 '20 10:01 JohnnyUndercover

@JohnnyUndercover ensure you don't have any extensions installed or published in your extension management page that can conflict with the one you are publishing. If you still experience issues reach out to our support. Thanks

ghost avatar Jan 29 '20 10:01 ghost

We are still seeing this error. It may be due to the fact that in our dev environment with the same (now multi) tenant we were publishing Extensions of Scope 'Dev' and now are using 'Global'. Below is our temporary workaround (OnPrem BC18.5):

Write-Host -ForegroundColor Cyan "Publishing '$AppName' on instance '$ServerInstance', Scope 'Global': $AppPath"
Try {
    Publish-NAVApp -Force -SkipVerification -Scope Global -ServerInstance $ServerInstance -Path $AppPath
} Catch {
    if ($_.Exception.Message -eq 'This Extension cannot be published as it has the same Publisher, Name, and Version as a previously published Extension.') {
        $SQLString = "DELETE FROM [dbo].[Published Application] WHERE [Name] = '$AppName'"
        $null = Invoke-Sqlcmd -Username $UserName -Password $Password -Query $SQLString -ServerInstance $DatabaseServer -Database $DatabaseName

        Write-Host -ForegroundColor Magenta "Warning: Publishing (second attempt) '$AppName' on instance '$ServerInstance', Scope 'Global': $AppPath"
        Publish-NAVApp -Force -SkipVerification -Scope Global -ServerInstance $ServerInstance -Path $AppPath -ErrorAction Stop

    } else {
        # Re-Throw error
        throw $_.Exception
    }
}

ian-scho avatar Nov 25 '21 13:11 ian-scho