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

LDAP sync cronjob PHP error allocated memory exceeded #12018

Open
2 tasks done
xinput opened this issue Oct 23, 2022 · 6 comments
Open
2 tasks done

LDAP sync cronjob PHP error allocated memory exceeded #12018

xinput opened this issue Oct 23, 2022 · 6 comments

Comments

@xinput
Copy link

xinput commented Oct 23, 2022

Debug mode

Describe the bug

Hello there,

I created a script which runs on a daily bases as cronjob and syncs LDAP users to our 5 Locations in Snipe IT.

After the cronjob runs a few days, it then turns out to run into a php error 255 because PHP allocated memory is exceeded.

I checked my env and increased LDAP_MEM_LIM to 1024 already. After a few days: same error.
I also increased memory limit in php.ini without success.

What seems to be working is to run the
php artisan cache;clear
php artisan config:cache

commands which then leads to a functioning script again. Any ideas why this issue could appear and how to solve it?

Cheers

Reproduction steps

1.create crojob that runs daily to sync ldap users
2.wait until it runs 2-3 times
3.issue appears

Expected behavior

cronjob should run without issues on a daily basis

Screenshots

No response

Snipe-IT Version

6.0.12

Operating System

Rocky Linux 8

Web Server

nginx

PHP Version

8.0.24

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

Rocky Linux 8 was installed fresh and is only used to serve Snipe IT application. I'm running it on nginx with php-fpm.

Installation was done via git.

@xinput
Copy link
Author

xinput commented Oct 24, 2022

Small update on this. It seems that the LDAP_MEM_LIM from .env is not replicated to the LDap_Sync.php console command.

After hard coding 1024M into LDAP_Sync.php the error dissappears.

So I assume it's some kind of Bug.

@xinput
Copy link
Author

xinput commented Dec 7, 2022

small push on this issue. my hardcoded changes to the php file will be overwritten with every SNipe IT Upgrade.

@snipe
Copy link
Owner

snipe commented Apr 25, 2023

Sorry for not answering this sooner. Honestly, I have no idea. If it fixes it, just run those clear scripts right after you use the sync.

@xinput
Copy link
Author

xinput commented Apr 25, 2023

No worries. A while ago I implemented the clear scripts into the script and they run on each script execution now. This seems to be a workaround for me. We can close this. :)

@kuratlielia
Copy link

Hi, could you maybe share the script?

@snipe
Copy link
Owner

snipe commented Mar 8, 2024

https://snipe-it.readme.io/docs/common-issues#quick-tip-handy-commands

Snipe-IT Documentation
🚧Problem Installing/Upgrading?We've moved the the most common installation/upgrade issues to their own page. If you're having an issue installing or upgrading Snipe-IT, please check the Installation/Upgrading Issues page before opening a ticket on Github.Quick Tip: Handy Commands👍Many issues can b...

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