Jetpack: Recommended features failed to activate. TypeError: Cannot read property 'views_today' of undefined.

Created on 14 Mar 2017  Â·  11Comments  Â·  Source: Automattic/jetpack

Steps to reproduce the issue

  1. Install a new remote WordPress site and delete the dummy post and page content. Empty the site out entirely.
  2. On either a multisite or single installation, it doesn't matter, install/activate Jetpack.
  3. Connect Jetpack to WordPress.com.
  4. Jetpack will offer the option of turning on a set of Recommended features. Do that.
  5. Jetpack will hang and return the error Recommended features failed to activate. TypeError: Cannot read property 'views_today' of undefined. in red. See the screenshot below.
  6. If I wait a minute or so and refresh the page, things look fine, but the stats (understandably) continue to rotate as if they are trying to load.

What I expected

I expected to click Activate Recommended Features, for them to be turned on, and to resume my site setup.

What happened instead

I was presented with an error and was not sure what was activated, if the error was serious, or the complete stack of Recommended Features had been updated.

Screenshots

This is after clicking Activate Recommended Features:

2017-03-14_18-36-57

This is after refreshing the page:

2017-03-14_18-37-41

Admin Page [Status] Needs Author Reply [Type] Bug

Most helpful comment

Should be fixed by #9165

All 11 comments

Thanks for the report!

Unfortunately I can't seem to be able to reproduce right now. If this is still happening for you, could you open the Network tab in your browser's developer tools, check the response for the wp-json/jetpack/v4/module/stats/data?range=day call, and paste it here?

Thanks!

@jeherve, I forgot to add context: this is on an IP-based remote development site that has search engines turned off. I tried to get the information for wp-json/jetpack/v4/module/stats/data?range=day but couldn't find it. Here's a YouTube video showing what happens. Keep in mind that ALL site content must be empty before connecting to Jetpack. If you start a site and then connect with the dummy content in place, the error will not show up:

https://youtu.be/yUxxNzk6qEo

Do you get the same error for all REST API queries on that site, or just for the Stats query?

Could you let me know what the exact response is for the query?

screen shot 2017-03-20 at 22 38 05

Hi, stumbled across this page from a google search. Just had the same problem the OP described. Here is the data from the developer tools that @jeherve asked for:

{"general":{"date":"2017-05-12","stats":{"visitors_today":0,"visitors_yesterday":0,"visitors":0,"views_today":0,"views_yesterday":0,"views_best_day":"2017-05-11","views_best_day_total":0,"views":0,"comments":5,"posts":18,"followers_blog":0,"followers_comments":0,"comments_per_month":0,"comments_most_active_recent_day":"2015-07-29 08:38:30","comments_most_active_time":"08:00","comments_spam":0,"categories":5,"tags":17,"shares":0,"shares_twitter":0,"shares_google-plus-1":0,"shares_facebook":0},"visits":{"unit":"day","fields":["period","views","visitors"],"data":[]}},"day":{"unit":"day","fields":["period","views","visitors"],"data":[]}}

@rfoust That's interesting, views_today appears to be defined for you.

Would you mind contacting us via this contact form, so we can run some more tests with you?

Thanks!

Thank you for following up with Jeremy on this. The last month or two I have been dealing with a company handover (I am now the CEO.) that has taken a massive amount of my attention. I apologize for not following up with you on this, Jeremy.

Sent from my iPhone

On May 12, 2017, at 07:44, Robbie Foust notifications@github.com wrote:

Hi, stumbled across this page from a google search. Just had the same problem the OP described. Here is the data from the developer tools that @jeherve asked for:

{"general":{"date":"2017-05-12","stats":{"visitors_today":0,"visitors_yesterday":0,"visitors":0,"views_today":0,"views_yesterday":0,"views_best_day":"2017-05-11","views_best_day_total":0,"views":0,"comments":5,"posts":18,"followers_blog":0,"followers_comments":0,"comments_per_month":0,"comments_most_active_recent_day":"2015-07-29 08:38:30","comments_most_active_time":"08:00","comments_spam":0,"categories":5,"tags":17,"shares":0,"shares_twitter":0,"shares_google-plus-1":0,"shares_facebook":0},"visits":{"unit":"day","fields":["period","views","visitors"],"data":[]}},"day":{"unit":"day","fields":["period","views","visitors"],"data":[]}}

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

I'm seeing a 404 error trying to get stats.

666641-zen

Do we have any updates on that? The user on 666641-zen is following up :)
Thanks!

@StefMattana Could you try the debug steps above to find out more about the problem?
https://github.com/Automattic/jetpack/issues/6646#issuecomment-287906542

Thanks!

Should be fixed by #9165

Was this page helpful?
0 / 5 - 0 ratings