Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 500 Memory limit with a new user account and just backend access role #85

Open
nicopoal opened this issue Apr 11, 2023 · 7 comments

Comments

@nicopoal
Copy link

nicopoal commented Apr 11, 2023

Hi,
On a fresh install on last version, i create a new basic user account, and grant only backend user access role. When i log in with this user , goes to route /admin and ends with a error 500 instead of showing default dashboard page with demo components. I'm a beginner on Laravel, so it's quite possible that I misunderstood something :)

WARN  PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in vendor/lavary/laravel-menu/src/Lavary/Menu/Item.php on line 546.

WARN  PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0.

Thanks for your help

@sebastienheyd
Copy link
Owner

Hi,

Do you know the value of memory_limit in your php.ini file ?

Maybe this value is too low.

@nicopoal
Copy link
Author

Hi,
Yes I have already checked this point. I even went from 128MB to 1GB and it didn't change anything. Here is a screenshot of the assigned role. And if I allow the admin role, it works without problem. Maybe a problem with the default routes to the dashboard demo page if the admin role is not activated ?

Capture d’écran 2023-04-13 à 10 11 53

@sebastienheyd
Copy link
Owner

I can't reproduce the problem. I need to know more, version of laravel, php, phpinfo and composer.json

I don't think it's a problem with the package

@nicopoal
Copy link
Author

Laravel Framework 9.52.5
Composer version 2.3.9 2022-07-05 16:52:11
PHP 8.1.8 (cli) (built: Jul 8 2022 10:46:35) (NTS)
phpinfo is quite long, what info is important ?

composer.json
`{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7",
"sebastienheyd/boilerplate": "^7.18"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "stable",
"prefer-stable": true
}

phpini.txt

Thanks for your help :)

@sebastienheyd
Copy link
Owner

I just see that you have an "Liste des commandes" permission in the "Utilisateur du back-office" role, does the problem persist without this permission assigned to the role?

@nicopoal
Copy link
Author

Yes I was trying to create a new permission to a new page, to test if the user has access to it (I haven't finished yet so I don't know if it works). But indeed, even if I remove this permission "Liste des commandes", I still have the same problem

@abdallhsamy
Copy link

Hi, Yes I have already checked this point. I even went from 128MB to 1GB and it didn't change anything. Here is a screenshot of the assigned role. And if I allow the admin role, it works without problem. Maybe a problem with the default routes to the dashboard demo page if the admin role is not activated ?

Capture d’écran 2023-04-13 à 10 11 53

you may use laravel sail default config to check if error related to app or your local config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants