Error 500 after update v5.5.33 to v5.5.40

Hello,

I have problem after update from v5.5.33 to v5.5.40

[billing@saad logs]$ tail -f access_log
114.124.208.177 - - [17/Nov/2022:13:06:56 +0700] “GET / HTTP/1.1” 500 5469 “https://[domain]/flutter_service_worker.js?v=5.5.33” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15”
114.124.208.177 - - [17/Nov/2022:13:06:58 +0700] “GET /flutter_service_worker.js?v=5.5.33 HTTP/1.1” 200 9580 “” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15”

[billing@saad logs]$ tail -f laravel.log
[2022-11-13 00:00:06] production.INFO: updating currencies
[2022-11-13 06:00:02] production.INFO: Performing Autobilling 2022-11-13 06:00:02
[2022-11-14 00:00:04] production.INFO: updating currencies
[2022-11-14 06:00:02] production.INFO: Performing Autobilling 2022-11-14 06:00:02
[2022-11-15 00:00:04] production.INFO: updating currencies
[2022-11-15 06:00:02] production.INFO: Performing Autobilling 2022-11-15 06:00:02
[2022-11-16 00:00:04] production.INFO: updating currencies
[2022-11-16 06:00:02] production.INFO: Performing Autobilling 2022-11-16 06:00:02
[2022-11-17 00:00:04] production.INFO: updating currencies
[2022-11-17 06:00:02] production.INFO: Performing Autobilling 2022-11-17 06:00:02

[billing@saad logs]$ tail -f invoiceninja.log
[2022-11-17 06:00:02] production.INFO: 0 partial invoices to auto bill
[2022-11-17 06:00:02] production.INFO: 0 full invoices to auto bill
[2022-11-17 06:00:03] production.INFO: Sending invoice reminders 2022-11-17 06:00:03

after update I run this command:
php artisan optimize
php artisan migrate

composer install -o --no-dev
88 packages you are using are looking for funding.
Use the composer fund command to find out more!

Please Help, Thank you

Hi,

Can you please check for details about the error in storage/logs

Not Found error

[billing@saad logs]$ tail -f laravel.log
[2022-11-13 00:00:06] production.INFO: updating currencies
[2022-11-13 06:00:02] production.INFO: Performing Autobilling 2022-11-13 06:00:02
[2022-11-14 00:00:04] production.INFO: updating currencies
[2022-11-14 06:00:02] production.INFO: Performing Autobilling 2022-11-14 06:00:02
[2022-11-15 00:00:04] production.INFO: updating currencies
[2022-11-15 06:00:02] production.INFO: Performing Autobilling 2022-11-15 06:00:02
[2022-11-16 00:00:04] production.INFO: updating currencies
[2022-11-16 06:00:02] production.INFO: Performing Autobilling 2022-11-16 06:00:02
[2022-11-17 00:00:04] production.INFO: updating currencies
[2022-11-17 06:00:02] production.INFO: Performing Autobilling 2022-11-17 06:00:02

[billing@saad logs]$ tail -f invoiceninja.log
[2022-11-17 06:00:02] production.INFO: 0 partial invoices to auto bill
[2022-11-17 06:00:02] production.INFO: 0 full invoices to auto bill
[2022-11-17 06:00:03] production.INFO: Sending invoice reminders 2022-11-17 06:00:03

@david any thoughts?

I’m not seeing any errors here, you may need to try running

/update?secret=secret

or

php artisan migrate

[billing@saad public_html]$ php artisan migrate

                                       APPLICATION IN PRODUCTION.                                           

Do you really wish to run this command? (yes/no) [no]
❯ yes

INFO Nothing to migrate.

Still error 500

First running php artisan migrate

[billing@saad public_html]$ php artisan migrate

                                       APPLICATION IN PRODUCTION.                                           

Do you really wish to run this command? (yes/no) [no]
❯ yes

INFO Running migrations.

2022_11_02_063742_add_verified_number_flag_to_users_table … 11ms DONE
2022_11_04_013539_disabled_upstream_bank_integrations_table … 5ms DONE
2022_11_06_215526_drop_html_backups_column_from_backups_table … 59ms DONE

Not sure this, you may want to turn on debug in the .env file and get the actual error message back to us.

Hi @david @hillel @saad

Could this be the reason?
When the installation is on a subdomain like business.example.com it is neccessary to adjust the .htaccess-Files after the update. I have had also this Error 500 and fixed it with that…

Greets

@checkitsedo

What was the fix you made?

Here I described my update routine incl. fixing .htaccess-Files for working with subdomains…

Cannot update system because pdf is not writable - Self-Hosted | v5 - Discourse (invoiceninja.com)

.htaccess

<IfModule mod_rewrite.c>
  # Redirect HTTP to HTTPS:
  RewriteCond %{ENV:HTTPS} !=on
  RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  
  # Make InvoiceNinja work in subdomains:
  RewriteBase /
  RewriteRule ^(.*)$ public/$1 [L]
  
  RewriteRule "^.env" - [F,L]
#  RewriteRule "^storage" - [F,L]
  RewriteRule ^(.well-known)($|/) - [L]
  
  RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

public/.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On
	
	# Make InvoiceNinja work with subdomains:
	# If you want to access InvoiceNinja via a subdomain and
	# this rule is missing the browser will see a `500 internal server error`.
	RewriteBase /

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
1 Like

@checkitsedo

I check file .htacces not change after update

I get error this

SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION billing.json_unquote does not exist (SQL: select json_unquote(json_extract(settings, ‘$.“currency_id”’)) as id from clients)

Most likely you are running a version of MySQL that is under 5.7

You’ll want to update your db to at least 5.7, but even this is EOL October 2023, so ideally you would want to move to MySQL 8