Can't update and script won't restore either from Sofaculous Backup

I love Invoice Ninja but it’s really become a serious thorn in my a$$! Every time I turn around there’s an error… the latest one comes with restoring from a v3.8.1 backup after getting a white screen at login. Tried four other times with earlier backups to restore the app… still a go no. We’re a paid (white label) supporter, too.

Here is what my host has sent to me:

Hi,

While checking the website https://tinyhousechattanooga.com/inv I could see that the following errors from the error log.

#0 /home/thc/public_html/inv/bootstrap/cache/compiled.php(1479): ReflectionClass->__construct(‘LaravelCrawlerD…’)
#1 /home/thc/public_html/inv/bootstrap/cache/compiled.php(1433): Illuminate\Container\Container->build(‘LaravelCrawlerD…’, Array)
#2 /home/thc/public_html/inv/bootstrap/cache/compiled.php(2011): Illuminate\Container\Container->make(‘LaravelCrawlerD…’, Array)
#3 /home/thc/public_html/inv/bootstrap/cache/compiled.php(1686): Illuminate\Foundation\Application->make(‘LaravelCrawlerD…’)
#4 /home/thc/public_html/inv/bootstrap/cache/compiled.php(6444): Illuminate\Container\Container->offsetGet(‘LaravelCrawlerD…’)
#5 /home/thc/public_html/inv/bootstrap/cache/compiled.php(6430): Illuminate\Support\Facades\Facade::resolveFacadeInstance(‘LaravelCrawlerD…’)
#6 /home/thc/public_html/inv/bootstrap/cache/compiled.php(6464): Illuminate\Support\Facades\Facad in /home/thc/public_html/inv/bootstrap/cache/compiled.php on line 1479

SO, please contact your developer and check the files to fix the issue.

Best Regards,

Ajith P. || Support Staff

Have any further questions? Please let us know!
Feel free to follow us on Twitter: @ShockHosting


Ticket ID: #146854

Please provide resolution at least so I can get the installation back and ultimately a path so I can freaking upgrade this script (as I do with everything else I run on our website!!!) with Softaculous.

Are there any errors in storage/logs/laravel-error.log when you try to update?

Hello. Yes, there are. Here is the log:

[2017-09-20 00:04:24] production.ERROR: Illuminate\Database\QueryException [42000] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 729] => SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for ‘qty’ (SQL: ALTER TABLE products CHANGE cost cost NUMERIC(15, 4) NOT NULL, CHANGE qty qty NUMERIC(15, 4) DEFAULT ‘NULL’) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/update",“previous”:“https://tinyhousechattanooga.com/inv/public”,“user_agent”:“Softaculous”,“ip”:“208.123.117.2”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:"mysql”} []
[2017-11-10 19:51:20] production.ERROR: Symfony\Component\Process\Exception\RuntimeException [0] : /home/thc/public_html/inv/vendor/symfony/process/Process.php [Line 144] => The Process class relies on proc_open, which is not available on your PHP installation. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/update",“previous”:“https://tinyhousechattanooga.com/inv/public”,“user_agent”:“Softaculous”,“ip”:“208.123.117.2”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:"mysql”} []

Try restoring the database backup, applying this change then loading /update

https://github.com/invoiceninja/invoiceninja/commit/ac7f8df10b609a71d70422f2d6ffd35ff2a986eb

Where do I put that code? Do you realize that’s 3.7.1 not 3.8.1 which is what I’m running?

You need to apply the changes in database/migrations/2017_08_14_085334_increase_precision.php

It looks like the error is the same one mentioned in this issue:

https://github.com/invoiceninja/invoiceninja/issues/1672

Where exactly is the update file? I don’t see it in public or in the root directory. See screenshot:

404 Error

I’m not sure, the 404 is from the server not the app. Do other pages in the app work? If you have command line access you can use the steps here. Note: ‘update’ isn’t a file, it’s a web route.

http://docs.invoiceninja.com/en/latest/update.html

So, nothing works. Remember, I have a blank, white page… I know the 404 is from the server side but it has to make a call from somewhere in the app, right? So, where does it make that call? From the root directory or the public or maybe else where?

There are two types of server 404’s: the webserver and the app. The screenshot appears to be a web server 404, not an app 404.

I’d suggest restoring the database backup, making the change listed above and then trying to update from the command line.

I’m on a shared hosting package. I have no access to command line tools. Further, Is there a reason why you guys haven’t pushed a fix through to Softaculous? I STILL cannot update to 4.1.4 and am stuck at a “Whoops, looks like something went wrong.” screen when attempting to log in. My data is held hostage and I desperately need it.

v4.1.4 has been released by Softaculous.

Can you check for details about the error in storage/logs/laravel-error.log

Rereading the thread I don’t think you’ll be able to update the app without enabling proc_open

Yes, I know. I tried to update to it! Yet, it still doesn’t fix the updating problems via Softaculous. As a result, here is the error log you requested:

