Error 500 migrating from v4 to v5

I am the webhost. Both servers are configured from scratch, on prem.

phpinfo lists /etc/php/8.2/fpm/php.ini as the loaded config file. I have set the memory limit there to 1024M. info page still reports 128M. I did restart nginx. Might revert to a prior snapshot of the VM and start over from a point.

How do I confirm the cron(s) are working on each vm?

Thanks -

@david do you have any thoughts?

In v5 you’ll see an error in the app if the crons aren’t enabled.

Yes - and the crons are different from setting up the queue, right? I still see an item about the queue in health check, but the cron warning is gone - which should mean it’s enabled and working?

I will snapshot both VMs, enable crons on the v4 machine and attempt a migration. Worst case, I can always revert back to the VM states before.

Correct. if the cron warning is gone it means the cron is running.

Just to note, PHP8.2 has not been tested with v5.5.x

OK… so what version of PHP should I be using exactly? I believe hillel told me 8.1 was required.
Here’s the post:

But 8.2 is untested? So that means for the latest version - v5.5.49 - I should be using precisely PHP 8.1, and 8.1 only?
it would be great to have a list of all the PHP extensions it requires also, preferably in an apt install command format : )
Since I’ll be rebuilding the VM anyway, it would be fantastic to have the full system requirements actually… How much RAM? How many CPUs? Any other details I should know?
Thanks : )

v4 requires PHP 7.4
v5 requires PHP 8.1

The required PHP extensions are listed here:

OK… I rebuilt the VM from a prior point. When I did the initial ninja configuration, it took me to error 500 after the initial setup.
re-ran permissions on the web folders and was able to load the login screen
but once I’m in there, it prompts me to configure the company name and details (Welcome to InvoiceNinja prompt).
However, it is not offering valid choices for language and currency… English and USD is not available.
I could choose Arabic, Bulgarian, Estonian, Hebre, Latvian, Persian, Russian, Serbian and Slovak…
The currency list is similarly bizarre…
Ideas?

It may help to clear the cache by loading /update?secret=

how exactly do I do this?
/update?secret=
after the ninja URL in a browser?

another issue I am having - still - is that php memory_limit is not budging.
the reported ini file is /etc/php/8.1/cli/php.ini
in that file, the default defined limit was -1, which should mean no memory limit.
when I change it to 1024M, it does not change in the output of phpinfo()

so it looks like until I can figure out where this memory limit is set, I won’t get very far anyway…
this is an ubuntu server 20.04 LTS, set up from scratch with php8.1…

nm on php - the correct ini file was in /etc/php/8.1/fpm/php.ini because I am using nginx
for anyone else experiencing the same problem,
php -i
reports a different path than phpinfo()

finally getting back to this…
so - it appears the connection between the two servers (v4 and v5) is established, so a migration could happen but snags somewhere.

here’s the laravel log (part of it anyway) from the v5 instance, that appears to pertain to migration)


[2023-01-02 21:53:34] production.INFO: Importing account
[2023-01-02 21:53:34] production.INFO: Importing company
[2023-01-02 21:53:35] production.INFO: Importing users
[2023-01-02 21:53:36] production.INFO: Importing payment_terms
[2023-01-02 21:53:36] production.INFO: Importing tax_rates
[2023-01-02 21:53:36] production.INFO: Importing clients
[2023-01-02 21:54:23] production.INFO: Importing company_gateways
[2023-01-02 21:54:23] production.INFO: Importing client_gateway_tokens
[2023-01-02 21:54:23] production.INFO: Importing vendors
[2023-01-02 21:54:33] production.INFO: Importing projects
[2023-01-02 21:54:37] production.INFO: Importing products
[2023-01-02 21:54:37] production.INFO: Importing credits
[2023-01-02 21:54:37] production.INFO: An email must have a "From" or a "Sender" header.
[2023-01-02 21:54:37] production.ERROR: An email must have a "From" or a "Sender" header. {"userId":1,"exception":"[object] (Symfony\\Component\\Mime\\Exception\\LogicException(code: 0): An email must ha>
[stacktrace]

@david do you have any ideas?

Can you ensure you have your mail server configured on v5, (it is complaining about no FROM_NAME / FROM_EMAIL) or just set the .env var

MAIL_MAILER=log

then

php artisan optimize

It looks like the failure is from the system unable to send the migration failed email to you.

how do I set up and test email from the GUI in v5? I checked the .env file, and it was already set to log.
but might as well get it emailing properly. I set up the vars in the env file, but I don’t see where those same parameters would be set in the GUI… or how to test.
v4 had a section where all the email server stuff could be set - in Advanced Settings - System Settings - Email settings.
my v5 has an Email Settings section, but no place to enter server details.
Provider choices are Default, Postmark and Mailgun. How do I get the settings to show up?
Or failing that, how do I send a test email to see if it works with the parameters I put into the env file?

OK - despite no luck on the email thing, I attempted another migration today. And it succeeded! (I ended up just tailing the laravel log on the v5 machine)

I was able to get snappdf running on the machine and am happily generating those PDFs.

now - how do I get email working? I don’t actually want the machine to email anyone anything for now - but I do still want to know how to get it working in case I ever decide to make use of that feature.

@rhd_mantsa

You should only need to configure the mail server in your .env file:

If you prefer to use PostMark, or Mailgun, you can enter your API information in Settings > Email Settings

how do I test the settings? and/or see errors?
ah - nm re logs - I see it’s referenced in the article.
how do I send a test message>

Once you’ve configured the settings and refreshed the cache, try sending an email.

Then check either the activity tab on the dashboard, or the system logs.

If any errors are encountered they should be filled there, or if nothing, check storage/logs/laravel.log