V4 migration to V5

@david
We have now upgraded to the latest release (V5.0.31) but still same thing with migrations. Logs on v5 now appears to be something different but migration is not working yet

V5.0.31 Logs

[2020-11-30 11:14:48] production.INFO: reminder 1 subject
[2020-11-30 11:19:51] production.INFO: migrations/3hacmvotbe94aayr3jnwwut4gfoxhinn-2020-11-30-invoiceninja.zip

[2020-11-30 12:00:03] production.INFO: Sending recurring invoices 2020-11-30 12:00:02

ninja-31

We have even tried force migration option but no luck.

Are your queues running and/or have you setup the scheduler cron?

@david
Yes , we have below in our cron running every minute

          • cd /path-to-our-project && php artisan schedule:run >> /dev/null 2>&1

Can you try running

php artisan queue:restart

@david
Tried this as well and started migration and below are new logs for V5

[2020-12-01 10:55:39] production.INFO: Importing company
[2020-12-01 10:55:40] production.INFO: Importing users
[2020-12-01 10:55:40] production.INFO: Importing payment_terms
[2020-12-01 10:55:40] production.INFO: Importing tax_rates
[2020-12-01 10:55:40] production.INFO: Importing clients

But now when i try to login to V5 , it gives following error

NoSuchMethodError: method not found: ‘a’ on null

Hence unable to login

All right, that looks good, from the logs side.

@hillel, do you maybe know what could be wrong on Flutter side?

Can you try logging in with the mobile or desktop apps, it should provide a clearer error.

@hillel
Below is error when trying from mobile app

HandshakeException: Handshake error in client (OS Error): CERTIFICATE_VERIFY_FAILED:
Hostname mismatch (handshake.cc:354)

Thanks! Are you using a self signed certificate? Using Let’s Encrypt should fix it.

Note: I think these are two separate issues.

Okay, will try and let you know. thanks

@hillel and @david
I have installed letsencrypt and now error is change. I am getting the following error

@fayaz is this after migration?

Yes. I see the data in the database but get above error when trying to login to V5

As a test, are you able to comment out line 68 in app/Http/Controllers/BaseController.php

'company.users`

@david
I have tried above but still there is same error message

and this is what i see in my V4 logs which appears to be relevant with V5 error above

[2020-12-02 03:56:59] production.ERROR: ErrorException [0]
/app/Http/Controllers/Migration/StepsController.php [Line 216] => Undefined index: id {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Super Administrator”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36”,“locale”:“en”,“ip”:“39.44.230.28”,“count”:5,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“migration/companies”} []

@david and @hillel,
any updates please ? I see manually from the database that data is there now but i am unable to login and it shows same below error

@fayaz

This one is a real puzzle. I am not sure why that query is reading like that, it seems to be missing the id key.

could you try another thing for me, please change Line 90 of app\Models\CompanyUser.php to this please

return $this->hasMany(User::class, 'id', 'user_id');

@david
This one did not work too and I am now getting a different error as below