1
votes

I'm running a docpad instance, and it has been working just fine. Suddenly, now when I run docpad watch, the server starts alright and there are no error messages, but when I load http://localhost:9778, the site is not available. No errors appear in the console either, or at the command line. Anyone have any ideas about what might be going wrong?

2
Have you had a look at this page: docpad.org/docs/troubleshoot. It seems to say there is a problem with watch. Does "docpad run" work? What OS are you on? - Steve Mc
This problem is occurring both on a MAC OS (10.9.4) and on my Ubuntu computer (14.10). I looked over that page, but didn't see anything particularly relevant. - fraxture
I tried docpad run and it works fine. So the problem does seem to be with docpad watch, but nothing on the trouble shooting page seems to help. - fraxture
I then need to ask the question, what are you trying to achieve with "docpad watch"? The trouble shooting page does have a couple of entries about "watch", mostly saying that it doesn't work. You're not on Windows, so its not a Windows quirk. Above that, I don't think anyone is going to be able to help you without more details. :) - Steve Mc
I don't read the comments in the troubleshooting doc the way you do. They simply say that the watch mechanisms sometimes doesn't work. But that's not the difficulty I am experiencing. The watch works alright: changes are registered and regeneration occurs. The problem is that the website isn't served. :( I've added an issue in docpad's github account with more details: github.com/docpad/docpad/issues/881 - fraxture

2 Answers

0
votes

I ran into this recently and was able to get things rolling by adding watchFile to the preferredMethods in the docpad config - like so:

# git diff 
--- a/docpad.coffee
+++ b/docpad.coffee
@@ -23,5 +23,6 @@ docpadConfig =
   templateData: fetchConfig()
   watchOptions:
     catchupDelay: 0
+    preferredMethods: ['watchFile','watch']

It's mentioned in the Docpad Troublshooting Hope this helps someone else.

UPDATE: I've now seen this on a co-workers machine and this did not solve the issue. It seems the server is just not responding. Running under debug mode, all looks ok, but when I try to hit it (with curl) I get

Recv failure: Connection reset by peer.

UPDATE2: After a bunch of tries, (reinstalling docpad and restarting things), this same fix seemed to work. What we found was that watch would appear to run but and would see files change, but wasn't actually updating things in the out directory. By adding the watchFile to preferredMethods, things seemed a bit less flaky.

It's weird to because the original config was working for a while (a week of development) with no issues. But today it started being flaky on 2 separate dev environments.

0
votes

The solution that I have run with here is simply to use docpad run, which I think is the best practice. See this discussion for more information.