Oops, something went wrong! During V5 upgrade

HI Guys,
Need some help. I am trying to migrate to V5 on self hosted server and hitting this issue:
While checking the logs.
[2021-09-29 06:18:41] production.INFO: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 7.4.0”. [] []
[2021-09-29 06:23:32] production.ERROR: ErrorException [0] : /home//public_html/invoices/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) {“context”:“PHP”,“user_id”:1,“account_id”:“1”,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36”,“locale”:“en”,“ip”:"****",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/auth”} []

But if I change the PHP to 7.4 then I am facing Whoops! Something went wrong. error.

Please help me.

Hi,

v5 requires PHP >= 7.4, what error do you see using 7.4?

HI Hillel,

If I go to V4 to migerate while php is 7.4 then I get Whoops, looks like something went wrong.
https://mydigitalsolutions.com.au/invoices/public/login
I am currently keeping it in php 7.4 for you
In laravel error.log :

[2021-09-29 08:07:29] production.ERROR: ErrorException [0] : /home/mydig100/public_html/invoices/app/Models/Account.php [Line 1126] => Unparenthesized a ? b : c ?: d is deprecated. Use either (a ? b : c) ?: d or a ? b : (c ?: d) (View: /home//public_html/invoices/resources/views/auth/login.blade.php) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“HEAD”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15”,“locale”:“en”,“ip”:"*",“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“login”} []

You currently need to use different versions of PHP for v4 and v5.

We’re looking into adding support for PHP 7.4 to v4.

1 Like

Oh that means I can not migrate if the both versions are on the same server ?

You’d need to be able to set different PHP versions for the two apps if using one server.

Thanks a lot for your help. I am able to get different versions of php under subdomain by adding the following code in .htaccess file. Hopefully, Helpful for some one:

<FilesMatch “.(php4|php5|php3|php2|php|phtml)$”>
SetHandler application/x-lsphp

Now, Migration process was initiated from last 20 minutes and I am waiting for a confirmation email as mention in the message from V4 portal.

It should take that long, you may need to logout and back into v5 to see the new company. There’s a company selector in the top left corner.

1 Like

Really Appreciate your help. Seems like I am getting somewhere. Now After the migration I can see the company in V5. Couple of issue I am facing here are:

  1. There is a red flag in the V5 saying cronjobs needs to be enabled. I have checked the jobs table and it is empty. I have checked the cron job has been created by softaculous.

  2. I tried to send an invoice (to myself using different email) and system says the invoice is queued successfully. It use to send the invoice straightaway in the old versions. - Just saw under Invoice activity, it says Address in mailbox given[] does not comply with RFC 2822,3.6.2.

Regards
Sachin

HI,

  1. It can take up to 24 hours for message to be cleared.

  2. Are all of the email credentials in the .env file filled in and does the client have any email address?

I will update the details for email client based on V4.

Great! Now I am getting

500: There was an error generating the PDF with Phantom JS

Are there any details about the error in storage/logs/

2021-09-30 05:16:36] production.ERROR: There was an error generating the PDF with Phantom JS {“exception”:"[object] (App\Exceptions\PhantomPDFFailure(code: 0): There was an error generating the PDF with Phantom JS at /home/***/app/Utils/PhantomJS/Phantom.php:135)

Have you seen the info here:

https://invoiceninja.github.io/docs/self-host-troubleshooting/#pdf-conversion-issues

1 Like

Hi Hillel,

Thank you so much for continues support.

After putting the following code and a little wait. PDF is back.
NINJA_HOSTED_PDF=true
PHANTOMJS_PDF_GENERATION=false

  1. It can take up to 24 hours for message to be cleared. - What are these messages are for ? and why I can not send the invoice straightaway anymore ?

2> Are all of the email credentials in the .env file filled in and does the client have any email address? Yes I am using an email address which is correct and working fine in V4; I have also added email credentials in .env file according to the docs.

  1. The message is to confirm the cron is enabled. Not sure I understand, v5 supports sending emails on demand?

  2. Maybe you need to run php atisan optimize after changing the .env file

My Hosting provider has executed the “php artisan optimize” which has fixed the sending email issue.
Seems like I have come too close to fully functional app :slight_smile:

The only thing I left with is red error about cron jobs. I have checked the docs and I am sure that I have the following command in cron jobs:
cd /home/***/invoices && /opt/alt/php74/usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
but still that error is there.

It can currently take up to 24 hours for the message to go away, we’re working to improve this.

Still no luck. Red Mark is still there