The new update crashed my installation (and yes I run php7)

Hi,

I ran the update script on pastebin, I don’t know if this is related to the script or the update but now I get :

« Whoops, looks like something went wrong. »

I tried :

/update
/?clear_cache=true

I have this in laravel-error.log:

[2017-12-13 15:33:41] production.ERROR: ***RuntimeException*** [0] : /home/facturation/bootstrap/cache/compiled.php [Line 13520] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":1,"is_console":"no","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:33:41] production.ERROR: ***RuntimeException*** [0] : /home/facturation/bootstrap/cache/compiled.php [Line 13520] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":2,"is_console":"no","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:01] production.ERROR: ***Symfony\Component\Debug\Exception\FatalThrowableError*** [0] : /home/facturation/app/Models/Traits/HasRecurrence.php [Line 43] => Class 'App\Models\Traits\Utils' not found {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"","ip":"127.0.0.1","count":1,"is_console":"yes","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:01] production.ERROR: ***Illuminate\Database\QueryException*** [42S22] : /home/facturation/vendor/laravel/framework/src/Illuminate/Database/Connection.php [Line 770] => SQLSTATE[42S22]: Column not found: 1054 Unknown column 'send_reminders' in 'where clause' (SQL: select * from invoices where invoice_type_id = 1 and exists (select * from clients where invoices.client_id = clients.id and send_reminders = 1) and account_id = 1 and balance > 0 and is_recurring = 0 and is_public = 1 and ((due_date = '2017-12-06' OR partial_due_date = '2017-12-06') OR (due_date = '2017-11-29' OR partial_due_date = '2017-11-29') OR (due_date = '2017-11-13' OR partial_due_date = '2017-11-13')) and invoices.deleted_at is null) {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"","ip":"127.0.0.1","count":1,"is_console":"yes","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:16] production.ERROR: ***RuntimeException*** [0] : /home/facturation/bootstrap/cache/compiled.php [Line 13520] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":1,"is_console":"no","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:16] production.ERROR: ***RuntimeException*** [0] : /home/facturation/bootstrap/cache/compiled.php [Line 13520] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":2,"is_console":"no","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:45] production.ERROR: ***RuntimeException*** [0] : /home/facturation/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 43] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":1,"is_console":"no","is_api":"no","db_server":"mysql"} [] [2017-12-13 15:35:45] production.ERROR: ***RuntimeException*** [0] : /home/facturation/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 43] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"https://facturation.quebecblogue.com","previous":"https://facturation.quebecblogue.com","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","ip":"207.96.205.5","count":2,"is_console":"no","is_api":"no","db_server":"mysql"} []

I tried to delete ‘bootstrap/cache/compiled.php’ but nothing.

Please help, I know nothing about Laravel.

Regards,

Same problem for me - updated via the update script automatically this morning. Log shows

[2017-12-13 15:58:50] production.ERROR: RuntimeException [0] : /var/www/ninja/bootstrap/cache/compiled.php [Line 13520] => The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

If I check my update script log, it looks OK - however version.txt is still showing v3.9.2

