Routes-v7.php is not writable

Version v5.10.53

Environment Zip

Checklist

  • Can you replicate the issue on our v5 demo site https://demo.invoiceninja.com or Invoice Ninja? No
  • Have you searched existing issues? Yes
  • Have you inspected the logs in storage/logs/laravel.log for any errors? Yes

Cannot update system because routes-v7.php is not writable

Describe the bug

Unable to perform update because routes-v7.php is not available. I have attempted to update via the web gui, Windows App and Mac App

Steps To Reproduce

Click update button enter password. Failure

Expected Behaviour

I can update?

Additional context

chown -R www-data:www-data /var/www/invoice-ninja has been run several times
chmod -R 775 /var/www/invoice-ninja has been run several times
drwxrwxr-x 15 www-data www-data 4096 Dec 11 19:36 invoice-ninja.

I’ve attempted an artisan migrate. But after refreshing i’m then presenting with the setup page. I enter all the previous details and i’m prompt to create a company with all my previous entries gone. I’ve resolved that with a snapshot rollback.

Logs

[2024-12-11 19:48:41] production.INFO: running post update
[2024-12-11 19:48:41] production.INFO: I wasn’t able to migrate the data.
[2024-12-11 19:48:41] production.INFO: finished migrating
[2024-12-11 19:48:41] production.INFO: cleared config
[2024-12-11 19:48:41] production.INFO: view cleared
[2024-12-11 19:48:41] production.INFO: queue restarted
[2024-12-11 19:48:42] production.INFO: Sent for version check
[2024-12-11 19:49:10] production.ERROR: Cannot update system because routes-v7.php is not writable {“userId”:1,“exception”:"[object] (App\Exceptions\FilePermissionsFailure(code: 0): Cannot update system because routes-v7.php is not writable at /var/www/invoice-ninja/app/Http/Controllers/SelfUpdateController.php:182)

Fixed formatting - sorry

Hi,

There’s info on permissions here:

If that doesn’t help you can manually copy over the latest release tar.

Hi Hillel,

Sorry if i’m being silly but is there instructions on how to manually update with the tar anywhere?

Thanks

There’s some info here:

Got it and updated thank you!

However, now getting the following after attempting a migrate

  INFO  Running migrations.

  2023_12_10_110951_inbound_mail_parsing ................................................................. 4.12ms FAIL

   Illuminate\Database\QueryException

  SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'expense_mailbox_active' (Connection: mysql, SQL: alter table `companies` add `expense_mailbox_active` tinyint(1) not null default '0')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
    821▕                     $this->getName(), $query, $this->prepareBindings($bindings), $e
    822▕                 );
    823▕             }
    824▕
  ➜ 825▕             throw new QueryException(
    826▕                 $this->getName(), $query, $this->prepareBindings($bindings), $e
    827▕             );
    828▕         }
    829▕     }

      +9 vendor frames

  10  database/migrations/2023_12_10_110951_inbound_mail_parsing.php:13
      Illuminate\Support\Facades\Facade::__callStatic()
      +25 vendor frames

  36  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Also, i should state. That it’s still reporting that Routes-v7.php is not writeable when conducting a health check.

You’ll need to comment out the lines in 2023_12_10_110951_inbound_mail_parsing which have already run and then rerun php artisan migrate