Dolibarr cron error 500

I moved my dolibarr from debian to ubuntu 22.04 LTS recently.
Installed dolibarr 18.0.4 and copied the DB
All is fine, but I am giving error 500 on Fournisseur cron.
If I create the facture manually its work well, but if I try by cron error 500 appears.

part of my log is

2024-01-04 14:26:46 DEBUG   207.248.4.199      sql=INSERT INTO llx_actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status) VALUES(4460, 'user', 1, 0, 0, 0)
2024-01-04 14:26:46 INFO    207.248.4.199      Trigger 'Notification' for action 'ACTION_CREATE' launched by /var/www/erp.luizeconsulting.com/htdocs/core/triggers/interface_50_modNotification_Notification.class.php. id=4460
2024-01-04 14:26:46 INFO    207.248.4.199      Notify::send notifcode=ACTION_CREATE, object id=4460
2024-01-04 14:26:46 DEBUG   207.248.4.199      sql=SELECT 'tocontactid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.default_lang, a.rowid as adid, a.label, a.code, n.rowid, n.threshold, n.context, n.type FROM llx_socpeople as c, llx_c_action_trigger as a, llx_notify_def as n, llx_societe as s WHERE n.fk_contact = c.rowid AND a.rowid = n.fk_action AND n.fk_soc = s.rowid AND c.statut = 1 AND a.code = 'ACTION_CREATE' AND s.rowid = 226
UNION
SELECT 'touserid' as type_target, c.email, c.rowid as cid, c.lastname, c.firstname, c.lang as default_lang, a.rowid as adid, a.label, a.code, n.rowid, n.threshold, n.context, n.type FROM llx_user as c, llx_c_action_trigger as a, llx_notify_def as n WHERE n.fk_user = c.rowid AND a.rowid = n.fk_action AND c.statut = 1 AND a.code = 'ACTION_CREATE'
2024-01-04 14:26:46 INFO    207.248.4.199      No notification to thirdparty sent, nothing into notification setup for the thirdparty socid = 226
2024-01-04 14:26:46 DEBUG   207.248.4.199     sql=UPDATE llx_ecm_files set filename = CONCAT('OC-FAT-030124-0958', SUBSTR(filename, 11)), filepath = 'fournisseur/facture/5/7/OC-FAT-030124-0958' WHERE filename LIKE '(PROV1075)%' AND filepath = 'fournisseur/facture/5/7/(PROV1075)' and entity = 1
2024-01-04 14:26:46 DEBUG   207.248.4.199     sql=UPDATE llx_ecm_files set filepath = 'fournisseur/facture/5/7/OC-FAT-030124-0958' WHERE filepath = 'fournisseur/facture/5/7/(PROV1075)' and entity = 1
2024-01-04 14:26:46 ERR     207.248.4.199    DoliDBMysqli::close Closing a connection with an opened transaction depth=1
2024-01-04 14:26:46 WARNING 207.248.4.199    --- End access to /cron/list.php (Warn: db disconnection forced, transaction depth was 1)

After the manual creation I found the pdf at directory …6/7… but not in the directory …5/7… like the log informs.

Anyone could help me, please?

Thanks and a happy new year for all
Luis

Hello,

Error 500 means PHP => What does your hosting log says ?

Hi ksar, Here is it
Looking it I found dolicalc requests, but it´s not installed in that code, but it´s was installed once in the original system. Is it related?