`Wed 13 Dec 03:00:03 GMT 2017 - Updating Invoice Ninja from v3.9.2 to v4.0.0.

Downloading Invoice Ninja v4.0.0 archive “https://download.invoiceninja.com/ninja-v4.0.0.zip” …

Extracting to temporary folder “/home/invoice/temp/InvoiceNinja” …

Syncing to install folder “/var/www/ninja” …

Number of files: 32,940 (reg: 28,437, dir: 4,503)
Number of created files: 1,829 (reg: 1,589, dir: 240)
Number of deleted files: 0
Number of regular files transferred: 15,017
Total file size: 414,746,153 bytes
Total transferred file size: 212,168,739 bytes
Literal data: 212,168,739 bytes
Matched data: 0 bytes
File list size: 655,247
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 213,672,560
Total bytes received: 297,433

sent 213,672,560 bytes received 297,433 bytes 1,403,081.92 bytes/sec
total size is 414,746,153 speedup is 1.94

Resetting permissions for “/var/www/ninja/storage” …

Removing downloaded ZIP file “/home/invoice/temp/InvoiceNinja/ninja-v4.0.0.zip” …

Removing temporary folder “/home/invoice/temp/InvoiceNinja” …

Running update migration commands (https://URL/update)…’

PHP version is:

PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )

Urgently need this working - fix would be appreciated ASAP.

Many thanks

Try that my friend. I fixed it.

cd /home/your-ninja-folder
cp .env.example .env
php artisan config:clear

Regards

That worked - however I lost my email settings and has to generate a new app key with php artisan ninja:update-key

Strangely, whenever I try to enter my email settings again, after clicking save it says ‘successfully saved’ however all the fields are still blank.

If I check the .env my email settings are all visible, however sending emails fails…

I get Address in mailbox given [] does not comply with RFC 2822, 3.6.2 - this is using the exact same email settings as before…

Why are the email settings fields blank, yet the .env appears to update?..

In v4.0 we upgraded to Laravel v5.3 which removed support for Mcrypt.

I wouldn’t suggest running cp .env.example .env as it will erase all of your config settings.

Try running php artisan ninja:update-key --legacy=true

Note: you may want to first backup your database and .env file.

I had to restore from backup… Now that’s what I have.

Wed, 13 Dec 2017 18:13:02 +0000 Running UpdateKey…

[Illuminate\Contracts\Encryption\DecryptException]
The MAC is invalid.

I get Wed, 13 Dec 2017 18:21:40 +0000 Running UpdateKey…
Wed, 13 Dec 2017 18:21:40 +0000 Error: app key and cipher are not set

And my .env shows

APP_KEY=?6g3’j75j|TRd0H|’^nF`|2:"FW?qNAV
APP_CIPHER=AES-256-CBC

No idea why it thinks they aren’t set…

I’m tempted to rollback to 3.9.2 - far too many issues so far with this update

Maybe you can create your own thread to bitch.

If you want to email a backup of your database and the original APP_KEY and APP_CIPHER values to contact@invoiceninja.com I’ll try to replicate the problem. Please also let me know which version of PHP you’re using as it may be related.

If you comment out the APP_KEY and APP_CIPHER values in the .env file you should be able to login however the app won’t be able to decrypt the payment gateway and bank account configs.

Thanks Hillel.

I sent it.

Let me know if you miss something.

Same thing for me,

I did try running php artisan ninja:update-key --legacy=true with succesful message about the cipher in the .env file.

I did try to comment out the APPs params.

Still got the Whoops, looks like something went wrong. error message.

Should I revert back to 3.9 ?

Thanks for your support

If you’re seeing this problem please post:

  • Your value for APP_CIPHER in the .env file
  • The version of PHP you’re using

Hi,

APP_CIPHER=rijndael-128
PHP 7.0.26

I replaced the APP_CIPHER=rijndael-128 to APP_CIPHER=AES-256-CBC

I can now reach the login page but it won’t validate the 2FA. I get the Whoops message

Thanks for your support

@quebecblogue

Thanks for sending your data but I’m having trouble replicating the problem, here are the steps I followed:

  • Imported your database
  • Set the APP_KEY and APP_CIPHER in the .env file to your values
  • Ran: php artisan ninja:update-key --legacy=true
  • Changed the APP_CIPHER to AES-256-CBC

@yuljk

I noticed your APP_KEY contains quotation marks, it may be why you’re seeing “Error: app key and cipher are not set”

@alexgauvin

I think the problem is the ‘update-key’ command isn’t updating the encrypted 2FA secret. We’ll make sure to correct this in our next release, until then you’ll need to clear the google_2fa_secret value in the users table and then re-enable 2FA.

Thanks Hillel,

Where should I find this table ? No Users table in my DB. A quick search for google_2fa_secret in the MySQL DB returns nothing.

Can you check again, there should be a users table.

Pfff,

Sorry, it’s early in the morning here, and my coffee is not yet ready.

Ok, found it, cleared the secret key and I’m good to go. Thanks