Cannot update system because pdf is not writable

Thanks Hillel!

I manually copied over v5.7.0 (zip), I’m getting blank white page when I go to URL, log shows this error now:

[Mon Aug 21 13:42:15.096751 2023] [proxy_fcgi:error] [pid 1420446:tid 140540148803328] [remote 98.63.16.68:59631] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php:889\nStack trace:\n#0 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(889): ReflectionClass->__construct()\n#1 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(770): Illuminate\Container\Container->build()\n#2 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(856): Illuminate\Container\Container->resolve()\n#3 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(706): Illuminate\Foundation\Application->resolve()\n#4 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->make()\n#5 /var/www/clients…; PHP message: PHP Fatal error: Uncaught ReflectionException: Class “view” does not exist in /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php:889\nStack trace:\n#0 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(889): ReflectionClass->__construct()\n#1 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(770): Illuminate\Container\Container->build()\n#2 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(856): Illuminate\Container\Container->resolve()\n#3 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(706): Illuminate\Foundation\Application->resolve()\n#4 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(841): Illuminate\Container\Container->make()\n#5 /var/www/clients…’

Can you try running php artisan optimize

When I run “php artisan optimize” via command prompt I get:

Composer detected issues in your platform:

Your Composer dependencies require a PHP version “>= 8.1.2”. You are running 7.4.33.

PHP Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.1.2”. You are running 7.4.33. in /var/www/clients/client1/web1/web/billing/vendor/composer/platform_check.php on line 24

My server runs Debian 11 which ships with php 7.4 as default. They don’t recommend changing default php version on the system. I have additional php versions installed: php 8.1 & php 8.2, which I assigned to the website where invoice ninja is installed.

The app requires both the web and CLI versions of PHP to be >= 8.

when I run “php8.2 artisan optimize” I see

In Container.php line 891:
Target class [db.schema] does not exist.
In Container.php line 889:
Class “db.schema” does not exist

Maybe this will help:

  1. I copied my working installation v5.3.15 to another subfolder and it works w/o issues
  2. I downloaded latest zip v5.7.4 and overwrote all the files (except ones with .)
  3. I get HTTP ERROR 500
  4. When I run “php8.1 artisan cache:clear” or “php8.1 artisan optimize” I get error

In Application.php line 827:
Class “Coconuts\Mail\PostmarkServiceProvider” not found

Also, apache error log shows:

[Fri Aug 25 16:28:17.399851 2023] [proxy_fcgi:error] [pid 4124152:tid 139697823905536] [remote 99.99.99.99:60644] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught ReflectionException: Class “translator” does not exist in /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php:912\nStack trace:\n#0 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()\n#1 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()\n#2 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(933): Illuminate\Container\Container->resolve()\n#3 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()\n#4 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(918): Illuminate\Container\Container->make()\n#5 /var/www/c…PHP message: PHP Fatal error: Uncaught ReflectionException: Class “translator” does not exist in /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php:912\nStack trace:\n#0 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(912): ReflectionClass->__construct()\n#1 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build()\n#2 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(933): Illuminate\Container\Container->resolve()\n#3 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve()\n#4 /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(918): Illuminate\Container\Container->make()\n#5 /var/www/c…’

It may help to run composer install

Thanks @hillel I did, I still get same issues. Any other ideas?

root@server:/var/www/clients/client1/web1/web/billing# composer self-update
You are already using the latest available Composer version 2.5.8 (stable channel).

root@server:/var/www/clients/client1/web1/web/billing# php8.1 artisan optimize

In Application.php line 827:

Class “Coconuts\Mail\PostmarkServiceProvider” not found

root@server:/var/www/clients/client1/web1/web/billing# php8.1 artisan cache:clear

In Application.php line 827:

Class “Coconuts\Mail\PostmarkServiceProvider” not found

Progress.
I was able to run:

  1. “php8.1 -f /usr/local/bin/composer update”
  2. php8.1 artisan cache:clear
  3. php8.1 artisan optimize
  4. go to https://mywebsite/update?secret=mysecretkeyhere

Now I can get to login screen, but when I enter user & password, I still see: 500: Server Error

Are there any details about the 500 error in storage/logs?

I see below in /storage/logs/laravel.log

[2023-08-26 20:29:13] production.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘billingv5.purchase_orders’ doesn’t exist (Connection: mysql, SQL: select * from purchase_orders where purchase_orders.company_id in (2) and created_at >= 1970-01-01 00:00:00) {“userId”:1,“exception”:"[object] (Illuminate\Database\QueryException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘billingv5.purchase_orders’ doesn’t exist (Connection: mysql, SQL: select * from purchase_orders where purchase_orders.company_id in (2) and created_at >= 1970-01-01 00:00:00) at /var/www/clients/client1/web1/web/billing/vendor/laravel/framework/src/Illuminate/Database/Connection.php:801)
[stacktrace]

It may help to run php artisan migrate

thank you @hillel - that fixed the issue, it works now.

1 Like

Glad to hear it, thanks for the update!