Recurring invoices stopped Recurring

Version ie <v5.10.30>

v5.11.48

Environment <Docker/Shared Hosting/Zip/Other>

SHared

Checklist

N/A

Describe the bug

The recurring invoices have stopped recurring

Steps To Reproduce

Wait for CRON job.

Expected Behavior

Recurring invoices get queued.

Additional context

[2025-03-06 18:00:03] production.INFO: Trying to send 00032
[2025-03-06 18:00:03] production.INFO: Recurring Invoice Date Set on Invoice = 2025-03-06 - 2025-03-06
[2025-03-06 18:00:03] production.INFO: Unable to sending recurring invoice 62 SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e_invoice’ in ‘INSERT INTO’ (Connection: mysql, SQL: insert into invoices (status_id, discount, is_amount_discount, po_number, footer, terms, public_notes, private_notes, is_deleted, line_items, tax_name1, tax_rate1, tax_name2, tax_rate2, tax_name3, tax_rate3, total_taxes, subscription_id, custom_value1, custom_value2, custom_value3, custom_value4, amount, uses_inclusive_taxes, is_proforma, custom_surcharge1, custom_surcharge2, custom_surcharge3, custom_surcharge4, custom_surcharge_tax1, custom_surcharge_tax2, custom_surcharge_tax3, custom_surcharge_tax4, user_id, assigned_user_id, company_id, recurring_id, client_id, auto_bill_enabled, paid_to_date, design_id, e_invoice, date, due_date, updated_at, created_at) values (1, 0.000000, 0, Monthy Security/Updates/Backups, ?, ?, ?, ?, 0, [{“product_key”:“”,“notes”:“Monthy Security/Updates/Backups”,“cost”:100,“product_cost”:0,“quantity”:1,“tax_name1”:“”,“tax_rate1”:0,“tax_name2”:“”,“tax_rate2”:0,“tax_name3”:“”,“tax_rate3”:0,“custom_value1”:“”,“custom_value2”:“”,“custom_value3”:“”,“custom_value4”:“”,“discount”:0,“tax_id”:“1”,“type_id”:“1”,“task_id”:“”,“expense_id”:“”,“createdAt”:1684001760207000,“is_amount_discount”:false,“sort_id”:“0”,“line_total”:100,“gross_line_total”:100,“tax_amount”:0,“date”:“”,“unit_code”:“C62”}], ?, 0.000000, ?, 0.000000, ?, 0.000000, 0.000000, ?, ?, ?, ?, ?, 100.000000, 0, 0, 0.000000, 0.000000, 0.000000, 0.000000, 0, 0, 0, 0, 1, ?, 1, 62, 421, 0, 0, 4, ?, 2025-03-06, 2025-03-06 00:00:00, 2025-03-06 18:00:03.479349, 2025-03-06 18:00:03.479349))
[2025-03-06 18:00:03] production.INFO: Trying to send 00034
[2025-03-06 18:00:03] production.INFO: Recurring Invoice Date Set on Invoice = 2025-03-06 - 2025-03-06
[2025-03-06 18:00:03] production.INFO: Unable to sending recurring invoice 64 SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e_invoice’ in ‘INSERT INTO’ (Connection: mysql, SQL: insert into invoices (status_id, discount, is_amount_discount, po_number, footer, terms, public_notes, private_notes, is_deleted, line_items, tax_name1, tax_rate1, tax_name2, tax_rate2, tax_name3, tax_rate3, total_taxes, subscription_id, custom_value1, custom_value2, custom_value3, custom_value4, amount, uses_inclusive_taxes, is_proforma, custom_surcharge1, custom_surcharge2, custom_surcharge3, custom_surcharge4, custom_surcharge_tax1, custom_surcharge_tax2, custom_surcharge_tax3, custom_surcharge_tax4, user_id, assigned_user_id, company_id, recurring_id, client_id, auto_bill_enabled, paid_to_date, design_id, e_invoice, date, due_date, updated_at, created_at) values (1, 0.000000, 0, Monthy Security/Updates/Backups, ?, ?, ?, ?, 0, [{“product_key”:“”,“notes”:“Monthy Security/Updates/Backups”,“cost”:100,“product_cost”:0,“quantity”:1,“tax_name1”:“”,“tax_rate1”:0,“tax_name2”:“”,“tax_rate2”:0,“tax_name3”:“”,“tax_rate3”:0,“custom_value1”:“”,“custom_value2”:“”,“custom_value3”:“”,“custom_value4”:“”,“discount”:0,“tax_id”:“1”,“type_id”:“1”,“task_id”:“”,“expense_id”:“”,“createdAt”:1684001760207000,“net_cost”:0,“is_amount_discount”:false,“sort_id”:“0”,“line_total”:100,“gross_line_total”:100,“tax_amount”:0,“date”:“”,“unit_code”:“C62”}], ?, 0.000000, ?, 0.000000, ?, 0.000000, 0.000000, ?, ?, ?, ?, ?, 100.000000, 0, 0, 0.000000, 0.000000, 0.000000, 0.000000, 0, 0, 0, 0, 1, ?, 1, 64, 579, 0, 0, 4, ?, 2025-03-06, 2025-03-06 00:00:00, 2025-03-06 18:00:03.486401, 2025-03-06 18:00:03.486401))
[2025-03-06 18:00:03] production.INFO: Recurring invoice send duration 2025-03-06 06:00:03 - 2025-03-06 06:00:03
[2025-03-06 18:00:18] production.INFO: Failed to export company: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘u737112827_YnEEx.e_invoicing_tokens’ doesn’t exist (Connection: mysql, SQL: select * from e_invoicing_tokens)
[2025-03-06 18:01:01] production.INFO: Subscription Cron 2025-03-06 18:01:01
[2025-03-06 18:08:14] production.INFO: Using mailer => smtp 2025-03-06 18:08:14
[2025-03-06 18:08:15] production.INFO: Trying to send to [email protected] 2025-03-06 18:08:15
[2025-03-06 18:08:15] production.INFO: Using mailer => smtp

