Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCP report is blank on ACS commons version 5.2.0 on ACS 2022.4.7138 #2837

Closed
2 tasks done
rkondaveeti opened this issue May 3, 2022 · 10 comments · Fixed by #2846
Closed
2 tasks done

MCP report is blank on ACS commons version 5.2.0 on ACS 2022.4.7138 #2837

rkondaveeti opened this issue May 3, 2022 · 10 comments · Fixed by #2846
Labels

Comments

@rkondaveeti
Copy link

rkondaveeti commented May 3, 2022

Required Information

  • ACS AEM Commons Version: 2022.4.7138, same works on feature works on ACS version 2022.1.6198 with ACS commons version 5.2.0/5.3.0
    MCP_report_error_log.txt

  • Reproducible on Latest? Yes

Expected Behavior

After running the MCP program, when generating the report in HTML/excel it should generate/print report in/to excel/page.

Actual Behavior

After running the MCP program, when generating the report in HTML we see a blank page and when generating the report in excel, we get a 500 error.

Steps to Reproduce

This issue can be seen in "Asset Report" feature as well.

  1. Click on "Start Process" button
  2. Select "Asset Report" process
  3. Accept the defaults and click Start
  4. once finished, navigate to the list of processes screen "/apps/acs-commons/content/manage-controlled-processes.html"
  5. Click on the "Asset Report" instance and select "view" or "Downlod (Excel)"

Installed ACS AEM SDK version "2022.4.7138" and installed ACS commons version 5.2.0. Run any utility which generates reports based on "/apps/acs-commons/components/utilities/process-instance/process-generic-report" component. We can either view the report in HTML or download the report in excel. Currently, the HTML is blank and throws 500 error while downloading the excel. Attached the error log "MCP_report_error_log.txt" for reference.

The same features are working fine in ACS AEM version "2022.1.6198".

MCP_report_error_log.txt

Links

/apps/acs-commons/content/manage-controlled-processes.html
/apps/acs-commons/components/utilities/process-instance/process-generic-report

@YegorKozlov
Copy link
Contributor

I can't reproduce it on my local "2022.4.7138" + ACS Commons v5.2.0. I also tried with 5.3.1-SNAPSHOT which is also working fine.
Are you running the report for the entire /content/dam or for a sub-folder? Is there anything special in the data ?

Going by the exception, the report has no columns. Can you please confirm it? The exception message contains the path of report node,e.g. /var/acs-commons/mcp/instances/6A64C1698EE3B81B/_jcr_content/report

image

Does it have the columns property ? Please provide the full json dump of the MCP instance.

Also, are you running the report as an admin ?I wonder if it matters.

@rkondaveeti
Copy link
Author

Thanks Yegor for looking into this issue. Please find below the info related to your questions and more details.

  1. I am running the "Tag Report" MCP process with defaults:

image

  1. Yes, I see the columns:

image

  1. Attached the json dump of the instance, please refer to "json_dump.txt"
  2. Yes, I am running the report as admin

After raising the bug, I did more analysis and found :

  1. The report works fine with vanilla instance of AEM "2022.4.7138" with just ACS commons v5.2.0
  2. But, it fails to load when I install AEM forms add on. I am installing AEM form add-on v"aem-forms-addon-2022.04.12.02-220400.far". To install AEM Forms add on, I stopped the AEM instance, created "install" folder under "crx-quickstart" and placed the ".far" file and started the instance.

After this the report stops loading. It seems to me that the sling model "com.adobe.acs.commons.mcp.model.GenericBlobReport" in "/apps/acs-commons/components/utilities/process-instance/process-blob-report/process-blob-report.html" doesn't load. on the rendered HTML, thead or tbody is blank.

image
json_dump.txt

@YegorKozlov
Copy link
Contributor

YegorKozlov commented May 15, 2022

It's a bug in the Forms SDK. I traced it down to SlingModelEnumInjector in the AEM Forms Output Batch API Impl bundle.

SlingModelEnumInjector is a custom Sling Models injector which breaks the contract for multi-valued fields. The impact is that injecting multi-valued fields is broken AEM-wide. I won't be surprised the issue will pop up in other parts of AEM.

The simplest test case that demonstrates the issue:

@Model(adaptables = Resource.class)
public class UserModel  {

    @Inject
    private List<String> columns; // BUG: multi-valued fields won't be injected

    @Inject
    private String name; // single-value fields are injected fine

}

and this is exactly what's happening with the ACS Commons report models: they can't initialize columns which are stored in a String[] field.

Injectors in Sling Models are pluggable and when injecting a value into a model, AEM iterates over all registered injectors until one returns a non-null value. SlingModelEnumInjector breaks this contract and returns an empty collection. It should return null instead and let other injectors run, until ValueMapInjector will read the data.

@kwin
Copy link
Contributor

kwin commented May 15, 2022

We can switch to injector-specific annotations in the ACS AEM Commons models to prevent the wrong injector from kicking in.

@rkondaveeti
Copy link
Author

Thanks Yegor and kwin for quick reply.

@kwin, could you please provide an example on how to switch to "Injector-specific annotations"? This issue is breaking many features in our project. I will try and see if this can be fixed with this approach.

@rkondaveeti
Copy link
Author

I raised a ticket with Adobe regarding this issue. Thanks.

@kwin
Copy link
Contributor

kwin commented May 15, 2022

YegorKozlov added a commit to YegorKozlov/acs-aem-commons that referenced this issue May 16, 2022
@YegorKozlov
Copy link
Contributor

@kwin thanks for the tip. Changing @Inject to @ValueMapValue did the trick and MCP Reports started to work with the Forms SDK. The PR with the fix is #2846

@rkondaveeti
Copy link
Author

Thanks Yegor and Kevin. Any idea on the date when this would be released?

kwin pushed a commit that referenced this issue May 23, 2022
@rkondaveeti
Copy link
Author

This issue is fixed in latest AEM version 2022.5.7575.
Wanted to update here. Thanks again for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants