-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No handler accepted "/" #22
Comments
Also - I can get json from ekg on the server using the header "Accept: application/json". |
Just to clarify, if you do
you get |
Yes, specifically it returns
|
I'm guessing the host in the request doesn't match the ip address? I'll do some logging and try to see whats' going on. |
That would be helpful. Thanks. |
How did you start the server? The server needs access to its data files. This should work automatically if you install ekg but if you build and run it in-tree you need to use:
|
Placing assets to proper place and defining ekg_datadir ekg solved my problem. Thank you @tibbe . |
Same problem here (ekg 0.4). I have all-in-one executable, which is packed in deb package. I placed assets directory in /var/lib/myproject/assets/ and modified init script the following way:
But it didn't solve the problem. Maybe hdaemonize could cause this? BTW, did you consider to embed all necessary files using Template Haskell? |
Can you try
to make sure that the path expands correctly? Using TH brings a host of other issues (cross compilation not working, etc) and since people who ship software to other machines to run there eventually will need to figure out how to ship whole packages of files (i.e. executable plus various templates, data files, etc) anyway, I don't think it's worth it. |
I agree, please don't use TH unless it is really needed. |
@tibbe sure:
|
@afiskon sorry for being unclear, I meant for you to try to see if the Bash expression containing the $NAME etc variables expanded correctly in the context of sudo (as per the above command I gave), not if the directory contents is correct. |
@tibbe yes, the line above:
was an output of command you asked to execute. I just wanted to make it clear that paths are OK. And this:
is a result of:
|
@afiskon Alright, so we know that things are getting invoked correctly. Could you try to add a line that logs whether the data dir is readable/exists (using e.g. monitor store = do
dataDir <- liftIO getDataDir
dataDirExists <- doesDirectoryExist dataDir
unless dataDirExists $
hPutStrLn stderr $ "ERROR: Data directory " ++ dataDir ++ " doesn't exist. If your data files are in a non-standard directory, you might need to set ekg_datadir."
-- ... |
Here's my story while running into this problem: I'm using Stack to build a web app (including ekg) that I'm deploying inside a Docker container. In particular, I'm installing my app in a fresh container with no explicit Haskell dependencies (we'll see how that goes!). JSON API calls to EKG worked but HTML did not. The problem was indeed that the directory of assets didn't exist in the runtime container, and The problem Sean mentions in #48 bit me hard, since if his path to the assets directory was weird, mine using Stack/Docker is really weird. I don't know an easy way to magic these files into my Docker installation, so I cheated: I'm pinning the One final note: You'll see that |
I just hit the same problem with stack and a docker-enabled project |
It might be better to use fileEmbed so that directories don't need to be found. |
In case anyone is looking for a solution, I have this script for building the image: docker pull
stack build
find ~/.stack -name "assets" -exec cp -a {} shared_folder \;
stack image container --build This works with the following docker:
enable: true
repo: "fpco/stack-build"
auto-pull: true
image:
container:
name: image-name
base: fpco/stack-run
add:
shared_folder: /build_stuff And when executed with this ENV var:
|
I'm trying to make ekg accessible out in the open on a server using
when visiting that ip address on that port I get
No handler accepted "/"
. Is this expected? If so, how do I use ekg remotely?The text was updated successfully, but these errors were encountered: