Wordpress User Sync not working - various error messages

I have installed this plugin as it seemed like the only plugin that could do what I needed - namely, syncing users between a membership site (master) and an ecommerce site (sub site) (members receive discount on the ecommerce site, and as such we need the registered users on the member site to correspond with the sales site and stay up to date).
I followed the instructions and installed the plugin on both sites, adjusted settings as needed, and hit sync. The master site said that all users had been synced, but the slave site said there was an error. When I checked the sub site, over a couple of browser refreshes it showed 274 of 877 users had been synced.
I tried to sync again, and got a 502 Bad Gateway error on the master site.
Since then in various combinations I have turned all plugins on both sites on and off, disconnected and reconnected the subsite, changed to default themes, used 'uninstall options' on both sites, uninstalled the plugin and reinstalled it... "Synchronization of all Subsites completed" shows on the master site when in Debug Mode, but sub site gives the message attached.

Having checked back through the support forum I see that people have been having issues with this plugin for years (and many of the same issues), and I wish I'd spent more time reading the forums before purchasing as it seems I may have wasted my money. I am extremely disappointed with my purchase, there seems to be no rhyme or reason as to why it doesn't work (at least from anything I'm doing).
Is there any way to get this plugin working, or should I just cut my losses?

    Katherine

    I did attach it as a file, but it seems to have disappeared.
    [* denotes potentially sensitive information removed.]

    Warning: fopen(/*/*/*/wp-content/plugins/user-sync/log/errors_s.log): failed to open stream: No such file or directory in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 169

    Warning: fwrite() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 171

    Warning: fclose() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 172

    Warning: fopen(/*/*/*/wp-content/plugins/user-sync/log/errors_s.log): failed to open stream: No such file or directory in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 169

    Warning: fwrite() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 171

    Warning: fclose() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 172

    Warning: fopen(/*/*/*/wp-content/plugins/user-sync/log/errors_s.log): failed to open stream: No such file or directory in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 169

    Warning: fwrite() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 171

    Warning: fclose() expects parameter 1 to be resource, boolean given in /*/*/*/wp-content/plugins/user-sync/user-sync.php on line 172

    Warning: Cannot modify header information - headers already sent by (output started at /*/*/*/wp-content/plugins/user-sync/user-sync.php:169) in /*/*/*/wp-includes/pluggable.php on line 1228

    Rupok

    Hi Katherine

    I hope you had a wonderful day.

    I just tried to regenerate the issue with two of my live test sites but I was not able to regenerate. I could successfully sync all of my users between both sites.

    From the errors you pasted above, it seems like a server related issue. Can you please make sure all of your directories have proper permission assigned? Default WordPress file permission are 644 fo files, 755 for directories. You can get more idea about this from here: https://codex.wordpress.org/Changing_File_Permissions

    Moreover, would you mind allowing support access for both sites so we can have a closer look at this?

    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!
    Rupok

    Kasia Swiderska

    Hello Katherine,

    Can you try solution proposed by the plugin developer here https://premium.wpmudev.org/forums/topic/various-problems-with-the-user-sync-plugin#post-941061

    Would it be possible for you to manually create file with same name, extension and localization - "log/errors_m.log" on sites that have debug mode enabled? This should solve this warning.

    As I understand your slave site is not on wpengine, so you are able to create this file there?

    If this solve warning can you check again syncing users?

    kind regards,
    Kasia

    Katherine

    I created the necessary file on the slave site, put both into debug mode.
    When in debug mode, if i click sync from the slave site i get a connection error and sync problem error.
    if i then click sync from the master site, it says synchronisation is complete.
    in both cases, no syncing occurs.
    when not in debug mode, the slave site says there is a sync problem. clicking on the master site produces a 502 Bad Gateway.
    error log from slave site:

    [2016-01-05 15:22:35][S] 0-10 - ajax actions***
    [2016-01-05 15:23:27][S] 01 - new subsite conection - central_url=http://babamembers.staging.wpengine.com;; replace_user=0;; overwrite_user=0;;***
    [2016-01-05 15:23:27][S] 02 - sending request - url=http://babamembers.staging.wpengine.com/wp-admin/admin-ajax.php?action=user_sync_api;;***
    [2016-01-05 15:23:28][S] 03 - sending request - response=<br />
    <b>Warning</b>:  fopen(/nas/content/staging/babamembers/wp-content/plugins/user-sync/log/errors_m.log): failed to open stream: No such file or directory in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>169</b><br />
    <br />
    <b>Warning</b>:  fwrite() expects parameter 1 to be resource, boolean given in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>171</b><br />
    <br />
    <b>Warning</b>:  fclose() expects parameter 1 to be resource, boolean given in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>172</b><br />
    <br />
    <b>Warning</b>:  fopen(/nas/content/staging/babamembers/wp-content/plugins/user-sync/log/errors_m.log): failed to open stream: No such file or directory in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>169</b><br />
    <br />
    <b>Warning</b>:  fwrite() expects parameter 1 to be resource, boolean given in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>171</b><br />
    <br />
    <b>Warning</b>:  fclose() expects parameter 1 to be resource, boolean given in <b>/nas/content/staging/babamembers/wp-content/plugins/user-sync/user-sync.php</b> on line <b>172</b><br />
    ok;;***
    [2016-01-05 15:24:22][S] 0-10 - ajax actions***

    so, essentially, apart from anything else, this plugin ships without a necessary file/cannot actually create the necessary file?

    Rupok

    Hi Katherine

    This is really weird. Last night when I tried to sync, everything was working fine. But now I'm getting the same errors you mentioned. So I'm reporting this to our developer and I believe, he will come up with a solution very soon.

    Please keep in mind, our developers work round the clock and they have to deal with lots of critical issues and other things. So it may take a little while before they release any fix.

    Have a nice day. Cheers!
    Rupok

    Katherine

    I tried deleting all users to see how far the initial sync would get, it hit 250 then after another go topped out at 274 again. I deleted all the admins except myself, and tried again, but it just re-synced the deleted admins (so i'm guessing 'Do not sync deleted users' doesn't exactly do what it says on the tin?). The only thing i can think of unless the developer comes up with something is that it's a server timeout issue?

    Katherine

    sorry for the slow reply, I've been working away for a few days.
    I've just spoken to WP Engine, and the server timeout is set to 60 seconds and can't be increased. the issue is definitely at their end as the error message is from the Nginx server (WP Engine) and the slave site is hosted on an Apache server.
    If I leave the sites connected will all the data eventually make it's way through in chunks, or is it a 'one go and that's your lot' setup?

    Katherine

    Hi Kasia,

    It gets to 275 users and refuses to sync any more, no matter what i do. The fact that the user-sync.php file actually has the lines `This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.` in it makes me think that I'm just being strung along for my money. Perhaps this bit should be stated clearly on the plugin page, so people can see it before commiting any money?
    And the fact that Rupok said above

    This is really weird. Last night when I tried to sync, everything was working fine. But now I'm getting the same errors you mentioned.

    which is obviously untrue as at no point have I seen the number of users go past 275 so it definitely wasn't working fine!

    EDIT: This is ridiculous. It looks like users are being synced when i disconnect the slave from the master, and reconnect & sync via the slave. ONE AT A TIME. At this rate, if this is going to be the only way i can get it to work, i'm going to have to disconnect and reconnect about 550 more times to get everyone across...

    Kasia Swiderska

    Hello Katherine,

    If this possible could you send us access to your sites, so developer could check what is going on there?

    Could you please send in the following via our secure contact form https://premium.wpmudev.org/contact/ :

    - Mark to my attention, the subject line should contain only: ATTN: Kasia Swiderska
    - Do not include anything else in the subject line, doing so may delay our response due to how email filtering works.
    - Link back to this thread
    - Include WordPress network admin access details (login address, username & password)
    - Include FTP log-in details (hostname, username & password)
    - Include any relevant URLs for your site

    IMPORTANT: Please make sure you select "I have a different question" for your topic, so it doesn't go back to the forums - this and the subject line ensure that it gets assigned to me.

    kind regards,
    Kasia