Migration 500 error

How to I fix this issue with the migration on the same server?

tail -f logs/laravel.log
[2022-02-23 15:39:03] production.INFO: Importing company_gateways
[2022-02-23 15:39:03] production.INFO: Importing client_gateway_tokens
[2022-02-23 15:39:03] production.INFO: Importing vendors
[2022-02-23 15:39:04] production.INFO: Importing projects
[2022-02-23 15:39:04] production.INFO: Importing products
[2022-02-23 15:39:04] production.INFO: Importing credits
[2022-02-23 15:39:04] production.INFO: Importing recurring_invoices
[2022-02-23 15:39:10] production.INFO: Importing invoices
[2022-02-23 15:39:52] production.INFO: Importing quotes
[2022-02-23 15:39:52] production.INFO: Importing payments
[2022-02-23 15:40:06] production.INFO: Importing expense_categories
[2022-02-23 15:40:06] production.INFO: Importing task_statuses
[2022-02-23 15:40:06] production.INFO: in task statuses
[2022-02-23 15:40:06] production.INFO: finished task statuses
[2022-02-23 15:40:06] production.INFO: Importing expenses
[2022-02-23 15:40:07] production.INFO: Importing recurring_expenses
[2022-02-23 15:40:07] production.INFO: Importing tasks
[2022-02-23 15:40:07] production.INFO: Importing documents
[2022-02-23 15:40:10] production.ERROR: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8392704 bytes) {“userId”:2,“exception”:"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Allowed memory size of 134217728 bytes exhausted (tried to allocate 8392704 bytes)

Hi,

It should help to increase the PHP memory limit in the php.ini file

I have a total of 2gb on the server and did increase it I will try again

Note: the error isn’t from how much memory the server has, it’s from how much memory the PHP script is allowed to access

134217728 = 128 * 1024 * 1024 = 128M

> egrep memory_limit /etc/php/*/*/php.ini
/etc/php/7.4/apache2/php.ini:memory_limit = 128M
/etc/php/7.4/cli/php.ini:memory_limit = -1
/etc/php/7.4/fpm/php.ini:memory_limit = 128M
>

If you have set up IN on Ubuntu with nginx and fpm, you probably want to edit /etc/php/7.4/fpm/php.ini (may vary, depending on your php version, in my case 7.4), find memory_limit and change to maybe 256M. Remember to restart fpm or just reboot afterwards. fpm is a separate daemon, so restarting nginx ain’t enough.

1 Like