2024/01/04 11:13:48 [error] 2435#2435: *2911 open() "/var/www/erppath/htdocs/dolicalc/js/calculator.js" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/js/calculator.js?lang=pt_BR HTTP/1.1", host: "erppath", referrer: "...erppath/cron/list.php?id=9&action=execute&securitykey=...&sortfield=t.status,t.priority&sortorder=DESC,ASC&contextpage=cronjoblist"  
2024/01/04 11:13:50 [error] 2435#2435: *2913 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Object of class User could not be converted to string in /var/www/erppath/htdocs/fourn/class/fournisseur.facture-rec.class.php:1330  
Stack trace:  
#0 /var/www/erppath/htdocs/cron/class/cronjob.class.php(1290): FactureFournisseurRec->createRecurringInvoices()  
#1 /var/www/erppath/htdocs/cron/list.php(161): Cronjob->run_jobs()  
#2 {main}  
thrown in /var/www/erppath/htdocs/fourn/class/fournisseur.facture-rec.class.php on line 1330" while reading response header from upstream, client: 207.248.4.199, server: erppath, request: "GET /cron/list.php?id=9&securitykey=...&contextpage=cronjoblist&action=confirm_execute&confirm=yes&token=90cb68c12bde9710892a2b2005fc3677 HTTP/1.1", upstream: "fastcgi...unix:/var/run/php/php7.4-fpm.sock:", host: "erppath", referrer: "...erppath/cron/list.php?id=9&action=execute&securitykey=...&sortfield=t.status,t.priority&sortorder=DESC,ASC&contextpage=cronjoblist"  
2024/01/04 11:13:53 [error] 2435#2435: *2913 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Object of class User could not be converted to string in /var/www/erppath/htdocs/fourn/class/fournisseur.facture-rec.class.php:1330  
Stack trace:  
#0 /var/www/erppath/htdocs/cron/class/cronjob.class.php(1290): FactureFournisseurRec->createRecurringInvoices()  
#1 /var/www/erppath/htdocs/cron/list.php(161): Cronjob->run_jobs()  
#2 {main}  
thrown in /var/www/erppath/htdocs/fourn/class/fournisseur.facture-rec.class.php on line 1330" while reading response header from upstream, client: 207.248.4.199, server: erppath, request: "GET /cron/list.php?id=9&securitykey=07m758NiqI3xvLNygp7tu9OIX6V7JzAM...contextpage=cronjoblist&action=confirm_execute&confirm=yes&token=90cb68c12bde9710892a2b2005fc3677 HTTP/1.1", upstream: "fastcgi...unix:/var/run/php/php7.4-fpm.sock:", host: "erppath", referrer: "...erppath/cron/list.php?id=9&action=execute&securitykey=...&sortfield=t.status,t.priority&sortorder=DESC,ASC&contextpage=cronjoblist"  
2024/01/04 11:13:58 [error] 2435#2435: *2908 open() "/var/www/erppath/htdocs/dolicalc/css/mathquill.css" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/css/mathquill.css HTTP/1.1", host: "erppath", referrer: "...erppath/"  
2024/01/04 11:13:58 [error] 2435#2435: *2907 open() "/var/www/erppath/htdocs/dolicalc/js/mathquill.js" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/js/mathquill.js?lang=pt_BR HTTP/1.1", host: "erppath", referrer: "https...erppath/"  
2024/01/04 11:13:58 [error] 2435#2435: *2911 open() "/var/www/erppath/htdocs/dolicalc/js/calculator.js" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/js/calculator.js?lang=pt_BR HTTP/1.1", host: "erppath", referrer: "......erppath/"  
2024/01/04 11:14:02 [error] 2435#2435: *2907 open() "/var/www/erppath/htdocs/dolicalc/js/calculator.js" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/js/calculator.js?lang=pt_BR HTTP/1.1", host: "erppath", referrer: "......erppath/cron/list.php?leftmenu=admintools&idmenu=38563"  
2024/01/04 11:14:02 [error] 2435#2435: *2914 open() "/var/www/erppath/htdocs/dolicalc/css/mathquill.css" failed (2: No such file or directory), client: 207.248.4.199, server: erppath, request: "GET /dolicalc/css/mathquill.css HTTP/1.1", host: "erppath", referrer: "...erppath/cron/list.php?leftmenu=admintools&idmenu=38563"

Hello,

dolical has not been removed correctly on your system, but it’s not the cause of your issue.

It’s a Dolibarr bug, here is the FIX : Object of class User could not be converted to string in .../htdocs/fourn/class/fournisseur.facture-rec.class.php · Issue #27262 · Dolibarr/dolibarr · GitHub

Hi ksar,

I look at the link and doesn´t find the solution. They are still working in it, right?

Thanks by the help.