amatriain / feedbunch

A simple and elegant feed reader.
http://feedbunch.com
MIT License
84 stars 11 forks source link

"Can't find template for digesting" error when subscribing to a feed #7

Closed jtsay362 closed 9 years ago

jtsay362 commented 9 years ago

Totally newbie question here, sorry.

I can't seem to be able to subscribe to a feed. I did the following (eventually, after encountering errors along the way):

1) forked the repo 2) installed libcurl4-gnutls-dev and libpq-dev (on Ubuntu 14.04) 3) copied config/secrets_ci.yml to config/secrets.yml 4) In config/secrets.yml, set redis_sidekiq and redis_cache to 'redis://localhost:6379' (which is running on my localhost), in the development section 5) rake db:migrate 6) rails s 7) In another terminal, bundle exec sidekiq 8) Browsed http://localhost:3000 and created an account 9) Tried to subscribe to a feed http://www.adbusters.org/blogs/adbusters/feed 10) The log from the rails keeps showing messages like these:

Started GET "/api/subscribe_job_states/3.json" for 127.0.0.1 at 2015-06-07 03:24:14 -0700 Processing by Api::SubscribeJobStatesController#show as JSON Parameters: {"id"=>"3"} User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT 1 [["id", 1]] SubscribeJobState Load (0.1ms) SELECT "subscribe_job_states".* FROM "subscribe_job_states" WHERE "subscribe_job_states"."user_id" = ? AND "subscribe_job_states"."id" = ? LIMIT 1 [["user_id", 1], ["id", 3]] Couldn't find template for digesting: subscribe_job_states/show Completed 304 Not Modified in 4ms (ActiveRecord: 0.1ms)

over and over again and the UI keeps showing:

"Currently adding subscription to feed:

http://www.adbusters.org/blogs/adbusters/feed"

What am I doing wrong?

amatriain commented 9 years ago

The "couldn't find template for digesting" is a red herring, it's generated by rails in certain circumstances when there's not actually any problem. I also see that message in my logs, but it seems to be harmless. There's a closed rails issue where DHH himself says to ignore it.

That log fragment you pasted is not useful to debug the problem. It's just the browser periodically requesting the state of the subscription job, and the server returns a "not modified" every time until the job changes state from "running" to "success" (which in your case never happens, probably because the subscribe job is not actually running).

From what you describe, there probably was an error that prevented the job from being actually enqueued in sidekiq. Look at the logs written immediately after you submit the "add new subscription" form, there will be some error trace. If you're running rails in development mode with rails s you must open the actual log file, don't just look at what gets written to the terminal; the reason is that in the terminal you only see the logs written by rails, but sidekiq is also writing messages in the log file and we're interested in seeing those too. The only way to see all log messages (rails and sidekiq) is to look at the actual log file.

Once we know the trace of the error that prevented the job from being enqueued we'll probably see the problem.

jtsay362 commented 9 years ago

I tried again today after rebooting rails, and I am able to subscribe the feeds now! The only (minor) problem is that after subscribing to a feed, the UI remains in the half-dark state, as if a modal is being displayed. This is even after hitting the close button on the right side of the "Feed subscribed successfully" popup on the bottom of the screen. Refreshing the browser makes everything fine though.

amatriain commented 9 years ago

That backdrop issue sounds like a problem with Bootstrap. What browser are you using? Does it also happen for you in feedbunch.com ? Anybody else experiencing this?

jtsay362 commented 9 years ago

It was happening on Firefox 37.0.1 and Chrome 42.0.2311.90 (64-bit). I've submitted a pull request to fix this.