ocsigen / ocsigenserver

Web server in OCaml.
http://ocsigen.org/ocsigenserver/
Other
100 stars 31 forks source link

Running `Ocsigen_server.start` without specifying `command_pipe` logs a `Unix.Unix_error(Unix.ENOENT` #246

Open shonfeder opened 1 month ago

shonfeder commented 1 month ago

Hi! I'm migrating a project to version 6. So var most things are working great :) Thanks!

Given the following minimal program in main.ml

let () =
  let port = 3000 in
  Ocsigen_server.start
    ~ports:([`All, port])
    ~debugmode:true ~veryverbose:()
    [ Ocsigen_server.host ~port
        []
    ]

on startup via dune exec main I see

main.exe: ocsigen:main: Cannot create the command pipe $HOME/scratch/_opam/lib/ocsigenserver/var/run/ocsigenserver_command. I will continue without.: Unix.Unix_error(Unix.ENOENT, "mkfifo", "$HOME/scratch/_opam/lib/ocsigenserver/var/run/ocsigenserver_command")

When I instead specify a file path (e.g., in /tmp), it is created as expected.

I'm not sure what the intended behavior is here, and whether it should just not try to create a fd for the command pipe if none is specified, or if it should rather create one in a different location (or create this one different). But logging a unix error doesn't seem like the right behavior.

balat commented 1 month ago

I suppose that the directory $HOME/scratch/_opam/lib/ocsigenserver/var/run/ is missing? Or the $HOME variable is not expanded?