AL icon indicating copy to clipboard operation
AL copied to clipboard

PTE0004 raised when publishing on cloud environments without reason

Open nicolassaleron opened this issue 2 months ago • 4 comments

1. Describe the bug

This bug has been signaled first on Viva Engage.

I am experiencing an issue and was wondering whether other partners have encountered the same behavior.

My observations are as follows:

When deploying a PTE in a BC FR environment (Platform 28.0.52495.0 + Application 28.3.52162.52579), in my case by manually uploading the .app file, the deployment fails with the error below if:

  • the permission set is defined inside a namespace, and
  • the object referenced in the permission set is resolved through a using directive.

Package validation failed due to the following error(s): (5,13): error PTE0004: Table 80000 '***' is missing a matching permission set. (5,13): error PTE0004: Table 80001 '***' is missing a matching permission set. (7,13): error PTE0004: Table 80003 '***' is missing a matching permission set. - Job Id : e581f2c1-b75d-46da-8dc8-4abbcb2362fb

As soon as I remove the using directives and fully qualify the object names in the permission set, the deployment succeeds.

2. To Reproduce Steps to reproduce the behavior:

  1. Create an AL PTE app with one table and one permissionset (with no namespace)
  2. Publish it to a cloud sandbox
  3. Add a namespace to the table: MyApp.Tables
  4. Add a namespace to the permissionset: MyApp.PermissionSet

It seems important that both objects are in different namespaces

  1. Add the table in the permissionset and do not fully qualify the table: use a using directive instead.
  2. Publish it to a cloud sandbox... sometimes you will get this error.
namespace MyApp.PermissionSet;

using MyApp.Tables;

permissionset 80000 "MyApp Permissions"
{
    Assignable = true;
    Caption = 'MyApp Permissions';
    Permissions = tabledata "MyApp Table" = RIMD,
      table "MyApp Table" = X;
}
namespace MyApp.Tables;

table 80000 "MyApp Table"
{
   fields
   {
      field(1; "PK"; Integer) { }
   }
}

3. Expected behavior PTE0004 should not be raised.

4. Actual behavior PTE0004 is raised even if the table is part of a permissionset.

5. Versions: This issue does not occur when compiling on VSCode or with AL-Go. It only occurs when publishing on a cloud environment.

It has been reproduced on the following platform/application versions:

  • On July, 17th 2026: Platform 28.0.52495.0 + Application 28.3.52162.52579
  • On September, 30th 2026: Platform 28.0.54846.0 + Application 28.5.54151.55108

Internal work item: AB#655852

nicolassaleron avatar Sep 30 '26 08:09 nicolassaleron

We are currently experiencing the same issue.

The workaround described here also worked for us: removing the namespace and the corresponding using statement from the permission file allowed us to deploy the PTE again. @nicolassaleron Thx . for the Workaround!

Interestingly, we have seen similar behavior occasionally in the past. In those cases, the first deployment failed, but simply retrying the deployment a second or sometimes a third time succeeded — without making any changes to the app in between.

However, since September 29, deployments for one of our PTEs have consistently failed and retrying no longer helps. Removing the namespace and the corresponding using statement was the only workaround that allowed us to deploy it again.

It does not seem to be a general issue with namespaces in permission files, though. We have another PTE where namespaces and using statements are still present in the permission file, and deployments of that app continue to work without any problems.

Version: DE Business Central 28.4 (Platform 28.0.54688.0 + Application 28.4.53241.54676)

BB97GER avatar Oct 01 '26 10:10 BB97GER

Are there any updates on this issue?

We encountered this problem again today. Namespaces were not enabled for the PermissionSet object, but new Page objects were added to the permission set.

The first deployment failed with the following error:

"Package validation failed due to the following error(s): (3,13): error PTE0004....."

Afterwards, I uploaded the exact same .app file again without making any changes, and the deployment completed successfully.

This behavior is extremely frustrating, especially since we have scheduled maintenance windows that we need to adhere to. Having deployments fail unpredictably, only to succeed on a second attempt with the exact same file, causes unnecessary delays and uncertainty.

I'm honestly surprised that more partners and customers aren't reporting this issue, as I would expect others to encounter the same behavior.

Is this issue still being investigated? Is there any progress or an estimated timeline for a fix?

From my perspective, this is a serious reliability issue in the deployment process that really needs to be addressed.

BB97GER avatar Oct 19 '26 06:10 BB97GER

Just my two cents: the issue seems quite random. It appears to affect individual environments and then resolve itself. Could there perhaps be a configuration issue affecting some of the Business Central online servers?

Do we have a workaround to quickly fix this issue? For instance, would restarting the environment help?

nicolassaleron avatar Oct 19 '26 07:10 nicolassaleron

Hi,

Thank you for the detailed issue report! We've reproduced the issue.

Why it's inconsistent Due to intermittent timeout issues in one of our internal services, PTE validation sometimes runs on a fallback path, where the PTE0004 rule is faulty. That's why the same .app can fail on one upload and succeed on the next. An environment restart won't help, because the timeouts happen in our service, not in your environment.

What goes wrong On that path, the PTE0004 rule doesn't correctly match tables to a permission set in a different namespace (for example, tables brought in with a using directive), so they're reported as missing a permission set even though they're covered.

We're working on a fix for the PTE0004 rule, and we're also investigating the service reliability issues.

krupybalu avatar Oct 20 '26 13:10 krupybalu