Error Page 500 on product entry and PDF creation

Dear all,

I am kind of desperate. I am running Version 18.0.3. Due to a server crash I had to move to a new server. I got dolibarr from a backup back up and running. However, when I try to generate an invoice (or proposal) it throws a Page 500 error.

the following error is in the server log:

[Wed Dec 06 06:42:23.430434 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: PHP Fatal error:  Uncaught Error: Class 'ActionsTos' not found in /home/wi/www/XXX/dolibarr_gmbh/htdocs/core/class/hookmanager.class.php:122, referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430480 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: Stack trace:, referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430488 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #0 /home/wi/www/XXX/dolibarr_gmbh/htdocs/core/modules/facture/doc/pdf_crabettc.modules.php(257): HookManager->initHooks(Array), referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430494 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #1 /home/wi/www/XXX/dolibarr_gmbh/htdocs/core/class/commonobject.class.php(5511): pdf_crabettc->write_file(Object(Facture), Object(Translate), '', 0, 0, 0, NULL), referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430500 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #2 /home/wi/www/XXX/dolibarr_gmbh/htdocs/compta/facture/class/facture.class.php(5267): CommonObject->commonGenerateDocument('core/modules/fa...', 'crabettc', Object(Translate), 0, 0, 0, NULL), referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430508 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #3 /home/wi/www/XXX/dolibarr_gmbh/htdocs/core/tpl/card_presend.tpl.php(105): Facture->generateDocument('crabettc', Object(Translate), 0, 0, 0), referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430516 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #4 /home/wi/www/XXX/dolibarr_gmbh/htdocs/compta/facture/card.php(5932): include('/home/wi/...'), referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1
[Wed Dec 06 06:42:23.430521 2023] [-:error] [pid 7707:tid 37461323008] [client 185.236.201.215:0] FastCGI: server "/var/run/hcgi/19" stderr: #5 {main}, referer https://www.XXX.ch/dolibarr_gmbh/htdocs/compta/facture/card.php?facid=1843&save_lastsearch_values=1

I have absolutely no clue what could be the error? I think it might be only a “small” thing. But maybe someone could point me to a solution.

Thanks.

All the best,
Chris.

Adding MAIN_DISABLE_PDF_AUTOUPDATE 1 in the other settings circumvents the problem temporarly. However, when I try to manually create the PDF then the error return :frowning:

Same error happens when I try to enter a payment.

Hi Chris,

just a guess: Did you use an external module on the old server which you forgot to install/configure on the new server? The class ActionsTos (first line of the log) seems not to belong to the standard dolibarr.

Joachim

Hello,

This is due to that module : ToS
Most probably missing in your new server
But not compatible Dolibarr V18 and PHP V8
Recommendation is to remove it

crabettc is also an external module, most probably not compatible Dolibarr V18 and/or PHP V8
Recommendation is to remove it

Many thanks to all - you saved my day! Removed ToS and it worked. But what is really strange - on the old server the module worked flawlessly with ToS on v18.0.3.

I found also the following snipped in the ToS source code:

// We need to instantiate tcpdi object (instead of tcpdf) to use merging features. But we can disable it (this will break all merge features).
if (empty($conf->global->MAIN_DISABLE_TCPDI)) {
require_once TCPDI_PATH.‘tcpdi.php’;
}

Is there a global variable in Dolibarr settings that enables “tcpdi”?

All the best,
Chris.

Hello,

May be the old server was running php V7 and the new one php V8.

I’m not aware of this feature.

Could be - but when I revert back to php V7 (I can switch between 7 and 8) it wont work either way.

Last question - is there a simple solution to attach a single pdf page with each proposal, invoice, etc. - with simple I mean is there a slim module that only does that job (like ToS) - maybe I just missed it or someone could point me in the right direction (either DoliStore or for a free version to github?)

Otherwise the topic is solved.

Thanks for your help,
Chris

Hello,

Some users are using Rubis PDF pack to do that : https://www.mon-dolibarr.fr/support/telechargements/?dl_page=2
But it is not yet compatible PHP V8 (ongoing by @Philazerty )