CoffeeCake Posted September 10, 2020 Posted September 10, 2020 The issue is that core_members is a table that no third-party plugin or application should touch. Auto Welcome likely was using this prior to 4.5 and is now expected to move it elsewhere. The part that moves it elsewhere is likely what died on us, but all a big guess. svit 1
Michael.J Posted September 10, 2020 Author Posted September 10, 2020 6 hours ago, Logan0 said: I see the chatbox+ integration still doesn't work Michael any thoughts on fixing it please. Not for a while sorry, I'm quite busy with other updates and bugs. 3 hours ago, svit said: during the auto welcome upgrade i got this error message: What version of the Auto Welcome app did you upgrade from? 3 hours ago, Paul E. said: The issue is that core_members is a table that no third-party plugin or application should touch. Auto Welcome likely was using this prior to 4.5 and is now expected to move it elsewhere. The part that moves it elsewhere is likely what died on us, but all a big guess. Yes this was a retroactive change unfortunately, so I needed to handle existing core_members data. I've used the upgrade steps before without fail and you'll have to check with IPS in regards to it's reliability. But if people are having issues with this, I'll setup a background task instead to shift that data across.
CoffeeCake Posted September 10, 2020 Posted September 10, 2020 2 minutes ago, Michael.J said: Yes this was a retroactive change unfortunately, so I needed to handle existing core_members data. I've used the upgrade steps before without fail and you'll have to check with IPS in regards to it's reliability. But if people are having issues with this, I'll setup a background task instead to shift that data across. Totally understand. You're not the only one doing this by far. See here for some strategy discussion, and sample code that worked at ~1,000,000 records. You may also want to look at the UPGRADE_MANUAL_THRESHOLD constant as well and throw up the option for a query to run straight at the SQL level.
Michael.J Posted September 10, 2020 Author Posted September 10, 2020 Just now, Paul E. said: See here for some strategy discussion, and sample code that worked at ~1,000,000 records. Just replied there too 😉
svit Posted September 11, 2020 Posted September 11, 2020 17 hours ago, Michael.J said: What version of the Auto Welcome app did you upgrade from? I had 'the previous' version installed, since I am keeping all ups up-to-date, unfortunately, the site is down, due to the incomplete upgrade of the latest IPS patch which cannot be completed due to the hick-up of the Auto Welcome app, could you please advise on any patch which would help us with this issue?
Dean_ Posted September 11, 2020 Posted September 11, 2020 I hope my problems are not returning... I had the previous version installed and updated yesterday and someone joined today and no welcome topic was created, yet it was working fine before the upgrade... I'll keep my eyes on it and see if it happens again.
Dean_ Posted September 11, 2020 Posted September 11, 2020 OK, someone else has just joined, and it's certainly not working now, and I have no idea why.
CoffeeCake Posted September 12, 2020 Posted September 12, 2020 (edited) We moved forward with our 4.5 upgrade and uninstalled this application in 4.4. Now, when we go to our installed applications, the application is listed at the bottom as not installed with a button to install it. Pressing the install button says that the application is already installed. Trying to install again from Marketplace says that the application must first be uninstalled. To get past this, we removed applications/autowelcome from the file system and then went to ACP > applications and removed the "out of date" application at the bottom. Edited September 12, 2020 by Paul E.
CoffeeCake Posted September 12, 2020 Posted September 12, 2020 1 hour ago, Paul E. said: We moved forward with our 4.5 upgrade and uninstalled this application in 4.4. Now, when we go to our installed applications, the application is listed at the bottom as not installed with a button to install it. Pressing the install button says that the application is already installed. Trying to install again from Marketplace says that the application must first be uninstalled. To get past this, we removed applications/autowelcome from the file system and then went to ACP > applications and removed the "out of date" application at the bottom. After testing, this is the approach I'd recommend for larger sites. Make a copy of your settings somewhere, uninstall just before the 4.5 upgrade, upgrade, and then reinstall. This stopped the entire issue of migrating data. Short of the above issue, it looks like this got us over the hurdle. The Old Man 1
Olmyster Posted September 14, 2020 Posted September 14, 2020 On 9/13/2020 at 1:47 AM, Paul E. said: After testing, this is the approach I'd recommend for larger sites. Make a copy of your settings somewhere, uninstall just before the 4.5 upgrade, upgrade, and then reinstall. This stopped the entire issue of migrating data. Short of the above issue, it looks like this got us over the hurdle. Unfortunately, I had done the upgrade before so "Auto welcome" doesn't work anymore. I try to uninstall the plugin it then doing a fresh reinstall but the problem remains. 🤔
Mercury Forever Posted September 15, 2020 Posted September 15, 2020 this error in upgrade 1S111/1 Duplicate entry '36795' for key 'PRIMARY'
Runar Posted September 15, 2020 Posted September 15, 2020 I installed this on my community earlier today, and set it to send a PM one hour after someone signs up. I came back to my community now, and apparently the plugin sent the welcome message to all existing members. All five thousand of them. Is this expected behavior? If it is, why wasn’t there a warning?
CoffeeCake Posted September 15, 2020 Posted September 15, 2020 2 minutes ago, Runar said: All five thousand of them. You just gave me a slight panic attack. But, it looks like that did not happen for us in the case of selecting the e-mail option. We don't use this for PMs.
Dean_ Posted September 15, 2020 Posted September 15, 2020 On 9/11/2020 at 6:39 PM, Dean_ said: I hope my problems are not returning... I had the previous version installed and updated yesterday and someone joined today and no welcome topic was created, yet it was working fine before the upgrade... I'll keep my eyes on it and see if it happens again. On 9/11/2020 at 11:31 PM, Dean_ said: OK, someone else has just joined, and it's certainly not working now, and I have no idea why. This is not working for me at all in 4.5.
Mercury Forever Posted September 15, 2020 Posted September 15, 2020 9 hours ago, Fred Krugger said: this error in upgrade 1S111/1 Duplicate entry '36795' for key 'PRIMARY' uninstall and install.. works fine.
Runar Posted September 15, 2020 Posted September 15, 2020 3 hours ago, Paul E. said: You just gave me a slight panic attack. But, it looks like that did not happen for us in the case of selecting the e-mail option. We don't use this for PMs. Interesting. Did you set a delay on the email or is it sent immediately?
CoffeeCake Posted September 15, 2020 Posted September 15, 2020 5 minutes ago, Runar said: Interesting. Did you set a delay on the email or is it sent immediately? No delay, immediately. Justin Stellman 1
Runar Posted September 15, 2020 Posted September 15, 2020 2 minutes ago, Paul E. said: No delay, immediately. Then I guess the delay functionality doesn’t account for existing members, and if installed on an old community, everyone will receive the welcome message. I’m looking forward to the next invoice from Mailgun 😄
Square Wheels Posted September 15, 2020 Posted September 15, 2020 3 hours ago, Runar said: I installed this on my community earlier today, and set it to send a PM one hour after someone signs up. I came back to my community now, and apparently the plugin sent the welcome message to all existing members. All five thousand of them. Is this expected behavior? If it is, why wasn’t there a warning? I have it on a few sites. Oddly, on one site it was doing this, sending to everyone. The other site it works fine. For the bogger site (just under 12k members) I only have it make a post.
CoffeeCake Posted September 15, 2020 Posted September 15, 2020 (edited) 30 minutes ago, Runar said: Then I guess the delay functionality doesn’t account for existing members, and if installed on an old community, everyone will receive the welcome message. Oh dear. We have enough members that this would have been.... problematic, to say the least. @Lindy, something for your Marketplace resource testing/evaluation consideration. /* Only get members not yet welcomed. */ $where = array( array( 'welcome_sent IS NULL' ) ); /* Only get members who joined after time delay */ $where[] = array( 'core_members.joined < ?', \IPS\DateTime::create()->sub( new \DateInterval( 'PT'.\IPS\Settings::i()->aw_welcome_delay.'H' ) )->getTimestamp() ); /* Look for matching members */ $members = \IPS\DB::i()->select( '*', 'core_members', $where, 'joined ASC', 15 )->join( 'autowelcome_members', 'core_members.member_id=autowelcome_members.welcome_member_id' ); The issue appears to be core_members.joined < (LESS THAN). The logic used is returning all members with no welcome_sent value, who joined any time before the threshold indicated. That probably should be >= instead. Edit: For clarity, the above only gets hit if a delay is set. If no delay, you don't trigger this. Whatever you do, don't add a delay. Edited September 15, 2020 by Paul E. Workaround.
CoffeeCake Posted September 15, 2020 Posted September 15, 2020 As a safety measure, we've run the following SQL statement to populate autowelcome for all past members. This will mitigate this problem. PROVIDED AS-IS. USE AT YOUR OWN RISK, MAKE BACKUPS OF EVERYTHING FIRST. YOU HAVE BEEN WARNED. INSERT INTO `autowelcome_members` (`welcome_member_id`,`welcome_sent`) SELECT `core_members`.`member_id` ,1 FROM `core_members` LEFT JOIN `autowelcome_members` ON `autowelcome_members`.`welcome_member_id` = `core_members`.`member_id` WHERE `autowelcome_members`.`welcome_member_id` IS NULL Runar 1
Runar Posted September 15, 2020 Posted September 15, 2020 1 hour ago, Paul E. said: As a safety measure, we've run the following SQL statement to populate autowelcome for all past members. This will mitigate this problem. PROVIDED AS-IS. USE AT YOUR OWN RISK, MAKE BACKUPS OF EVERYTHING FIRST. YOU HAVE BEEN WARNED. Thank you for taking your time to look into this issue. Unfortunately it’s too late for my community, but luckily my members found it funny and nice (even those with 20 years as members) so the damage isn’t that bad. I hope this issue is fixed, though, as I can’t be the only one who’d like to send a PM some X hours after a new member signs up. The good thing that’ll come from this is that from now on I’ll test all new plugins and applications on my staging server, even the simple and harmless ones like this one. CoffeeCake 1
CoffeeCake Posted September 15, 2020 Posted September 15, 2020 36 minutes ago, Runar said: Thank you for taking your time to look into this issue. Unfortunately it’s too late for my community, but luckily my members found it funny and nice (even those with 20 years as members) so the damage isn’t that bad. Sending close to a million members an e-mail would have been detrimental for us. This is the sort of thing that we'd hope to catch in our previous code reviews, yet I personally have used the wrong comparison operator in my own code. It's one of those things that's easy for me to get backwards in my head. We did test this in our test environment, matching our intended production configuration. We decided an immediate e-mail after registration made the most sense for our community, but did consider a delayed message. It's the sort of thing that later on we might reconsider, not realizing we're triggering a path of getting blacklisted for spam. 39 minutes ago, Runar said: The good thing that’ll come from this is that from now on I’ll test all new plugins and applications on my staging server, even the simple and harmless ones like this one. This, in my opinion, is a must. But, it's a lesson learned over many years of experience at when things like this go wrong.
Runar Posted September 15, 2020 Posted September 15, 2020 25 minutes ago, Paul E. said: Sending close to a million members an e-mail would have been detrimental for us. For me 5 000 messages is a lot (I even chose to send them from my own account), but one million would be disastrous. 29 minutes ago, Paul E. said: We decided an immediate e-mail after registration made the most sense for our community, but did consider a delayed message. In hindsight, I should have done the same, but I thought letting my new members get a feeling of the community before sending them a message would be best, and that a small delay would feel more natural than receding the message immediately after signing up. 31 minutes ago, Paul E. said: This, in my opinion, is a must. But, it's a lesson learned over many years of experience at when things like this go wrong. I usually do, and I’m even working on a new workflow consisting of a private git repo and Ansible, but that haven’t made it to production yet. Well, it could have been worse! Also, if I hadn’t done this, we most likely wouldn’t have discovered the issue (at least not at this time).
Olmyster Posted September 17, 2020 Posted September 17, 2020 On 9/14/2020 at 9:51 AM, Olmyster said: I try to uninstall the plugin it then doing a fresh reinstall but the problem remains. 🤔 Hi @Michael.J. Despite several attempts, I'm staying in stuck with the plugin. I can install and configure it but nothing is sent to new members.
Recommended Posts