Closed universenl closed 6 years ago
It seems when ever the storage/cache/data/85/ file is cleaned
What is doing the "cleaning" of files in your storage
folder?
Not sure thats the problem, everyday this happends again so i need to overwrite the file to get the admin permissions back.It seems like everyday that file to created again, and when that happened i lost admin permissions.
Well, the problem could be in 4 places:
how your server's caching is configured Maybe you should switch from "file" caching to "database" or "redis"?
your application code It's possible that you've got something in your code that is triggering the caching to happen against wrong data.
this package Without having a complete copy of your application code in order to use it to run new tests against this package, I'm inclined to think this package isn't the problem. All its tests are passing, even when run against multiple caching drivers.
server deployment Maybe something is changing the files on your server, when they shouldn't be touched.
Its seems like something on the production server, becouse the development still runs without any errors. Same version of the application only not in production build.
It seems like when we save a permission this error occurs right away, so if i save the permission All on the adminpanel we get locked out and the cache file is changed.
The wierd thing about this story, we did run the backend in production mode for like 6 weeks without this error occurs once. But like i sad, the development version still runs string and even there we can save the All permissions and the website still works.
Ya, it seems like something odd on the server.
The package does delete cached permissions on save, but rebuilds them again on the first query.
Again, switching from file-based caching to a different cache driver may reveal something useful in your debugging process. Instead of file
, try array
. Then you can try database
if you create the cache table in the db (run php artisan cache:table to create a migration for that table). If you have redis on your server, you can install predis/predis
with composer and change to redis
for your cache driver.
You didn't mention which Laravel version.
What's the content of your composer.json
?
This is composer.json
{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "barryvdh/laravel-dompdf": "^0.8.2", "dennobaby/autodns-api-2": "dev-master", "fideloper/proxy": "^4.0", "gtk/flash-message": "^1.3", "imtigger/laravel-job-status": "^0.1.14", "itelmenko/laravel-mysql-logger": "^0.1.8", "laravel/framework": "5.7.*", "laravel/tinker": "^1.0", "laravelcollective/html": "^5.6", "laravelcollective/remote": "^5.6", "mariuzzo/laravel-js-localization": "^1.4", "mollie/laravel-mollie": "^2.0", "nyholm/psr7": "^1.0", "propaganistas/laravel-phone": "^4.0", "pusher/pusher-php-server": "~3.0", "spatie/laravel-newsletter": "^4.2", "spatie/laravel-permission": "^2.12", "unisharp/laravel-filemanager": "~1.8", "yajra/laravel-datatables-oracle": "~8.0" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.1", "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" }, "files": [ "app/Helpers/cdn.php", "app/Helpers/functions.php", "app/Helpers/formatting.php", "app/Helpers/user.php" ] }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true }
This is fixed, wrong id in mysql was the problem.
Hello,
I am trying to get my new web app live, but for this time i run into some trouble. It seems when ever the storage/cache/data/85/ file is cleaned laravel spatie is not getting my admin permissions anymore. When i replace the cache file with an older one it seems to work again.
Can somebody please assist on this, already got more than 20 hours in this problem. Added both of the cache files
855f92484c8c414d36c1b25cb24876e30229cbbf_new but not working.txt 855f92484c8c414d36c1b25cb24876e30229cbbf_working.txt
Greatings Mitch