Screenshots

Logs

@hillel

I also tried to export the site and it just puts up an error message “Something is Wrong”.

My main concern is fixing whatever is preventing the recurring invoices from running and secondarily the export.

Hi,

What do you see if you run php artisan migrate

Is this for the Export issue or the Recurring Invoices issue? Which (or both) do I check afterwards?

This was in response to the errors above, it looks like a column is missing from your database.

@hillel

Here is the result.
APPLICATION IN PRODUCTION.

┌ Are you sure you want to run this command? ──────────────────┐
│ Yes │
└──────────────────────────────────────────────────────────────┘

INFO Running migrations.

2024_02_28_180250_add_steps_to_subscriptions … 5.18ms FAIL

In Connection.php line 825:

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘steps’
(Connection: mysql, SQL: alter table subscriptions add steps varchar(19

  1. null)

In Connection.php line 571:

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘steps’

@hillel

I checked and the STEPS column was as empty as all other columns, so I removed it and ran php artisan migrate again sand this time it appeared to work. See below. (you might want to test for this instead of simply failing)

INFO Running migrations.

2024_02_28_180250_add_steps_to_subscriptions … 61.02ms DONE
2024_03_24_200109_new_currencies_03_24 … 4.53ms DONE
2024_04_24_064301_optional_display_required_fields_payment_gateways 7.18ms DONE
2024_05_02_030103_2024_05_02_update_timezones … 42.01ms DONE
2024_05_03_145535_btcpay_gateway … 2.59ms DONE
2024_05_19_215103_2024_05_20_einvoice_columns … 49.06ms DONE
2024_05_26_210407_2024_05_28_kwd_precision … 1.21ms DONE
2024_06_02_083543_2024_06_01_add_einvoice_to_client_table … 8.92ms DONE
2024_06_04_123926_2024_06_04_fixes_for_btc_migration … 1.48ms DONE
2024_06_08_043343_2024_06_08__i_s_k_currency_precision … 40.78ms DONE
2024_06_11_231143_add_rotessa_gateway … 1.11ms DONE
2024_06_19_015127_2024_06_19_referral_meta_data … 11.98ms DONE
2024_06_23_040253_2024-06-23_indexesforinvoiceid_payment_hashes 19.67ms DONE
2024_07_10_043241_2024_07_10_invoice_id_index_on_projects_table 18.66ms DONE
2024_07_16_231556_2024_07_17_add_dubai_timezone … 1.32ms DONE
2024_07_29_235430_2024_30_07_tax_model_migration … 0.04ms DONE
2024_08_02_144614_alter_companies_quickbooks … 10.02ms DONE
2024_08_04_225558_tax_model_migration_v2 … 19.99ms DONE
2024_08_21_001832_add_einvoice_option_license … 26.43ms DONE
2024_08_26_055523_add_qb_product_hash … 11.29ms DONE
2024_08_27_230111_blockonomics_gateway … 1.01ms DONE
2024_09_06_042040_cba_powerboard … 6.08ms DONE
2024_09_15_022436_add_autonomous_es_regions … 19.99ms DONE
2024_09_16_221343_add_remaining_cycles_to_subscriptions … 4.89ms DONE
2024_09_21_062105_2024_09_21_add_vn_lang … 2.10ms DONE
2024_09_22_084749_2024_09_23_add_sync_column_for_qb … 9.91ms DONE
2024_10_03_235524_add_is_tax_exempt_vendors_table … 4.77ms DONE
2024_10_08_034355_add_account_e_invoice_quota … 3.40ms DONE
2024_10_09_220533_invoice_gateway_fee … 7.71ms DONE
2024_10_11_151650_create_e_invoice_tokens_table … 31.13ms DONE
2024_10_11_153311_add_e_invoicing_token … 2.91ms DONE
2024_10_14_214658_add_routing_id_to_vendors_table … 6.79ms DONE
2024_10_18_211558_updated_currencies … 15.25ms DONE
2024_11_11_043923_kill_switch_licenses_table … 4.49ms DONE
2024_11_19_020259_add_entity_set_to_licenses_table … 6.63ms DONE
2024_11_21_011625_add_e_invoicing_logs_table … 8.30ms DONE
2024_11_28_054808_add_referral_earning_column_to_users_table … 4.08ms DONE
2024_12_18_023826_2024_12_18_enforce_tax_data_model … 1.69ms DONE
2025_01_08_024611_2025_01_07_design_updates … 35.11ms DONE
2025_01_15_222249_2025_01_16_zim_currency_change … 12.81ms DONE
2025_01_18_012550_2025_01_16_wst_currency … 0.94ms DONE
2025_01_22_013047_2025_01_22_add_verification_setting_to_gocardless 18.50ms DONE
2025_02_12_000757_change_inr_currency_symbol … 1.02ms DONE
2025_02_12_035916_create_sync_column_for_payments … 3.82ms DONE
2025_02_16_213917_add_e_invoice_column_to_recurring_invoices_table 2.95ms DON

@david @hillel

I’m still not getting my recurring invoices to process. I even directly ran my script command:

'cd //home/u737112827/domains/woodalldesign.net/public_html/invoice/ && php artisan schedule:run ’

and it reported:

INFO No scheduled commands are ready to run.

Help!

BTW…the EXPORT works fine now. Still can’t get recurring invoices to run.

Any ideas on this? @david @hillel

What do you see now when you run php artisan migrate

@david @hillel

After I run it I see:

INFO Nothing to migrate.

Are there any related errors in storage/logs?

@hillel

None at all. The last errors were the ones I posted above and that was related to exports.

What’s the next send date for the recurring invoice?

@hillel

It’s February 28, 2025 07:00:00 PM

I suggest changing the start date to tomorrow to see if it sends

Ok. I’ve done this with two invoices. The rest I just updated to next month and cloned to invoices to send them immediately.

I’ve also got two recurring invoices with status stuck as PENDING.

@hillel

The two invoices I updated per your instructions still did not process. The other two invoices are also still marked PENDING instead of ACTIVE under Recurring Invoices.

Are there any errors in storage/logs?

Can you please post a screenshot of the health check dialog?