Response code 500 on API GET method for "/bankaccounts/{id}/lines" endpoint

Hello, I don’t see any error in the Debug log. I just see the next:

2025-05-21 17:02:36 NOTICE 192.33.248.84 179812 1126 — Access to GET /dolibarr_pruebas2/api/index.php/bankaccounts/1/lines - action=, massaction= NOTOKENRENEWAL=1
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT transkey, transvalue FROM llxvx_overwrite_trans where (lang=‘es_CO’ OR lang IS NULL) AND entity IN (0, 0,1) ORDER BY lang DESC
2025-05-21 17:02:36 DEBUG 192.33.248.84 163407 1126 sql=SELECT transkey, transvalue FROM llxvx_overwrite_trans where (lang=‘es_CO’ OR lang IS NULL) AND entity IN (0, 0,1) ORDER BY lang DESC
2025-05-21 17:02:36 INFO 192.33.248.84 179812 1126 Load a dedicated API file moduleobject=bankaccounts moduledirforclass=compta/bank
2025-05-21 17:02:36 INFO 192.33.248.84 179812 1126 Search api file /compta/bank/class/api_bankaccounts.class.php => dir_part_file=/home/ferreter1/public_html/dolibarr_pruebas2/compta/bank/class/api_bankaccounts.class.php, classname=Bankaccounts
2025-05-21 17:02:36 INFO 192.33.248.84 163407 1126 — End access to /dolibarr_pruebas2/api/index.php/explorer/images/throbber.gif
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT u.login, u.datec, u.api_key, u.tms as date_modification, u.entity FROM llxvx_user as u WHERE u.api_key = ‘_____________________________’ OR u.api_key = ‘__________________________________’
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.civility as civility_code, u.birth, u.job, u.email, u.email_oauth2, u.personal_email, u.socialnetworks, u.signature, u.office_phone, u.office_fax, u.user_mobile, u.personal_mobile, u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id, u.admin, u.login, u.note_private, u.note_public, u.pass, u.pass_crypted, u.pass_temp, u.api_key, u.fk_soc, u.fk_socpeople, u.fk_member, u.fk_user, u.ldap_sid, u.fk_user_expense_validator, u.fk_user_holiday_validator, u.statut as status, u.lang, u.entity, u.datec as datec, u.tms as datem, u.datelastlogin as datel, u.datepreviouslogin as datep, u.flagdelsessionsbefore, u.iplastlogin, u.ippreviouslogin, u.datelastpassvalidation, u.datestartvalidity, u.dateendvalidity, u.photo as photo, u.openid as openid, u.accountancy_code_user_general, u.accountancy_code, u.thm, u.tjm, u.salary, u.salaryextra, u.weeklyhours, u.color, u.dateemployment, u.dateemploymentend, u.fk_warehouse, u.ref_ext, u.default_range, u.default_c_exp_tax_cat, u.national_registration_number, u.ref_employee, c.code as country_code, c.label as country, d.code_departement as state_code, d.nom as state, s.label as label_establishment, u.fk_establishment FROM llxvx_user as u LEFT JOIN llxvx_c_country as c ON u.fk_country = c.rowid LEFT JOIN llxvx_c_departements as d ON u.fk_state = d.rowid LEFT JOIN llxvx_establishment as s ON u.fk_establishment = s.rowid WHERE u.entity IN (0, 1) AND u.login = ‘api_1’ ORDER BY u.entity ASC
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help, css, cssview, csslist FROM llxvx_extrafields WHERE elementtype = ‘user’ ORDER BY pos
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT DISTINCT r.module, r.perms, r.subperms FROM llxvx_user_rights as ur, llxvx_rights_def as r WHERE r.id = ur.fk_id AND r.entity = 1 AND ur.entity = 1 AND ur.fk_user = 5 AND r.perms IS NOT NULL AND r.perms NOT LIKE ‘%_advance’
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT DISTINCT r.module, r.perms, r.subperms, r.entity FROM llxvx_usergroup_rights as gr, llxvx_usergroup_user as gu, llxvx_rights_def as r WHERE r.id = gr.fk_id AND gr.entity = 1 AND gu.entity IN (0,1) AND r.entity = 1 AND gr.fk_usergroup = gu.fk_usergroup AND gu.fk_user = 5 AND r.perms IS NOT NULL AND r.perms NOT LIKE ‘%_advance’
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 Account::fetch
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT ba.rowid, ba.ref, ba.label, ba.bank, ba.number, ba.courant as type, ba.clos as status, ba.rappro, ba.url, ba.code_banque, ba.code_guichet, ba.cle_rib, ba.bic, ba.iban_prefix as iban, ba.domiciliation as address, ba.pti_in_ctti, ba.proprio as owner_name, ba.owner_address, ba.owner_zip, ba.owner_town, ba.owner_country_id, ba.state_id, ba.fk_pays as country_id, ba.account_number, ba.fk_accountancy_journal, ba.currency_code, ba.min_allowed, ba.min_desired, ba.comment, ba.datec as date_creation, ba.tms as date_modification, ba.ics, ba.ics_transfer, c.code as country_code, c.label as country, d.code_departement as state_code, d.nom as state, aj.code as accountancy_journal FROM llxvx_bank_account as ba LEFT JOIN llxvx_c_country as c ON ba.fk_pays = c.rowid LEFT JOIN llxvx_c_departements as d ON ba.state_id = d.rowid LEFT JOIN llxvx_accounting_journal as aj ON aj.rowid=ba.fk_accountancy_journal WHERE ba.entity IN (1) AND ba.rowid = 1
2025-05-21 17:02:36 DEBUG 192.33.248.84 179812 1126 sql=SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help, css, cssview, csslist FROM llxvx_extrafields WHERE elementtype = ‘bank_account’ ORDER BY pos
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT rowid FROM llxvx_bank WHERE fk_account = 1 ORDER BY rowid
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 AccountLine::fetch
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 1
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help, css, cssview, csslist FROM llxvx_extrafields WHERE elementtype = ‘bank’ ORDER BY pos
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 AccountLine::fetch
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 5
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 AccountLine::fetch
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 7
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 AccountLine::fetch
2025-05-21 17:02:37 DEBUG 192.33.248.84 179812 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 8
.
.
.
.
.
.
.
.
2025-05-21 17:57:04 DEBUG 192.33.248.84 32018 1126 AccountLine::fetch
2025-05-21 17:57:04 DEBUG 192.33.248.84 32018 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 8966
2025-05-21 17:57:04 DEBUG 192.33.248.84 32018 1126 AccountLine::fetch
2025-05-21 17:57:04 DEBUG 192.33.248.84 32018 1126 sql=SELECT b.rowid, b.datec, b.datev, b.dateo, b.amount, b.label as label, b.fk_account, b.fk_user_author, b.fk_user_rappro, b.fk_type, b.num_releve, b.num_chq, b.rappro, b.note, b.fk_bordereau, b.banque, b.emetteur, ba.ref as bank_account_ref, ba.label as bank_account_label FROM llxvx_bank as b, llxvx_bank_account as ba WHERE b.fk_account = ba.rowid AND ba.entity IN (1) AND b.rowid = 8968
2025-05-21 17:57:04 INFO 192.33.248.84 32018 1126 — End access to /dolibarr_pruebas2/api/index.php/bankaccounts/1/lines

The only difference between this GET request of this bank account (id: 1 and 8137 lines) that generates the response code 500 with no content and another GET request that works successfuly for other bank accounts with less lines (less than 700 lines) is that the response code request 500 ends in b.rowid = 8968 but the request that works fine ends in b.rowid = 8967