So I just attempted to update and this is a new error I never seen before:
Updated several times in the past now flawlessly, but this time it is trolling me.
Also notice that this error flashes by very fast, so it is hard to see it. I had to run the update several times to screenshot it.
Can you execute the find command and tell us what you get? (Assuming www-data is the user your nginx/apache is running as.)
I can only speculate about the cause, but running php artisan optimize as root will recreate bootstrap/cache/routes-v7.php (and bootstrap/cache/config.php) and is one way to end up with those files owned be root.
beginning at your invoice directory (you need to use your real path here)
the backslash is needed to escape the opening and closing parenthesis from the shell
the parenthesis are needed to execute logical OR (-o) before the (implicit) logical AND just before the -ls
search for files that are ( NOT owned by www-data (change, if your nginx or apache runs as a different user) OR that have NOT ALL the permission bits 644 set ) AND list them
I have checked on my server through webmin (which I have installed too in the past to make it a bit easier to do maintenance tasks etc.) and all folder and files are from what i can see owned by www-data which I know I had set in the past to own the www root folder of ninja and its subfolder /files too when i installed Invoice Ninja.
I’m thinking of where that “routes-v7.php file” actually reside in the folder structure of invoice ninja? I been searching for it, but I cannot seem to find it.
I have also downloaded a fresh set of installation files, unzipped it to a local folder and search that for “routes-v7.php”, but nothing found there either…
So I’m a bit puzzled of it (of the location of "routes-v7.php").
Right!
So after been digging a bit further I have figured out that the “routes-v7.php” is automatically generated by the laravel framework in the → bootstrap → cache folder.
So was the problem with the file permissions on the routes-v7.php file?
I am seeing the same thing. The routes file is set to 644 and owned by me, but when I change the authorizations to 755, it gets set back to 644 within minutes (by a yet unidentified force).
Doesn’t sound normal @Francesco it should not change file/folder permissions automatically by itself.
.
Have you checked your server for security breaches/have you been hacked?
If you have been breached contact Adrian at Magefix which can identify the issue and clean it for you: https://magefix.com/
Thanks. The authorization thing was resolved. I ran the artisan optimize every 10 minutes because I thought that was a good idea and I don’t know wtf I’m doing in the first place.
Still curious about the required authorizations. I understand that read rights should be sufficient, but now that I stabilized execution permission, my frequent errors have magically and quite coincidentally disappeared.