Fixed Beta3: Activity Summary Email - import is running sending [..] is disabled

Mouth

Well-known member
When I enable Activity Summary Emails ( tickbox @ /admin.php?activity-summary/ ) I then get a warning block of "While an import is running sending the activity summary email to inactive users is disabled.".

I visit /admin.php?import/ and there doesn't appear to be an active import running (or awaiting finalisation). cli appears to confirm this ...
Code:
php cmd.php xf:import-finalize
No valid import session could be found. Configure this via the control panel.
 
Actually, I can't reproduce this.

The warning suggests you have an active import session but it's possible it's just left over in the database for some reason.

In fact, looking at the code in more detail it's possible that you had an incomplete import session, and then uninstalled the add-on that provided the importer. Or could it have been an import that was started in XF 1.x? We do take steps to clear the data registry of any import session when upgrading from 1.x to 2.x but I know you had some inconsistencies with the database during upgrade so it's possible there's a hangover from that.

The import page will show that there's no import, but the activity summary page only checks for the presence of an import session.

This may still be something we want to resolve, but it would be good to have confirmation it is that.

Assuming that you aren't using caching such as Redis or Memcached or similar can you provide the results of this query:

SQL:
SELECT * FROM xf_data_registry WHERE data_key = 'importSession'
 
Have you ever run an import into this forum?
Yes
In fact, looking at the code in more detail it's possible that you had an incomplete import session, and then uninstalled the add-on that provided the importer.
Seems likely this. I installed https://xenforo.com/community/resources/content-ratings-for-xf2-1.5600/ (v2.2.0) and used its XF1 "Post Ratings" importer functionality, and have now disabled this addon. I do remember finalising the import process step.
can you provide the results of this query:
Code:
mysql> SELECT * FROM xf_data_registry WHERE data_key = 'importSession';
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| data_key      | data_value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| importSession | O:17:"XF\Import\Session":17:{s:10:"importerId";s:35:"SV\ContentRatings:PostRatingsViaSQL";s:8:"logTable";s:30:"import_log_postratingsviasql_1";s:9:"retainIds";b:0;s:10:"baseConfig";a:4:{s:16:"like_reaction_id";i:1;s:11:"categoryMap";a:1:{i:0;s:1:"0";}s:17:"overwriteExisting";s:1:"1";s:9:"ratingMap";a:1:{i:3;i:4;}}s:10:"stepConfig";a:1:{s:10:"_retainIds";b:0;}s:14:"remainingSteps";a:0:{}s:11:"currentStep";N;s:12:"currentState";N;s:10:"stepTotals";a:7:{s:18:"reactionCategories";i:4;s:9:"reactions";i:21;s:15:"reactionsFiller";i:0;s:24:"populateReactionContents";i:1129017;s:16:"syncingIsCounted";i:3963;s:18:"fillReactionCounts";i:376706;s:16:"userRatingCounts";i:6480;}s:8:"stepTime";a:7:{s:18:"reactionCategories";i:0;s:9:"reactions";i:0;s:15:"reactionsFiller";i:1;s:24:"populateReactionContents";i:28;s:16:"syncingIsCounted";i:14;s:18:"fillReactionCounts";i:124;s:16:"userRatingCounts";i:1;}s:9:"startTime";i:1597893402;s:15:"runCompleteTime";i:1597893570;s:5:"extra";a:0:{}s:5:"notes";a:0:{}s:7:"runType";s:3:"cli";s:11:"runComplete";b:1;s:9:"finalized";b:1;} |
+---------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
 
Ah ok, that confirms it then.

We should be able to workaround this but I think if you re-enable the add-on and go to the Import page you might need to "Complete" the import to clear the session.

Assuming you used the CLI to finalize we may actually also need to modify that CLI command to clear the import session too.

Let us know what the import page looks like when the add-on is re-enabled and let us know if clicking "Complete" seems to get rid of the message.
 
Let us know what the import page looks like when the add-on is re-enabled and let us know if clicking "Complete" seems to get rid of the message.
Screen Shot 2020-08-25 at 01.45.56.webp
Yes, clicking Complete got rid of the OP message. Also ..
Code:
mysql> SELECT * FROM xf_data_registry WHERE data_key = 'importSession';
Empty set (0.00 sec)
Disabling the addon again, doesn't cause the OP message/issue to occur again.

Assuming you used the CLI to finalize
Yes, both xf:import and xf:import-finalize using cli.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 Beta 6).

Change log:
Change logic of XF\Import\Manager::isImportRunning so an import is only considered running if the importer code itself still exists.
There may be a delay before changes are rolled out to the XenForo Community.
 
After the upgrade to version 2.2.1, I also get this message in admin CP: "While an import is running sending the activity summary email to inactive users is disabled."
 
You may need to go to Admin > Tools > Import data to see if there's an "incomplete" import in there. What do you see if you go there?

It's possible the import was finished but not marked as complete meaning the import session still exists.
 
Top Bottom