Support forumCancel appointment in Google calendar
hannes_lorenz asked 5 years ago

Hey,
I am trying to cancel appointments by deleting them in Google calendar. I think I configured everything correctly:
I set a default location and a default service, I am using not my primary calendar for synchronization, worker email address is the same as my email Google email address. I disabled wp-cron and I am triggering it with cron-job.org (which works, because my backups are running on time, and reminder SMS is also sent on time).
Now the strange thing: The sync interval for Google is 15 minutes and I figured out that my cron job receives a 500 Internal Server Error every 15 minutes. I tried it manually to call wp-cron, when the google sync is supposed to happen and I also get a 500 error. This happens only when the google sync is supposed to be done, every other time I get a successful 200 code back. Is there a misconfiguration somewhere in the google sync code?

6 Answers
Nikola Loncar Staff answered 5 years ago

Hi,

can you please open error log file on your hosting regarding that 500 errors. There should be something regarding that part and paste it here. After that I can assume what is going wrong there.

Best regards,
Nikola

hannes_lorenz answered 5 years ago
PHP Warning:  mkdir(): Permission denied in /wp-content/plugins/easy-appointments-connect/vendor/katzgrau/klogger/src/Logger.php on line 119
PHP Warning:  file_put_contents(/wp-content/plugins/easy-appointments-connect/src/logs/google-sync.log.php): failed to open stream: No such file or directory in /wp-content/plugins/easy-appointments-connect/src/log_helper.php on line 9
PHP Warning:  fopen(/wp-content/plugins/easy-appointments-connect/src/logs/google-sync.log.php): failed to open stream: No such file or directory in /wp-content/plugins/easy-appointments-connect/vendor/katzgrau/klogger/src/Logger.php on line 167
PHP Fatal error:  Uncaught RuntimeException: The file could not be opened. Check permissions. in /wp-content/plugins/easy-appointments-connect/vendor/katzgrau/klogger/src/Logger.php:134\nStack trace:\n#0 /wp-content/plugins/easy-appointments-connect/src/google_logic.php(95): Katzgrau\\KLogger\\Logger-]__construct('/wp-content...', 'debug', Array)\n#1 /wp-includes/class-wp-hook.php(286): EAC_Google_Logic-]google_sync()\n#2 /wp-includes/class-wp-hook.php(310): WP_Hook-]apply_filters('', Array)\n#3 /wp-includes/plugin.php(515): WP_Hook-]do_action(Array)\n#4 /wp-cron.php(126): do_action_ref_array('eac_google_sync', Array)\n#5 {main}\n  thrown in /wp-content/plugins/easy-appointments-connect/vendor/katzgrau/klogger/src/Logger.php on line 134


Ok, so it tries to create a log folder/file, but can't because of a permission problem and later crashes because it could not create the file?
Where do I have to change permissions then?
Nikola Loncar Staff answered 5 years ago

Hi, you will have to create file /wp-content/plugins/easy-appointments-connect/src/logs/google-sync.log.php with CPanel or other management system on your hosting. If you can’t do that you can always put logging level to error instead of debug.

Best regards,
Nikola

hannes_lorenz answered 5 years ago

Yeah! Syncing works now. Could this be a bug in the plugin? If the plugin is not able to do the Google sync log, then it won’t sync back cancelled appointments? It seems like this prevented EA to sync cancellations.
But there is one more thing now: The events get cancelled in WordPress when I delete them in my Google calendar, but no cancellation emails are sent to customers when this happens. Is this intended?
Thank you very much for your help,
Hannes

hannes_lorenz replied 5 years ago

These are my php warnings (I don’t know if they are related to this):

PHP Warning: DateTime::modify(): Failed to parse time string (+ days) at position 0 (+): Unexpected character in /wp-content/plugins/easy-appointments-connect/src/google_event_helper.php on line 61
PHP Warning: DateTime::modify(): Failed to parse time string (+ days) at position 0 (+): Unexpected character in /wp-content/plugins/easy-appointments-connect/src/cron/google_cron.php on line 186
PHP Warning: DateTime::modify(): Failed to parse time string (+ days) at position 0 (+): Unexpected character in /wp-content/plugins/easy-appointments-connect/src/cron/google_cron.php on line 277

Nikola Loncar Staff answered 5 years ago

Hi by looking at your error log I suspect that you are missing value inside EA Extension settings for option called Sync data for next. Can you please check if that field is empty?

Best regards,
Nikola

hannes_lorenz answered 5 years ago

No, there is a value. I set it to 30 days. But sync works now, so in wordpress it is cancelled… but there is no email to the customer that it’s cancelled…

Nikola Loncar Staff replied 5 years ago

Hi I will check that regarding emails and cancelled appointments on GC and let you know.

Best regards,
Nikola