Lost Users

5 years 2 weeks ago #311105 by MarylandShallIssue
Replied by MarylandShallIssue on topic Lost Users
Do you have anything that we could run on a nightly basis to check for the issue we're running into? A CRON, or something along those lines?

Additionally, is there any script that you have or could make that we could run at the database level that we could use to restore users with provided information?

Please Log in to join the conversation.

5 years 2 weeks ago #311113 by krileon
Replied by krileon on topic Lost Users

Do you have anything that we could run on a nightly basis to check for the issue we're running into? A CRON, or something along those lines?

No.

Additionally, is there any script that you have or could make that we could run at the database level that we could use to restore users with provided information?

No, you'd need to restore that information out of a backup if you have any. Did you verify the missing users are actual users trying to use your site? You need to check your payment gateway to see why it's sending IPNs for a basket that doesn't exist anymore.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

5 years 1 week ago #311251 by MarylandShallIssue
Replied by MarylandShallIssue on topic Lost Users
I'm a little lost here. This issue has been going on sporadically for at least two years so wiping out our database to restore even one month old records is a non starter.

Here's some more information that I'm finding as I try to understand the issue. The baskets show proof that a membership and/or a donation was made. The missing member even has given us records of the missing payment from their end as evidence of them appearing in the Baskets section of CB Subs. The subscription is not showing up in the Subscriptions section of CB Subs, and of course the users are not showing up in the Users area of Joomla.

I've written SQL code to find all missing members that are not in the users table but are in the cbsubs_payment_baskets. Here's the script:
SELECT     payment_date, 
        id, 
        user_id, 
        item_name, 
        first_name,
        last_name, 
        address_name, 
        address_street, 
        address_city,
        address_state,
        address_zip, 
        payer_email, 
        contact_phone 
FROM `dto85_cbsubs_payment_baskets` AS pb
WHERE pb.user_id NOT IN 
(
SELECT id FROM dto85_users
) AND
item_name like '%Member%';

This shows that the members are in the subscriptions table despite not showing up in the admin portal:
SELECT     id, 
        user_id,
        subscription_date
FROM `dto85_cbsubs_subscriptions` as s
WHERE s.user_id NOT IN 
(
SELECT id FROM dto85_users
)

There's something going on in the process of a NEW member signing up at the same time they are subscribing through CB Subs. In other words, the same form that takes subscription information for a NEW user collects NEW user information for the Joomla insert. This means that the process of subscribing handles the creation of the new member. I get that you're not on the hook for actually creating the user in the user table, but you must be calling the PHP Joomla routine somewhere in the sequence of the subscription. I would think that you'd create the user first, then process the subscription using the user ID returned from the Joomla service. My feeling is the transaction of creating a user, creating a basket, and then creating a subscription is not atomic.
Here's what I'd like some help in.
  • Can you explain the sequence of how you create a new user at the same time you create a subscription and payment? Specifically how you know of the user ID to insert it into the subscription and baskets tables.
  • My prevailing thought is we've had some server resource issues during these times as we get spikes in membership signups and renewals. It is seasonal. Assuming you WILL get failures in the process described above, what type of checks should you make to ensure that a payment has a corresponding user? How do you make this create user/payment/subscription an atomic transaction or short of making it atomic, log the fact that something went amiss?
  • We need to restore members so they exist in Joomla. You must know how this is done as you are likely making this call to Joomla services. If you do not want to help us with the above, at least point out where in your code you create the user, create a basket, and create a subscription record. We will need to recreate it to restore the user information manually.

Please Log in to join the conversation.

5 years 1 week ago #311262 by krileon
Replied by krileon on topic Lost Users
It's impossible for someone to make a purchase through CBSubs without being registered. You can't reach the CBSubs basket or submit any of its payment forms without being a user. The user is always created first in Joomla followed by the CB user store which creates them in CB.

Change your query to check against _comprofiler and see if they exist in CB at least. If they exist in CB, but not Joomla then something deleted them from Joomla. You can not restore your users if they don't exist. Create them manually within CB > User Management then give them a subscription from there. Cancel the recurring payments for them within your payment gateway.

This entirely sounds like the user deleted themselves, something you've installed deleted them for whatever reason, or an admin has deleted them. If you've Joomla privacy suite or CB Privacy features available for users to delete themselves it's entirely possible either is at fault. If not you need to review your site carefully for anything that could be doing a user delete automatically or begin removing access for your moderators as it's possible one of them has deleted the user.

If you've the IPN and history logs in CBSubs you can PM backend super administrator login credentials with steps to find those entries and can review them. Beyond that I don't know what more to suggest as I've never seen such an issue and there isn't anything in CBSubs code to suggest it's doing anything wrong here.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.191 seconds