[2017-09-20 00:04:24] production.ERROR: Illuminate\Database\QueryException [42000] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 729] => SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for ‘qty’ (SQL: ALTER TABLE products CHANGE cost cost NUMERIC(15, 4) NOT NULL, CHANGE qty qty NUMERIC(15, 4) DEFAULT ‘NULL’) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/update",“previous”:“https://tinyhousechattanooga.com/inv/public”,“user_agent”:“Softaculous”,“ip”:“208.123.117.2”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:"mysql”} []
[2017-11-10 19:51:20] production.ERROR: Symfony\Component\Process\Exception\RuntimeException [0] : /home/thc/public_html/inv/vendor/symfony/process/Process.php [Line 144] => The Process class relies on proc_open, which is not available on your PHP installation. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/update",“previous”:“https://tinyhousechattanooga.com/inv/public”,“user_agent”:“Softaculous”,“ip”:“208.123.117.2”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:"mysql”} []
[2018-02-06 15:27:07] production.ERROR: Illuminate\Database\QueryException [42000] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for ‘qty’ (SQL: ALTER TABLE products CHANGE cost cost NUMERIC(15, 4) NOT NULL, CHANGE qty qty NUMERIC(15, 4) DEFAULT ‘NULL’) {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/update",“previous”:“https://tinyhousechattanooga.com/inv/public”,“user_agent”:“Softaculous”,“ip”:“208.123.117.2”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:"mysql”} []
[2018-02-06 15:27:44] production.ERROR: Illuminate\Database\QueryException [42S22] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘invoices.partial_due_date’ in ‘field list’ (SQL: select coalesce(invoices.partial_due_date, invoices.due_date) due_date, invoices.balance, invoices.public_id, invoices.invoice_number, clients.name as client_name, contacts.email, contacts.first_name, contacts.last_name, clients.currency_id, clients.public_id as client_public_id, clients.user_id as client_user_id, invoice_type_id from invoices left join clients on clients.id = invoices.client_id left join contacts on contacts.client_id = clients.id where invoices.account_id = 1 and clients.deleted_at is null and contacts.deleted_at is null and invoices.is_recurring = 0 and invoices.quote_invoice_id is null and invoices.balance > 0 and invoices.is_deleted = 0 and invoices.deleted_at is null and invoices.is_public = 1 and contacts.is_primary = 1 and coalesce(invoices.partial_due_date, invoices.due_date) < 2018-02-06 order by invoices.due_date asc limit 50) {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Kelley Chambers”,“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/dashboard",“previous”:“https://tinyhousechattanooga.com/inv/public/login”,“user_agent”:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6”,“ip”:“23.118.133.236”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”} []
[2018-02-06 15:27:55] production.ERROR: Illuminate\Database\QueryException [42S22] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘invoices.partial_due_date’ in ‘field list’ (SQL: select coalesce(invoices.partial_due_date, invoices.due_date) due_date, invoices.balance, invoices.public_id, invoices.invoice_number, clients.name as client_name, contacts.email, contacts.first_name, contacts.last_name, clients.currency_id, clients.public_id as client_public_id, clients.user_id as client_user_id, invoice_type_id from invoices left join clients on clients.id = invoices.client_id left join contacts on contacts.client_id = clients.id where invoices.account_id = 1 and clients.deleted_at is null and contacts.deleted_at is null and invoices.is_recurring = 0 and invoices.quote_invoice_id is null and invoices.balance > 0 and invoices.is_deleted = 0 and invoices.deleted_at is null and invoices.is_public = 1 and contacts.is_primary = 1 and coalesce(invoices.partial_due_date, invoices.due_date) < 2018-02-06 order by invoices.due_date asc limit 50) {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Kelley Chambers”,“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/dashboard",“previous”:“https://tinyhousechattanooga.com:2083/cpsess4489697603/frontend/paper_lantern/softaculous/index.live.php?act=upgrade&insid=491_61979”,“user_agent”:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6”,“ip”:“23.118.133.236”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”} []

Did you apply the changes listed above before updating?

Hillel, I cannot do so as I do not have command line access. Hence, the reason I, and many other people, need the a hotfix to be released through Softaculous.

I realized the file you asked me to update in the beginning, didn’t require command line access. Thus, I have applied the fix and still receiving the same error. Here’s the log snippet:

[2018-02-06 18:20:12] production.ERROR: Illuminate\Database\QueryException [42S22] : /home/thc/public_html/inv/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘invoices.partial_due_date’ in ‘field list’ (SQL: select coalesce(invoices.partial_due_date, invoices.due_date) due_date, invoices.balance, invoices.public_id, invoices.invoice_number, clients.name as client_name, contacts.email, contacts.first_name, contacts.last_name, clients.currency_id, clients.public_id as client_public_id, clients.user_id as client_user_id, invoice_type_id from invoices left join clients on clients.id = invoices.client_id left join contacts on contacts.client_id = clients.id where invoices.account_id = 1 and clients.deleted_at is null and contacts.deleted_at is null and invoices.is_recurring = 0 and invoices.quote_invoice_id is null and invoices.balance > 0 and invoices.is_deleted = 0 and invoices.deleted_at is null and invoices.is_public = 1 and contacts.is_primary = 1 and coalesce(invoices.partial_due_date, invoices.due_date) < 2018-02-06 order by invoices.due_date asc limit 50) {“context”:“PHP”,“user_id”:1,“account_id”:1,“user_name”:“Kelley Chambers”,“method”:“GET”,“url”:“https://tinyhousechattanooga.com/inv/public/dashboard",“previous”:“https://tinyhousechattanooga.com/inv/public/login”,“user_agent”:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6”,“ip”:“23.118.133.236”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”} []

What do you see when you load /inv/public/update

Have you enabled proc_open

I get another error: Parse error: syntax error, unexpected ‘public’ (T_PUBLIC)

I’m checking with my host right now to find out about “enabling proc_open”.

Are there more details to the error, a file name or line number?