# Issues with Top topic and categories API on local development setup

**URL:** https://meta.discourse.org/t/issues-with-top-topic-and-categories-api-on-local-development-setup/90835
**Category:** Development
**Created:** [June 27, 2018, 4:41am UTC](https://meta.discourse.org/t/issues-with-top-topic-and-categories-api-on-local-development-setup/90835 "2018-06-27T04:41:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ntanh1](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@ntanh1](https://meta.discourse.org/u/ntanh1)
#### Post date: [June 27, 2018, 4:41am UTC](https://meta.discourse.org/t/issues-with-top-topic-and-categories-api-on-local-development-setup/90835/1 "2018-06-27T04:41:21Z")

</div>

Hi team,

I’ve setup a local Discourse server following this tutorial:

> **[Discourse as Your First Rails App](https://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/)**
>
> Update April 4, 2018 The Discourse Vagrant development install is not longer supported and maintained. Current development install guides can be found at meta.discourse.org for Windows, macOS, and Ubuntu.

My version is 1.9.7.

Problem is when I call categories API and top topic API, I don’t get expected result.

1/ Refer the attachment for [http://a52e9808.ngrok.io/categories.json](http://a52e9808.ngrok.io/categories.json) result [categories.json](https://global.discourse-cdn.com/meta/original/3X/c/8/c82984ea6274b60f2b8830775c6c11d2abf5bc56.json) (22.6 KB)

You can see all post\_count is 0 although I have some posts already.

2/ Also when I try to get top topic of a category, I only get empty result, although I already use All time filter. Not sure what I’m missing here.

Please help me look on this.

Thanks,  
Anh

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [June 27, 2018, 5:13am UTC](https://meta.discourse.org/t/issues-with-top-topic-and-categories-api-on-local-development-setup/90835/2 "2018-06-27T05:13:09Z")

</div>

> [@ntanh1](#):
>
> You can see all post\_count is 0 although I have some posts already.

Make sure Sidekiq is running and manually trigger [`CategoryStats`](https://github.com/discourse/discourse/blob/5dbd6a304bed5400be481d71061d3e3ebb4d6785/app/jobs/scheduled/category_stats.rb) job.

> [@ntanh1](#):
>
> when I try to get top topic of a category, I only get empty result

Make sure the topics are not private or that you have sufficient privileges to view topics in that category.

---

<div class="post-metadata">

### Author: ![ntanh1](https://avatars.discourse-cdn.com/v4/letter/n/5e9695/32.png) [@ntanh1](https://meta.discourse.org/u/ntanh1)
#### Post date: [June 27, 2018, 8:11am UTC](https://meta.discourse.org/t/issues-with-top-topic-and-categories-api-on-local-development-setup/90835/3 "2018-06-27T08:11:11Z")

</div>

> [@techAPJ](#):
>
> Make sure Sidekiq is running and manually trigger [`CategoryStats`](https://github.com/discourse/discourse/blob/5dbd6a304bed5400be481d71061d3e3ebb4d6785/app/jobs/scheduled/category_stats.rb) job.
> 
> ![](https://global.discourse-cdn.com/meta/original/3X/7/f/7ff2de41df5cd7103e3356e075171c823cfff51b.png) ntanh1:

I’ve started Sidekiq, but don’t know how to trigger the job (I’m new to Ruby), getting following error:

vagrant@discourse:/vagrant/app/jobs/scheduled$ ruby category\_stats.rb  
category\_stats.rb:3:in `<module:Jobs>': uninitialized constant Jobs::Scheduled (NameError) from category_stats.rb:1:in `’

> [@techAPJ](#):
>
> Make sure the topics are not private or that you have sufficient privileges to view topics in that category.

this user has sufficient privileges, I can give you the account to login as well.
