Internal Server Error with custom record action, no further info

Hi!

Iā€™m trying to add a custom record action following this tutorial:

Iā€™m using the bitnami suitecrm image with suitecrm 8.5.1.

Iā€™ve modified the files according to my needs, but in principle Iā€™ve just changed the module and action name. Everything seems to work up until the moment when I select a Quote in the modal, then I get
UI: Unexpected error when calling action
Response:

{
ā€œerrorsā€: [
{
ā€œmessageā€: ā€œInternal server errorā€,
ā€œextensionsā€: {
ā€œcategoryā€: ā€œinternalā€
},
ā€œlocationsā€: [
{
ā€œlineā€: 2,
ā€œcolumnā€: 3
}
],
ā€œpathā€: [
ā€œcreateProcessā€
]
}
],
ā€œdataā€: {
ā€œcreateProcessā€: null
}
}
Blockquote

Unfortunately, despite logging on debug level (I get all the other debug and info messages in public/legacy/suitecrm.log), there is no further info to be found in suitecrm.log or the apache error log.

Ivā€™e created the following files (please find them via the dropbox link):
/opt/bitnami/suitecrm/extensions/defaultExt/config/modules/Accounts/recordview/actions/create-pdf.php
/opt/bitnami/suitecrm/extensions/defaultExt/modules/Accounts/Process/Service/RecordActions/CreatePdfAction.php
/opt/bitnami/suitecrm/public/legacy/custom/Extension/modules/Accounts/Ext/Language/en_us.create_pdf.php

Iā€™ve also uploaded the full request payload.
https://www.dropbox.com/scl/fo/e36hpsxd41xg52ko6yuli/ACi7WeIQ7EJt1RWArkXG8fM?rlkey=3u5ze04utmsj4oo61fjvzuh0n&st=aqnmlo0g&dl=0

Thanks in advance to anyone who can point out any mistakes or help me get better error messages!

BR,
Chris

Thanks for the example, but I fail to find the difference - it seems they did everything just like in my codeā€¦?

You have to run a symfony cache clear from your instance root folder.

.bin/console cache:clear

1 Like

If you still have problems after the cache:clear, the way to get better messages is to go in .env file and change APP_ENV to dev.

Then, if everything starts crashing (usually itā€™s a Doctrine fatal error), you need to run a composer install to get the dev packages.

After that it should all work again; and you can reproduce your error, and in the browser developer tools, network tab, you will find helpful stack traces in one of the grapql calls (you have to look around to find each one).

1 Like

Thanks! setting the dev value in the .env file got me the error messages!
It seems that

LoggerManager::getLogger()

doesnā€™t work:
Class \u0022App\Extension\defaultExt\modules\Accounts\Process\Service\RecordActions\LoggerManager\u0022 not found

I tried importing the one from Consolidation\Log, but that doesnā€™t seem to be the correct one.

Without the logger calls, the script works fine - Iā€™d still like to log things though :smiley:

BR,
Chris

I think you just need to fix your logging code. If youā€™re not in legacy mode, you shouldnā€™t be looking for the LoggerManager, and much less if youā€™re looking for it under defaultExtā€¦ itā€™s a core file.

If youā€™re not in legacy mode, just use the ā€œmodernā€ side of logging, as a randomly-selected example, copy what you find in this file.