osticket-multildap-auth icon indicating copy to clipboard operation
osticket-multildap-auth copied to clipboard

Sync not working with ost 1.17.4

Open Fe3lApAcUt opened this issue 1 year ago • 21 comments

Hey @philbertphotos Hope you're doing great! I think the sync function is not working since I last tried osTicket again after a few months of abstinence. I'm using your latest version and ost 1.17.4.

  • User creation ist working after the user logs in manually
  • User login is working afterwards with http passthru
  • However, the initial sync is not working and not presenting any errors.
  • Cron job is running without errors.
  • DB table ldap_sync is not updated.

Is there an easy fix to get this to work correctly?

Best regards Marcel

Fe3lApAcUt avatar Jul 27 '23 11:07 Fe3lApAcUt

Hey @philbertphotos

i install today your Plugin on my new osTicket System (V 1.18) and i have the same same error/issue as Marcel.

Thanks for the help.

Best regards Andreas

malti1984 avatar Jul 27 '23 14:07 malti1984

Hmmm @Fe3lApAcUt lots of strange problems ... this update should be rock solid since I updated and fixed so many bugs. I worked on this extensively and the changes in 1.18 would not cause a single issue. LDAP_SYNC only updates if they user is create or login via the plugin.

Turn on logs ... I need to see what it says when a user tries to login. Did you do the connect test? What about the LDAP string any special characters?

philbertphotos avatar Jul 27 '23 14:07 philbertphotos

I am wondering if you upgrading a current copy or a test version of osticket.

philbertphotos avatar Jul 27 '23 15:07 philbertphotos

With Logs do you need?

for me it doesn't matter what I enter, for example, on the ldap server (i put a other ip), Connect Test says OK.

what i must add for the cronjob, i don't understand this point sorry :)

malti1984 avatar Jul 27 '23 16:07 malti1984

@malti1984 Logs here image PHP Logs and CRON LOGS if its separate from php log

philbertphotos avatar Jul 27 '23 19:07 philbertphotos

Yours woudl say "user login" since I have a new version that has some new features that I am still testing before release but its built off this base. I the connect says ok the LDAP is working (need to fix it so it shows all domains) The issue is the LDAP search if its the default then they should be no issues.

philbertphotos avatar Jul 27 '23 20:07 philbertphotos

Ok for got I updated the ldapclass ... it could be the reason it was not working properly but unlikely. In any case up date to that one and let me know.

philbertphotos avatar Jul 27 '23 20:07 philbertphotos

Hello, thanks for the help :-)

User creation ist working after the user logs in manually. Wan't sync the agents or user on my page.

Can you tell my, how i start the sync user manually? And how i add the cron job for the sync? I don't understand this :)

on my config - every time i save, it's the same time grafik

that's my sysmtelog, after saved config. That's all: grafik

when i try to login manually - i checked out "Register staff member to be registered automatically" grafik

Thanks alot

malti1984 avatar Jul 28 '23 07:07 malti1984

Looks like the logs are doing GREAT and users are able to login. The issue is that you need to turn on Cron Jobs in OSTICKET I can see its updating the schedule but nothing is changing last scheduled time as a test change the schedule to "1 minute" or "5 minute" or any where in between for testing instead of waiting for a day.

It will fill up the logs so only do it for an hour and check what is happening.

image

I have my cron jobs in Osticket running every minute but my environment is very very active. https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-osticket https://gist.github.com/snowyTheHamster/46e165350f77d59d9a55f558c9a51947

philbertphotos avatar Jul 28 '23 12:07 philbertphotos

Thanks, so i add the CronJob and the CronJob is running without errors.

The NEXT and LAST Schedule have the same TIME and DATE. Then i check the php files and see that you look at the ost_config table. there you search for sync_data and namespace (PLUGIN ID, INSTANCE ID).

on my installation (new installed with 1.17.4 and your plugin): grafik There ist no NAMESPACE on the SYNC_DATA line.

Then i change the line and now i see that the time has changed: grafik

Sync are running: grafik

But no Agents where created?!

any idea?

thanks for your help

malti1984 avatar Jul 31 '23 09:07 malti1984

Agents are not automatically created during sync (not until the next release) An agent can be created during login or manually created and they sync when changes in AD is detected. As for plugin instance on the sync_data ... that is a GREAT catch now I have to find out why that was not created properly. Very strange that should have been fix. That is DEF a bug.

philbertphotos avatar Jul 31 '23 12:07 philbertphotos

Ok thanks, then i test the next day's the User SYNC. I install a new Debian Server and try it. At the moment, no SYNC works on my Apache2 Server with PHP 8.0.

I see the User's when i search it under Users, but in the OSTicket Log i don't see the LDAP Sync. Very strange, It show's the LDAP-Sync once.

I give you a feedback tomorrow

malti1984 avatar Jul 31 '23 13:07 malti1984

This is me ... my environment is about 20 thousand users. So email like this is a regular occurrence. image

philbertphotos avatar Jul 31 '23 18:07 philbertphotos

Best thing to do is to change the schedule that way you can tell it worked with out wating for the next day. For testing I just tell it 5 minutes then change it back after it executed a few times.

philbertphotos avatar Jul 31 '23 18:07 philbertphotos

I change the sync an crontab to 2 minutes, but no sync and no email. I will try it tomorrow with a fresh installed osTicket Version.

malti1984 avatar Jul 31 '23 21:07 malti1984

For me: the sync create User automatically or only when users Login First time? Like Agents?

Should i set to private Mode or Public in Settings?

malti1984 avatar Jul 31 '23 21:07 malti1984

@malti1984 Syncing does not create a users it just updates existing accounts based on AD . For instance if I change the user name or other information it will get what ever is AD and overwrite OSTICKET. Ina future version it will import users not in OSticket from AD but personally I dont need this feature since users are automatically created when the login for the first time.

philbertphotos avatar Aug 01 '23 00:08 philbertphotos

@malti1984 modes no longer matter. I found a way around this and it creates users regardless what setting you have and yes ... only when user login for the first time.

philbertphotos avatar Aug 01 '23 00:08 philbertphotos

@philbertphotos Sorry for my many Messages, but something won't work on my new installed osTicket with the Plungin. osTicket-Version: 1.18 phpVersion: 8.2.8 new Debian 12 apache2 server

when i "Enable user synchronization" grafik

i become this error in the cli of my debian - execute cron.php grafik

when i "disable user synchronization" and only "Enable agent synchronization" the LDAP-Sync is showing in the "System Logs". grafik

I can Login with LDAP Users and Agents, but the Update Sync will not work. - no E-Mail, no Sync. Only Add new Users with SignIn.

Thanks for your help

malti1984 avatar Aug 01 '23 09:08 malti1984

@malti1984 I looking at this bug.

philbertphotos avatar Aug 03 '23 19:08 philbertphotos

Hi, I have Sync problem too with the plugin on OsTicket 1.18. I configured all and seems all correctly but I don't receive any Log on the system and also no email

flimby1 avatar Oct 05 '23 09:10 flimby1

@flimby1 FIXED

philbertphotos avatar Aug 04 '24 14:08 philbertphotos