Upgrade from v4.5.19 to v4.5.20 breaks site (self-hosted)

Thank you @hillel that was the issue an unenclosed white space in the .env file.

Now running the command line:

cd /home/m564305/public_html/invoice && /opt/alt/php74/usr/bin/php -d register_argc_argv=On artisan schedule:run

Returns: No scheduled commands are ready to run.

The error has cleared on the dashboard. Things are looking good. A few more checks before I switch over to V5 permanently.

Thanks for your patience @hillel

Thatā€™s the correct result, is there a value for QUEUE_CONNECTION in the .env file?

It reads: QUEUE_CONNECTION=sync

Do you see any errors in the system logs, you can see it on the dashboard

No errors on dashboard System Logs

I still havenā€™t activated the company, should I do this?

Yes, that could be the issue

Hi @hillel my apologies for the delay. I activated the company and turned off V4, V5 is now my active dashboard however email is not working.

I discovered this first by trying a password reset which never arrived, I then noticed no invoices being sent so I created a new invoice and sent it to myself (I have myself setup as a client for testing purposes). Send email > History says Business emailed invoice 0093 to Customer Name (with timestamp)

Some things Iā€™ve tried:
Iā€™ve checked the database table jobs and thereā€™s nothing in there, Dashboard>System Logs show no error. I ran php artisan optimize in the directory via shell and it returned:

$ php artisan optimize
Configuration cache cleared!
Configuration cached successfully!
Route cache cleared!
Routes cached successfully!
Files cached successfully!

May I also add Iā€™m using the exact same email settings that worked in V4

Any advice please?

Thanks

Kieran

Have you seen the info here:

https://invoiceninja.github.io/docs/self-host-troubleshooting/#email-not-sending

Hi @hillel thanks, Iā€™ve tried everything via the link but still no luck with emails sending or password reset email.

Iā€™ve now completely botched it, Iā€™m blocked out from logging in, because I cant get email to send a reset password I tried setting a new password via phpMyAdmin in table users using MD5 encryption.

I turned on APP_DEBUG=true in the .env file but get the following errors when using Recover Password:

500: SQLSTATE[28000] [1045] Access denied for user ā€˜ninjaā€™@ā€˜localhostā€™ (using password: YES) (SQL: select count(*) as aggregate from users where email = adminemail@mydomain.com and users.deleted_at is null)

If I try Sign in with email I get the following error:

500: Trying to get property ā€˜idā€™ of non-object

Iā€™m feeling deflated at this stage, I havenā€™t been able to use a functioning Invoice Ninja for over 2 weeks now and its been affecting my business. I appreciate all the work and help you guys give on this forum and it must be difficult to manage all the requests, thank you for your time and patience up to now.

Do you offer premium support?

@david do you have any ideas?

1 Like

Tried an admin login today and got the following error:

TimeoutException after 0:00:30.000000: Future not completed

@kieranmccarthy

Are there any errors in the logs?

Hi @david,

Hereā€™s whats in todayā€™s storage/logs/laravel.log

