This is not the same issue people keep posting about with stats not showing up because the newsletters are still in the process of being sent out via cron.
The last two newsletters on my client's site just show "No data available." under the send column, and nothing under any of the following columns. But the Sent Issues area of SimpleNews does show them as having been sent - one several days ago and one a week and a half ago. I even checked phpMyAdmin and the status for both of them is 2. And yet Simplenews statistics shows no info for either one of them. All the info for previous newsletters is still showing up fine; it's just those two. I can't see anything different about them from any of the other previous newsletters... They seem pretty much the same, so I don't know why Simplenews Statistics suddenly stopped working.
Also, I don't know if this is relevant, but the site was running the last version of 6.x-1.x when they were sent, and it's now running 6.x-2.1. But the data was already not showing up before the upgrade, I did uncomment the lines it said I had to for backwards compatibility, and the data from earlier newsletters is showing up just fine. It's just those two.
When checking phpMyAdmin, the simplenews_statistics table has no entries for either of those nodes. The last entry it has is, for some reason, for a node that doesn't appear to exist. It has no corresponding entry in either the simplenews_newsletters table or the node table. The "send" figure for the mystery node is 1. Maybe it was a test newsletter that she sent to herself and then deleted? Not sure if this is related to the problem or not...
I also checked the log entries in the admin, and when the last newsletter was sent out, there are a ton of error notices that all say "Duplicate entry '127' for key 1 query: INSERT INTO simplenews_statistics (nid, send) VALUES (134, 1) in /[path to web directory]/sites/default/modules/simplenews_statistics/simplenews_statistics.module on line 112." (where [path to web directory] is the actual path). 134 is the node ID of the newsletter that was sent that day, and 127 is the node ID of the last entry in the simplenews_statistics table (the one that didn't actually have a corresponding node). It looks like it tried (and failed) to that for every copy of the newsletter that went out, with all of them having 1 in the send field, rather than the send number being incremented. But there wasn't even one entry in the table with 134 as the nid, so I'm not sure why it would be generating duplicate entry errors.
Any ideas? I'm hoping that my having deleted the record for 127 from the simplenews_statistics table will fix it, but whether it does or not, it would be nice to have some idea what on earth was going on there.
Comments
Comment #1
spidersilk commentedA quick follow-up:
I created a new newsletter with only myself as a subscriber, created a new issue of it, and sent it - and the "no data available" problem is still happening. So I guess it wasn't because of the mystery node 127 in the simplenews_statistics table, because that's gone now, but it's still not showing any data for the newsletter I just sent. (And yes, I did wait until it had finished sending, and I made sure to open the e-mail I got and click on a link in it before checking the statistics, so that it would have something to track).
The log didn't record a duplicate entry error for this one. But Simplenews Statistics still didn't record any data. So now I'm really stuck....
Any ideas? Anyone? Please?
Comment #2
Docc commentedIs there any data in the statistics table?
Comment #3
spidersilk commentedNot for those newsletters, no. Only for the ones that were sent before the problem started happening.
The log in the admin doesn't show any errors having occurred (for this last one, anyway), just the newsletter being sent as normal.
I also checked the server error log, but the only error message in there was one saying "Premature end of script headers: cron.php" - which I thought for a minute might be related, until I saw the time stamp and realized it was from 9am, and I sent the newsletter at 10:30 pm. So that error happened long before I sent it and is unlikely to be connected. After that there are no other errors recorded until 8:15 this morning, when I have the same cron error (though cron executes hourly on this site, so it seems to be running fine the rest of the time).
So for some reason Simplenews Statistics isn't writing any data to any of its tables, and whatever is going wrong isn't generating any error messages, started happening spontaneously (as far as I can tell) a couple of weeks ago (after the module had been working fine for months before that), and has happened with both versions 6.x-1.x and 6.x-2.1.
Any ideas? I'm completely at a loss here... Every other part of the site is working fine, and both Drupal core and all modules are up to date.
Comment #4
spidersilk commentedThis issue is still ongoing, and here's a new wrinkle: that record with the nid 127 in the simplenews_statistics table keeps putting itself back. I've deleted it three times, and it always makes a reappearance, even though there is no node 127.
On the last three tests I ran, the first two generated the following error when cron ran to send the newsletters:
user warning: Duplicate entry '127' for key 1 query: INSERT INTO simplenews_statistics (nid, send) VALUES (140, 1) in /[site directory]/sites/default/modules/simplenews_statistics/simplenews_statistics.module on line 146.
140 for the first test, 141 for the second, but with the duplicate being 127 in each case. How the numbers 140 nd 141 are supposed to be duplicates of 127, I really don't know! And this was after I'd deleted the record with nid 127. But I checked, and it was back in there again! So I deleted it again, ran another test, and this time got no error... But no statistics, either. Checked the database table again, and there was record 127, back in place again!
So it looks like every time it tries to write to simplenews_statistics, it is somehow trying to use 127 as the nid over and over regardless of the actual nid -- except that I'm not sure how it could be trying to do that, because the error message shows it trying to insert the correct value!
I think I am just going to have to try uninstalling and reinstalling the module and see if that helps...
Comment #5
Docc commentedclosing as i am working on 3.x if it returns there, reopen.