[2021-07-21 07:58:37] production.ERROR: Trying to get property ā€˜idā€™ of non-object {ā€œexceptionā€:"[object] (ErrorException(code: 0): Trying to get property ā€˜idā€™ of non-object at /home/m564305/public_html/invoice/app/Jobs/Util/SystemLogger.php:58)
[stacktrace]
#0 /home/m564305/public_html/invoice/app/Jobs/Util/SystemLogger.php(58): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, ā€˜Trying to get pā€¦ā€™, ā€˜/home/m564305/pā€¦ā€™, 58, Array)
#1 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\Util\SystemLogger->handle()
#2 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#3 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#4 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#5 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Container/Container.php(614): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#6 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call(Array)
#7 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(App\Jobs\Util\SystemLogger))
#8 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(App\Jobs\Util\SystemLogger))
#9 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#10 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(120): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\Util\SystemLogger), false)
#11 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}(Object(App\Jobs\Util\SystemLogger))
#12 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(App\Jobs\Util\SystemLogger))
#13 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware(Object(Illuminate\Queue\Jobs\SyncJob), Object(App\Jobs\Util\SystemLogger))
#15 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\SyncJob), Array)
#16 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(43): Illuminate\Queue\Jobs\Job->fire()
#17 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(253): Illuminate\Queue\SyncQueue->push(Object(App\Jobs\Util\SystemLogger))
#18 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(229): Illuminate\Bus\Dispatcher->pushCommandToQueue(Object(Illuminate\Queue\SyncQueue), Object(App\Jobs\Util\SystemLogger))
#19 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(77): Illuminate\Bus\Dispatcher->dispatchToQueue(Object(App\Jobs\Util\SystemLogger))
#20 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Bus/PendingDispatch.php(202): Illuminate\Bus\Dispatcher->dispatch(Object(App\Jobs\Util\SystemLogger))
#21 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(17): Illuminate\Foundation\Bus\PendingDispatch->__destruct()
#22 /home/m564305/public_html/invoice/app/Http/Controllers/Auth/LoginController.php(252): App\Jobs\Util\SystemLogger::dispatch(ā€™{ā€œipā€:"84.203.1ā€¦ā€™, 5, 61, 801, NULL, Object(App\Models\Company))
#23 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Auth\LoginController->apiLogin(Object(Illuminate\Http\Request))
#24 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction(ā€˜apiLoginā€™, Array)
#25 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Auth\LoginController), ā€˜apiLoginā€™)
#26 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\Routing\Route->runController()
#27 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()
#28 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#29 /home/m564305/public_html/invoice/app/Http/Middleware/ApiSecretCheck.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\ApiSecretCheck->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /home/m564305/public_html/invoice/app/Http/Middleware/QueryLogging.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /home/m564305/public_html/invoice/app/Http/Middleware/SetEmailDb.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SetEmailDb->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
#39 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), ā€˜300ā€™, ā€˜1ā€™)
#40 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#42 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#43 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#44 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#45 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#46 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#47 /home/m564305/public_html/invoice/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#48 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Http\SetRequestIpMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#49 /home/m564305/public_html/invoice/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Http\SetRequestMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /home/m564305/public_html/invoice/app/Http/Middleware/Cors.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#52 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 /home/m564305/public_html/invoice/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#54 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#55 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#56 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#57 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#58 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#59 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#60 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#61 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#62 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#63 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#64 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#65 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#66 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#67 /home/m564305/public_html/invoice/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#68 /home/m564305/public_html/invoice/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#69 {main}
"}

I think something catastrophic has happened to your.

Laravel uses bcrypt() hashing. So setting a md5 on the password column of the db wonā€™t work.

Hi @david thanks for that information.

Unfortunately I cant hash a password in bcrypt using phpMyAdmin as its not an option.

I did try an online bcrypt generator and copied the hash to the users>password field in the database and saved, tried logging in and got the following: 500: Trying to get property ā€˜idā€™ of non-object

No further errors have been added to the laravel.log file

I guess Iā€™m bricked out!

Is there some way of fixing or creating a new user via phpMyAdmin?

Iā€™m really stuck, I cant go back to V4 as it doesnā€™t support PHP 7.3 and wont send recurring emails etc. so V5 was my only option to progress, seems Iā€™m stuck between a rock and a hard place.

Would a fresh re-installation help? Should I opt for the hosted version?

I really need to get up and running, Iā€™d appreciate your suggestions.

Thanks

Maybe you can use the log email option, use the recover password option in the UI and then get the link to set a new password from the logs.

Hi @hillel can you lead me to some documentation on how to do that please?

Another question is it possible to import my V5 data to a paid subscription of Ninja Invoice, if so its seems like the best option for me right now.

The process isnā€™t documented but if you have a specific question I can try to help.

You can use the JSON export to transfer your data.

Thanks @hillel what I want to know is how do I use the email log option to use the recover password option in the UI to get a link to set a new password.

The steps Iā€™ve tried are:

Go to my installation at: https://www.mydomain.com/invoice/public/index.php#/

Select ā€œRecover passwordā€ from the UI

Input my admin/user password click ā€œRecover Passwordā€ which throws this error:

500: SQLSTATE[28000] [1045] Access denied for user ā€˜ninjaā€™@ā€˜localhostā€™ (using password: YES) (SQL: select count(*) as aggregate from users where email = name@mydomain.com and users.deleted_at is null)

Check laravel.log but no new entries